/** * {@inheritdoc} */ public function afterCompile(CompilationContextInterface $context) { // \ResourceBundle does not like locale names with uppercase chars, so rename // the resource file // See: http://bugs.php.net/bug.php?id=54025 $fileName = $context->getBinaryDir() . '/curr/supplementalData.res'; $fileNameLower = $context->getBinaryDir() . '/curr/supplementaldata.res'; $context->getFilesystem()->rename($fileName, $fileNameLower); }
/** * Runs the compilation with the given compilation context. * * @param CompilationContextInterface $context The context storing information * needed to run the compilation. * * @throws RuntimeException If any of the files to be compiled by the loaded * compilation rules does not exist. */ public function compileBundles(CompilationContextInterface $context) { $filesystem = $context->getFilesystem(); $compiler = $context->getCompiler(); $filesystem->remove($context->getBinaryDir()); $filesystem->mkdir($context->getBinaryDir()); foreach ($this->rules as $rule) { $filesystem->mkdir($context->getBinaryDir() . '/' . $rule->getBundleName()); $resources = (array) $rule->beforeCompile($context); foreach ($resources as $resource) { if (!file_exists($resource)) { throw new RuntimeException(sprintf('The file "%s" to be compiled by %s does not exist.', $resource, get_class($rule))); } $compiler->compile($resource, $context->getBinaryDir() . '/' . $rule->getBundleName()); } $rule->afterCompile($context); } }