diff --git a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php index 4f65e0f9a331b..d239b7d7d509e 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -23,6 +23,7 @@ use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException; use Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\DumperInterface as ProxyDumper; use Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\NullDumper; +use Symfony\Component\HttpKernel\Kernel; /** * PhpDumper dumps a service container as a PHP class. @@ -53,6 +54,7 @@ class PhpDumper extends Dumper private $reservedVariables = array('instance', 'class'); private $targetDirRegex; private $targetDirMaxMatches; + private $docStar; /** * @var \Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\DumperInterface @@ -97,7 +99,9 @@ public function dump(array $options = array()) $options = array_merge(array( 'class' => 'ProjectServiceContainer', 'base_class' => 'Container', + 'debug' => true, ), $options); + $this->docStar = $options['debug'] ? '*' : ''; if (!empty($options['file']) && is_dir($dir = dirname($options['file']))) { // Build a regexp where the first root dirs are mandatory, @@ -219,9 +223,15 @@ private function addProxyClasses() array($this->getProxyDumper(), 'isProxyCandidate') ); $code = ''; + $strip = '' === $this->docStar && method_exists('Symfony\Component\HttpKernel\Kernel', 'stripComments'); foreach ($definitions as $definition) { - $code .= "\n".$this->getProxyDumper()->getProxyCode($definition); + $proxyCode = "\n".$this->getProxyDumper()->getProxyCode($definition); + if ($strip) { + $proxyCode = "docStar} * Gets the '$id' service.$doc *$lazyInitializationDoc * $return @@ -699,7 +709,7 @@ private function addServiceSynchronizer($id, Definition $definition) return <<docStar} * Updates the '$id' service. */ protected function synchronize{$this->camelize($id)}Service() @@ -760,7 +770,7 @@ private function startClass($class, $baseClass) use Symfony\Component\DependencyInjection\Exception\RuntimeException; $bagClass -/** +/*{$this->docStar} * $class. * * This class has been auto-generated @@ -786,7 +796,7 @@ private function addConstructor() $code = <<docStar} * Constructor. */ public function __construct() @@ -823,7 +833,7 @@ private function addFrozenConstructor() $code = <<docStar} * Constructor. */ public function __construct() @@ -970,11 +980,14 @@ public function getParameterBag() return $this->parameterBag; } EOF; + if ('' === $this->docStar) { + $code = str_replace('/**', '/*', $code); + } } $code .= <<docStar} * Gets the default parameters. * * @return array An array of the default parameters diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 56c87d77f6d38..0edc40b4ca443 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -650,10 +650,7 @@ protected function dumpContainer(ConfigCache $cache, ContainerBuilder $container $dumper->setProxyDumper(new ProxyDumper(md5((string) $cache))); } - $content = $dumper->dump(array('class' => $class, 'base_class' => $baseClass, 'file' => (string) $cache)); - if (!$this->debug) { - $content = static::stripComments($content); - } + $content = $dumper->dump(array('class' => $class, 'base_class' => $baseClass, 'file' => (string) $cache, 'debug' => $this->debug)); $cache->write($content, $container->getResources()); } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy