Skip to content
Permalink
Browse files

bug #26740 [FrameworkBundle] fix log level support config handling (x…

…abbuh)

This PR was squashed before being merged into the 4.1-dev branch (closes #26740).

Discussion
----------

[FrameworkBundle] fix log level support config handling

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

2ee6bb4 fix log level support config handling
ad8c8d0 add PHP errors options to XML schema definition
  • Loading branch information...
fabpot committed Apr 2, 2018
2 parents 9504915 + 2ee6bb4 commit 382b5868e420d42d56b48b5da49272c4c9c93996
@@ -656,7 +656,7 @@ private function registerDebugConfiguration(array $config, ContainerBuilder $con
}
if (\is_int($config['log']) && $config['log']) {
$definition->replaceArgument(4, $config['log']);
$definition->replaceArgument(3, $config['log']);
}
if (!$config['throw']) {
@@ -287,7 +287,7 @@
</xsd:complexType>

<xsd:complexType name="php-errors">
<xsd:attribute name="log" type="xsd:boolean" />
<xsd:attribute name="log" type="xsd:string" />
<xsd:attribute name="throw" type="xsd:boolean" />
</xsd:complexType>

@@ -0,0 +1,7 @@
<?php
$container->loadFromExtension('framework', array(
'php_errors' => array(
'log' => 8,
),
));
@@ -0,0 +1,11 @@
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:framework="http://symfony.com/schema/dic/symfony"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">

<framework:config>
<framework:php-errors log="8" />
</framework:config>
</container>
@@ -0,0 +1,3 @@
framework:
php_errors:
log: 8
@@ -352,6 +352,13 @@ public function testDisabledPhpErrorsConfig()
$this->assertSame(0, $container->getParameter('debug.error_handler.throw_at'));
}
public function testPhpErrorsWithLogLevel()
{
$container = $this->createContainerFromFile('php_errors_log_level');
$this->assertEquals(8, $container->getDefinition('debug.debug_handlers_listener')->getArgument(3));
}
public function testRouter()
{
$container = $this->createContainerFromFile('full');

0 comments on commit 382b586

Please sign in to comment.
You can’t perform that action at this time.