Last active
December 31, 2015 18:09
-
-
Save lenybernard/8024870 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| public function process(ContainerBuilder $container) | |
| { | |
| if (!$container->hasDefinition('jms_translation.config_factory')) { | |
| error_log('jms_translation.config_factory not exists'); | |
| return; | |
| } | |
| $definition = $container->getDefinition('jms_translation.config_factory'); | |
| $victoireBasePath = $container->getParameterBag()->get('kernel.root_dir').'/../src/Victoire'; | |
| $finder = new Finder(); | |
| $finder->directories()->in($victoireBasePath)->depth(' == 0'); | |
| $requests = array(); | |
| foreach ($finder as $bundle) { | |
| $def = new Definition('JMS\TranslationBundle\Translation\ConfigBuilder'); | |
| $def->addMethodCall('setTranslationsDir', array($victoireBasePath."/".$bundle->getFilename().'/Resources/translations')); | |
| $def->addMethodCall('setScanDirs', array(array($victoireBasePath."/".$bundle->getFilename()))); | |
| $definition->addMethodCall( | |
| 'addBuilder', | |
| array($bundle->getFilename(), $def) | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment