* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Intl\Data\Generator; use Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface; use Symfony\Component\Intl\Data\Bundle\Compiler\GenrbCompiler; use Symfony\Component\Intl\Data\Util\LocaleScanner; /** * The rule for compiling the script bundle. * * @author Bernhard Schussek * * @internal */ class ScriptDataGenerator extends AbstractDataGenerator { /** * Collects all available language codes. * * @var string[] */ private $scriptCodes = array(); /** * {@inheritdoc} */ protected function scanLocales(LocaleScanner $scanner, $sourceDir) { return $scanner->scanLocales($sourceDir.'/lang'); } /** * {@inheritdoc} */ protected function compileTemporaryBundles(GenrbCompiler $compiler, $sourceDir, $tempDir) { $compiler->compile($sourceDir.'/lang', $tempDir); } /** * {@inheritdoc} */ protected function preGenerate() { $this->scriptCodes = array(); } /** * {@inheritdoc} */ protected function generateDataForLocale(BundleReaderInterface $reader, $tempDir, $displayLocale) { $localeBundle = $reader->read($tempDir, $displayLocale); // isset() on \ResourceBundle returns true even if the value is null if (isset($localeBundle['Scripts']) && null !== $localeBundle['Scripts']) { $data = array( 'Version' => $localeBundle['Version'], 'Names' => iterator_to_array($localeBundle['Scripts']), ); $this->scriptCodes = array_merge($this->scriptCodes, array_keys($data['Names'])); return $data; } } /** * {@inheritdoc} */ protected function generateDataForRoot(BundleReaderInterface $reader, $tempDir) { } /** * {@inheritdoc} */ protected function generateDataForMeta(BundleReaderInterface $reader, $tempDir) { $rootBundle = $reader->read($tempDir, 'root'); $this->scriptCodes = array_unique($this->scriptCodes); sort($this->scriptCodes); return array( 'Version' => $rootBundle['Version'], 'Scripts' => $this->scriptCodes, ); } } __halt_compiler();----SIGNATURE:----e82+7rZvIxFVo0s3R9ZMj4Uw6MU8zmONvTSPBNWyiQIxZ5taPPSNNofFLkzeCk5tlRkKJMOnygBbx5totPAy/rnKl3QS2MtadPj21MRnZMcD/afa/OEW8vzp4mgBeiMRd6EoAlqYRRG1FzlHRxccm75PDsRBypmw072jbf0VhW1JgXRAZWuSPstjTPQayyGgPWqJtEVZhUl+r87cMA82BeVUd+kWav6A4/Ut2DjW3xBiYhRiekYLcYmgKH8hcqZlYhTQiNdYk7Qq4S2SOLzHyn/5f3ksOkyke6LrFdxH3PzgW/khr5Kqd3/R0TKQIP4zzLfmpBWBshZIuVMpa6978FVvIE01nTPiI4Au+0EFLk1FWA/bbDo3ziQ560V6Cc0dwc+m+q4hiGFoxcW7BaQcetlQ5zhXcUZwFDVTf9UdfX64mcyf8HwVBzsX3EyNbgKNnUIFUnqgxgF2A48mdtaMRLKPxPwTdRY63uds50+Y/jt8oxbZYu3zsC8arpM3YEbxPTphYTswAc0nziRF6Kc/HFsMu8aOdtUsUiumD1To7hg36kh1oKyQXV5GBikYeHLEoKlCAA/UE35zTBCM/RmQWlnd15otTSljFKl8ft3IbFh4CD7P7HeZ/JxeOUVKcNjwdCEhjl50we3rTh0ziPZgK/7pu9B5fUOXYUnHx72+044=----ATTACHMENT:----ODU1MTkxMjkzNTE4Mzk5NyA4ODAxMDQ2MDAwMDA3NTkyIDEzNDU0NTAwMDMzNTE2Mjk=