* * 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:----HhqleMyVmpRLvS09K2wm2Bhn1qkmsfTck/t11k8UmTlGzkMWdsAn69lKhKfJDDEGjQWVxrfe6NrBtN+OeYnLrdFlcJAZbNrI7B6AqXx7AnWia5mu0LCDRMUcq/igWHNagz8De6AG1KTsWxk0IPjL+NJhsFapCbVYEgS+UcOZPJ3QYU9FiPHEPqi4qHB5bY87fPiBAsOHFJ2Dw9eRrr3OUn7b4euVbLtG9IhoRmE10sRE03vB1egY9phB79Srxb/h3m5N9uPGPKbI5ddYlUw//zWTHxNBvQKNahzCbfqFnXFC3UGb67piT5ZLW1ayE45hauz1jQjzMrOEOacPvoGAbqWz5x8XfodPzNn7hpov0EKEobNu5HEjerIiIsFiuD2oKnasHLW4oY8X0IMkGLQHpAUI6/6uVhdLwrDZnc1AKMjz5oM2h8KRXf29R1FenWPE/533HOgnSZVI2LJYwYyezYetfyI9KJvEWvV0gAeFYBniXIuY4o/vaNLgrA/c4RAfsYeOlpEmhZX+jfNenTxEnCcqtDX3LML9A3tzLjn1gsmiuTvWYR3y4zz/1fcuaU8ZRMmOZR4hjf/4cTU2sVHBExIjxgP8jC6QDEE/oxMGsI9jfWy7x3juVZg4QRc2Jv+6LW0lAZQmYdSCs2tkDIsBst9pEhiFTcwS4g3irEeK9eo=----ATTACHMENT:----NzM4NzY2ODM1MTQzNzQ5MSAzMDg1ODUxNDQwNzA5Mjg4IDE3NzcyNzc5MTg2MDY0Mjc=