diff --git a/src/Symfony/Bundle/ZendBundle/DependencyInjection/ZendExtension.php b/src/Symfony/Bundle/ZendBundle/DependencyInjection/ZendExtension.php old mode 100644 new mode 100755 index 9d1f05d864fb..7c276ec2b936 --- a/src/Symfony/Bundle/ZendBundle/DependencyInjection/ZendExtension.php +++ b/src/Symfony/Bundle/ZendBundle/DependencyInjection/ZendExtension.php @@ -52,6 +52,16 @@ public function loggerLoad($config, ContainerBuilder $container) if (isset($config['path'])) { $container->setParameter('zend.logger.path', $config['path']); } + + if (isset($config['log_errors'])) { + $definition = $container->findDefinition('zend.logger'); + if (false === $config['log_errors'] && $definition->hasMethodCall('registerErrorHandler')) { + $container->findDefinition('zend.logger')->removeMethodCall('registerErrorHandler'); + } + else { + $container->findDefinition('zend.logger')->addMethodCall('registerErrorHandler'); + } + } } /** diff --git a/src/Symfony/Bundle/ZendBundle/Resources/config/logger.xml b/src/Symfony/Bundle/ZendBundle/Resources/config/logger.xml old mode 100644 new mode 100755 index 237b93de411e..65277672a274 --- a/src/Symfony/Bundle/ZendBundle/Resources/config/logger.xml +++ b/src/Symfony/Bundle/ZendBundle/Resources/config/logger.xml @@ -7,6 +7,7 @@ Symfony\Bundle\ZendBundle\Logger\Logger Zend\Log\Logger::CRIT + true Symfony\Bundle\ZendBundle\Logger\DebugLogger Zend\Log\Writer\Stream Zend\Log\Formatter\Simple diff --git a/src/Symfony/Component/DependencyInjection/Definition.php b/src/Symfony/Component/DependencyInjection/Definition.php old mode 100644 new mode 100755 index 1b2f9a27c0d8..473986dbaeb1 --- a/src/Symfony/Component/DependencyInjection/Definition.php +++ b/src/Symfony/Component/DependencyInjection/Definition.php @@ -185,6 +185,43 @@ public function addMethodCall($method, array $arguments = array()) return $this; } + /** + * Removes a method to call after service initialization. + * + * @param string $method The method name to remove + * + * @return Definition The current instance + */ + public function removeMethodCall($method) + { + foreach ($this->calls as $i => $call) { + if ($call[0] === $method) { + unset($this->calls[$i]); + break; + } + } + + return $this; + } + + /** + * Check if the current definition has a given method to call after service initialization. + * + * @param string $method The method name to search for + * + * @return boolean + */ + public function hasMethodCall($method) + { + foreach ($this->calls as $i => $call) { + if ($call[0] === $method) { + return true; + } + } + + return false; + } + /** * Gets the methods to call after service initialization. *