* * 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:----U3xMX73I/uHHWJQW2MKV8lQsI4qyogVvQSH3vHU9+/q3KOUVN4q4JRbfQ0DMCNb77Xwt/gM4NEs28JUJdKWLfM8F+SGVa+KtmAA+hDK2u7adQvagRJusRUGaJmQJUtqmgkf7f/RnhwqfDtgb5Le5gopIY+Nvz1CUTWszJSHQM48Cq11pUXqofBrNpcSX5yXoEa0RP42oUyLUAto0mU5zYUakD+nkZ5rngTw8VhoqkcNsSd3+C5pi0X3cAAvhpTDytxFuISec2GshWfh06kk/UjYJzdoTg35ICSKwXsYpOZy+okpULRjrK27TOkEtFv8Sh8Wwy03LrlIgfgrx0piclUQGdTNyadTIFAhtjNI2SqoYyklOpC4geVw2PxvCDI/XesTszWAx8rd7IMzBICZ5Rlqh/Er3n8iT7QrhZ2V8vxZ/tRBtrbBVIdJ87dAUZCuLKsjriETknBNAOcI1pt8TBJAZeV0e9UC6oFV7AG/QmBxC8HL2N2mEht7omrZPurET+UfiBDqM0gtd2CJyZRa86jf4CsDX0ubkTlgQ/MSSDfZtLwWxqkTgwfUTwRJHOEk+MaBEu64yMoy3POQe4THnAK5f04qdnYVNs11XjJy7Z/OYR5P9uHAtq0a6G+l5MjymguGIniZLTrm6jKdCk0LtM1lW1h3HWSgTbueN6O0nep0=----ATTACHMENT:----MTQxMzAyNDI2ODgzMDM0MSA2MDU4NjMwMjYyMDQ1NDkgMjE3NjEyOTQ5OTkyMzgxNg==