-
-
Notifications
You must be signed in to change notification settings - Fork 498
Default to non-debug in index.php #163
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
Conversation
// Request::setTrustedProxies(['0.0.0.0/0'], Request::HEADER_FORWARDED); | ||
|
||
$kernel = new Kernel($_SERVER['APP_ENV'] ?? 'dev', $_SERVER['APP_DEBUG'] ?? true); | ||
$kernel = new Kernel($_SERVER['APP_ENV'] ?? 'dev', $_SERVER['APP_DEBUG'] ?? false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting APP_DEBUG
to '0'
explicitly (which triggers non-debug mode in the console) will pass a non-empty string here, and so be truthy.
And you also need to update line 15
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
L15 updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... and so be truthy.
Nope, anyway (bool) '0'
should be false
in https://github.com/symfony/symfony/blob/edb8c33f35b981b72adbe23798753703edfe3819/src/Symfony/Component/HttpKernel/Kernel.php#L83
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bool cast should be added here. Otherwise it's not passing the right type, esp. if we add type declarations for sf 4.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Tobion we don't have strict type enabled so this is not required: php will do the cast for us based on the type hint.
Should be updated |
@yceruto nope, nothing to change in console |
Yes, I mean, |
@yceruto the console has debug on by default - "true" hints this to me. |
Oh I see, the previous behavior didn't change for |
This PR was merged into the master branch. Discussion ---------- Default to non-debug in index.php and console See symfony/recipes#163 Commits ------- d1943cf Default to non-debug in index.php and console
This PR was merged into the master branch. Discussion ---------- Default to non-debug in index.php and console See symfony/recipes#163 Commits ------- d1943cf Default to non-debug in index.php and console
This PR was merged into the master branch. Discussion ---------- Default to non-debug in index.php and console See symfony/recipes#163 Commits ------- d1943cf Default to non-debug in index.php and console
This PR was merged into the master branch. Discussion ---------- Default to non-debug in index.php and console See symfony/recipes#163 Commits ------- d1943cf Default to non-debug in index.php and console
ping @stof