/** * Dumps the container configuration as an XML file for rebuilding. * * @param ContainerBuilder $container The container builder. * @param string $file The path to the cache file. */ private function dumpXmlConfig(ContainerBuilder $container, $file) { $file = sprintf('%s%s%s.xml', dirname($file), DIRECTORY_SEPARATOR, pathinfo($file, PATHINFO_FILENAME)); $container->getDefinition(self::getId('helper.container'))->addMethodCall('setFile', array($file)); $dumper = new XmlDumper($container); $writer = new File($file, 'w'); $writer->fwrite($dumper->dump()); }