8000 fix log level support config handling · symfony/symfony@2ee6bb4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2ee6bb4

Browse files
committed
fix log level support config handling
1 parent ad8c8d0 commit 2ee6bb4

File tree

6 files changed

+30
-2
lines changed

6 files changed

+30
-2
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ private function registerDebugConfiguration(array $config, ContainerBuilder $con
656656
}
657657

658658
if (\is_int($config['log']) && $config['log']) {
659-
$definition->replaceArgument(4, $config['log']);
659+
$definition->replaceArgument(3, $config['log']);
660660
}
661661

662662
if (!$config['throw']) {

src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@
287287
</xsd:complexType>
288288

289289
<xsd:complexType name="php-errors">
290-
<xsd:attribute name="log" type="xsd:boolean" />
290+
<xsd:attribute name="log" type="xsd:string" />
291291
<xsd:attribute name="throw" type="xsd:boolean" />
292292
</xsd:complexType>
293293

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
$container->loadFromExtension('framework', array(
4+
'php_errors' => array(
5+
'log' => 8,
6+
),
7+
));
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" ?>
2+
<container xmlns="http://symfony.com/schema/dic/services"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xmlns:framework="http://symfony.com/schema/dic/symfony"
5+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
6+
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
7+
8+
<framework:config>
9+
<framework:php-errors log="8" />
10+
</framework:config>
11+
</container>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
framework:
2+
php_errors:
3+
log: 8

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,13 @@ public function testDisabledPhpErrorsConfig()
352352
$this->assertSame(0, $container->getParameter('debug.error_handler.throw_at'));
353353
}
354354

355+
public function testPhpErrorsWithLogLevel()
356+
{
357+
$container = $this->createContainerFromFile('php_errors_log_level');
358+
359+
$this->assertEquals(8, $container->getDefinition('debug.debug_handlers_listener')->getArgument(3));
360+
}
361+
355362
public function testRouter()
356363
{
357364
$container = $this->createContainerFromFile('full');

0 commit comments

Comments
 (0)
0