Skip to content

Conversation

nicolas-grekas
Copy link
Member

Q A
License MIT

ping @stof

symfony-bot
symfony-bot previously approved these changes Aug 30, 2017
stof
stof previously requested changes Aug 30, 2017
// 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);
Copy link
Member

@stof stof Aug 30, 2017

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

Copy link
Member Author

Choose a reason for hiding this comment

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

L15 updated

Copy link
Member

@yceruto yceruto Aug 30, 2017

Choose a reason for hiding this comment

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

Copy link
Contributor

@Tobion Tobion Aug 30, 2017

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.

Copy link
Member Author

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.

@yceruto
Copy link
Member

yceruto commented Aug 30, 2017

Should be updated bin/console too.

@nicolas-grekas
Copy link
Member Author

@yceruto nope, nothing to change in console

@yceruto
Copy link
Member

yceruto commented Aug 30, 2017

Yes, I mean, true !== '0' is true for non-debug env var, no?

@nicolas-grekas
Copy link
Member Author

@yceruto the console has debug on by default - "true" hints this to me.

@yceruto
Copy link
Member

yceruto commented Aug 30, 2017

Oh I see, the previous behavior didn't change for bin/console, we're good then :)

@symfony-bot symfony-bot merged commit 045a756 into symfony:master Aug 30, 2017
javiereguiluz added a commit to symfony/demo that referenced this pull request Aug 30, 2017
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
@nicolas-grekas nicolas-grekas deleted the fix-debug branch August 31, 2017 09:25
sayjun0505 added a commit to sayjun0505/sym_proj that referenced this pull request Apr 16, 2023
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
spider-yamet added a commit to spider-yamet/sym_proj that referenced this pull request Apr 16, 2023
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
frederickboyd pushed a commit to frederickboyd/frederickboyd that referenced this pull request May 25, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants