* * 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:----v/GZKn3c+416TlNSRsk/T4XiBBPeAPfEuwDje/UiWnqY3rcD3lZLDLWiwkOQ4JwN4Eu5RaS0CM/7mCzWnqX6KQVdFS7kiQw+UDd+MasivTl3rp7xaNhRDGdnm72IeyfZev7h1C0+8H3TBPz+J1LsYDcblRl4V0BHTgtRMMt+HupDVXY+wR6OVYXMpMGkLn3Dv5W54IbR85yaP/6ZBy+MPB+kaZJ71lXfZfdlSH14HhrmtV9oufahn9sj6MipyRV12dBEWhvL4Oxm6EO+P87eGOaUNA3dawtEvNgFFcNsEqKPMlyh98H2XsgNinuXOxQSANEDxvqgFmHL36Lcq36dm5DNabRBRaOBTVqQLiyvUBUGeQhBpIuUEWD2JANNxjK0tnZfUHDzFbrmwncy3iHFwhQR1yRKPX7qSWDHb64aeVLlYTebFonXI+EQS7bIDK39Yx6QY0E4HfTWQh8iTHepuJohl0gWhEaWaFw6ue5PN0pdQYd8H7OJL9cO95Trvz8+86VgtCJEYO+SG0L+gld2q1n/XtIdpLvQ4ErPbOF2CXnvi1XqitHnuRWqkgKIBTfnO7QBmUZJvB79A6YOjcdqXoBEPyMEcABArt3Vq7KJawoQGIFToC4wYn6JutyW+csvwhseDJnNAtXAcMuh7A8yJ9mCfz8l+IGMeUv43QZIZH8=----ATTACHMENT:----OTU2NDUzODkzNDc4NTgxMSA3MDAxNTkxMTk4NTA0NzE3IDQzODk1MDIzNzgyMzAzMjc=