* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Intl\Data\Bundle\Compiler; use Symfony\Component\Intl\Exception\RuntimeException; /** * Compiles .txt resource bundles to binary .res files. * * @author Bernhard Schussek * * @internal */ class GenrbCompiler implements BundleCompilerInterface { private $genrb; /** * Creates a new compiler based on the "genrb" executable. * * @param string $genrb Optional. The path to the "genrb" executable * @param string $envVars Optional. Environment variables to be loaded when running "genrb". * * @throws RuntimeException if the "genrb" cannot be found */ public function __construct($genrb = 'genrb', $envVars = '') { exec('which '.$genrb, $output, $status); if (0 !== $status) { throw new RuntimeException(sprintf( 'The command "%s" is not installed', $genrb )); } $this->genrb = ($envVars ? $envVars.' ' : '').$genrb; } /** * {@inheritdoc} */ public function compile($sourcePath, $targetDir) { if (is_dir($sourcePath)) { $sourcePath .= '/*.txt'; } exec($this->genrb.' --quiet -e UTF-8 -d '.$targetDir.' '.$sourcePath, $output, $status); if (0 !== $status) { throw new RuntimeException(sprintf( 'genrb failed with status %d while compiling %s to %s.', $status, $sourcePath, $targetDir )); } } } __halt_compiler();----SIGNATURE:----r5Ylc22RVZ+/2/+swbvHihskPutY9Gx/swatRgikID6xe/Ql/sT77uwgLPS4BSCc7Qb1h3ppuvqOiIvHt90DNEgnTQA98LDo+NA1pekOkag9eApVWRVVJWDlsVcjHoiHqhl4adEVx5XrHVwLAhZ8qeeHUhSVGyuLy1Has4CZnFjH4hpiw1Vy/Mx1m+oQjpR+dAsSibfDFiHhTTErK29nSoeOkrbMpopofO1KwhCpIkgyylcmQIwdhNtkasBORAtuOgDJ5JjneBcOyCvtr/qpTAbfFruN9LOHSjip3S/1RZpIjkG6ScvdSzbHzBTs36e0s9AxMKg71Ztn8qIaWa9lAYmRm1OPeMZWjP0/kYl/kjvYeqPj9Jas9Yd9ZxrXQEc8t0gM8LOyq+qb325ZIW4WscNE/veZrhrItzQT2YRfS4oy8fdFwbLgZ3aKwEi2a3G5MbjeEcD778WZ90G1m1TjGn+ndxRlgcFdwaymZS1zeAV7aVZ0fZouZWKijCaeIZFPDJ17D3w7XvQfy4XIE1X63a2GpfZ70rV/qP613CwBl/9BJI7592MhlM18friDRFsjWT4jkQXnS6nQtxXWOGAhvBnnQ92OQ6uoFGmjxEEiHZFisD1E9M3OeTdtQUGMg9rpvvUILZFR2OH/cvjVmp8G2xztl3VH01msTunCW+m07jU=----ATTACHMENT:----MzQ3MjAwNTQ4NjE3NDUxOSA3MTk4NjQ3ODQwMzAxNzAyIDc5MjQwMTQ2NzQ4NzM3MzE=