Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[FrameworkBundle] fix log level support config handling #26740

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 2, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix log level support config handling
  • Loading branch information
xabbuh committed Apr 2, 2018
commit 2ee6bb489769290816e43fc8a63a686fd33ea7a1
Original file line number Diff line number Diff line change
Expand Up @@ -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']) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

$container->loadFromExtension('framework', array(
'php_errors' => array(
'log' => 8,
),
));
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
framework:
php_errors:
log: 8
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down