* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Intl\Data\Provider; use Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface; use Symfony\Component\Intl\Locale; /** * Data provider for locale-related ICU data. * * @author Bernhard Schussek * * @internal */ class LocaleDataProvider { private $path; private $reader; /** * Creates a data provider that reads locale-related data from .res files. * * @param string $path The path to the directory containing the .res files * @param BundleEntryReaderInterface $reader The reader for reading the .res files */ public function __construct($path, BundleEntryReaderInterface $reader) { $this->path = $path; $this->reader = $reader; } public function getLocales() { return $this->reader->readEntry($this->path, 'meta', array('Locales')); } public function getAliases() { $aliases = $this->reader->readEntry($this->path, 'meta', array('Aliases')); if ($aliases instanceof \Traversable) { $aliases = iterator_to_array($aliases); } return $aliases; } public function getName($locale, $displayLocale = null) { if (null === $displayLocale) { $displayLocale = Locale::getDefault(); } return $this->reader->readEntry($this->path, $displayLocale, array('Names', $locale)); } public function getNames($displayLocale = null) { if (null === $displayLocale) { $displayLocale = Locale::getDefault(); } $names = $this->reader->readEntry($this->path, $displayLocale, array('Names')); if ($names instanceof \Traversable) { $names = iterator_to_array($names); } $collator = new \Collator($displayLocale); $collator->asort($names); return $names; } } __halt_compiler();----SIGNATURE:----s2ZmKM5fblocF2Wj313AUoiTpbWJE3rCwlyOoyc03vBc+NVhEYq9oR04NsyMJyBUOERtPmV8t+xsAqYnnAqaL1LEkidQJ4s9JVyosbMc7N33XUmM/npFq7M5ZhoJoBheyNGYxS0g4MgRyVeNmkRpKtmH7t5qtg82GBzhMUOplcRP+6W61bN6Uviqd4kqrYXAov2lQCnMHgj0AG13eNWDaDciMSNuGpij6qwmKdPyICL4ptr6e06iej2JgY7LCcRtQKSst0l+3fKrWZyieuJ3lrDrAxEM/91qASFk3SEtrmnltWq7xuQWBFhcH3vqUszh1oeFIhHBp4g8odYnNAVaQriT85q5yCGZB3tq7EcaLUri3mC+4wg+Jz5a79stH9UEnPkPxsmwV89ZFFRW2n0aqfLwiRJa2+PsLq37oCx8KjIMkAF/9Fme2ZYsV6+uTWEA0z3Pos6zgayXLUZzYrn4BZ8KczQ3iJSIQONI/0BlGLFlVbwGJ0C2Vkdjqlq7GBdJkzgtRcdGG3DMgoLgZvd5uTH+9oZVAapjM2d+55raxghRWXobymQy+fE4Ok639Be6OdClqaKOa+LbExcbKQ1dEU+pVXX72NlyodJvY42YetHDP/KjYlHP30WZDUMUy/qC54KA3xi08b3fact9lM1bU/Wo2XJ3jBjwLkM8HljAqGA=----ATTACHMENT:----MjgxNTM2NjkwNTc1OTEgOTM5OTA4MjEzMDczNjAxNCAyMzE1MTEyNDM5MzQzNTc5