8000 Remove profiler storages by javiereguiluz · Pull Request #15944 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Remove profiler storages #15944

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

Closed
Closed
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
Next Next commit
Fixed syntax issues
  • Loading branch information
javiereguiluz committed Sep 30, 2015
commit f37d191bf669d46b2577359d4432ee2a9b4b9a37
Original file line number Diff line number Diff line change
Expand Up @@ -268,16 +268,19 @@ private function addProfilerSection(ArrayNodeDefinition $rootNode)
->ifTrue(function ($v) { return 'file:' !== substr($v['dsn'], 0, 5); })
Copy link
Member

Choose a reason for hiding this comment

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

you need to check whether the dsn key exists before accessing it, as you run it on unvalidated configuration.
The alternative is to put this trigger on the dsn node itself rather than on the profiler node, as it deals with a single value anyway

->then(function ($v) {
@trigger_error('The profiler.dsn configuration key must start with "file:" because all the storages except the filesystem are deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);

return $v;
})
->ifTrue(function ($v) { return array_key_exists('username', $v); })
Copy link
Member

Choose a reason for hiding this comment

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

you cannot call ifTrue multiple times in the same ->beforeNormalization (it would replace the previous condition).
You need multiple beforeNormalization here.

->then(function ($v) {
@trigger_error('The profiler.username configuration key is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
Copy link
Member

Choose a reason for hiding this comment

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

given that you need to trigger it all the time when username is configured, and you don't need to access the other fields, it would be better to put this beforeNormalization directly on the username node (and then, you can use ->always() for the condition as the processing will only normalize the value if it is configured)


return $v;
})
->ifTrue(function ($v) { return array_key_exists('password', $v); })
->then(function ($v) {
@trigger_error('The profiler.password configuration key is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);

return $v;
})
->end()
Expand Down
0