8000 [FrameworkBundle] framework.php_errors.log now accept a log level by Simperfit · Pull Request #26504 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[FrameworkBundle] framework.php_errors.log now accept a log level #26504

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
Show file tree
Hide file tree
Changes from all commits
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
[FrameworkBundle] framework.php_errors.log now accept a log level
  • Loading branch information
Amrouche Hamza committed Mar 27, 2018
commit 664f821895a24e30e82fcdf98ad4cf4784d72d0d
Original file line number Diff line number Diff line change
Expand Up @@ -833,10 +833,14 @@ private function addPhpErrorsSection(ArrayNodeDefinition $rootNode)
->info('PHP errors handling configuration')
->addDefaultsIfNotSet()
->children()
->booleanNode('log')
->scalarNode('log')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe forbid anything else than a bool|int?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

->info('Use the app logger instead of the PHP logger for logging PHP errors.')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this really descriptive now?

->defaultValue($this->debug)
->treatNullLike($this->debug)
->validate()
->ifTrue(function ($v) { return !(\is_int($v) || \is_bool($v)); })
->thenInvalid('The "php_errors.log" parameter should be either an integer or a boolean.')
->end()
->end()
->booleanNode('throw')
->info('Throw PHP errors as \ErrorException instances.')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,10 @@ private function registerDebugConfiguration(array $config, ContainerBuilder $con
$definition->replaceArgument(1, null);
}

if (\is_int($config['log']) && $config['log']) {
$definition->replaceArgument(4, $config['log']);
}

if (!$config['throw']) {
$container->setParameter('debug.error_handler.throw_at', 0);
}
Expand Down
0