nette / bootstrap

🅱 The simple way to configure and bootstrap your Nette application.
https://doc.nette.org/bootstrap
Other
663 stars 36 forks source link

Don't set consoleMode for php built-in webserver #59

Closed mabar closed 5 years ago

mabar commented 5 years ago

In case app is accessed via php built-in webserver (php -S 127.0.0.1:80 -t www www/index.php) then PHP_SAPI === 'cli' which means console mode is turned on

JanTvrdik commented 5 years ago

What? Doesn't PHP_SAPI have the same value as php_sapi_name()?

The PHP constant PHP_SAPI has the same value as php_sapi_name(). (https://www.php.net/manual/en/function.php-sapi-name.php#refsect1-function.php-sapi-name-notes)

mabar commented 5 years ago

@JanTvrdik I've also read this, but it's not same. At least for WSL Debian. I am running php built-in webserver and PHP_SAPI is cli while php_sapi_name() is cli-server

mabar commented 5 years ago

Seems like I ran into a weird bug. I dumped these values before 10 times and it was like I previously write. And now it seems ok. I will reopen if I will be able to reproduce it again.