Re: Better development streamlining of the built-in server
| From: | Bruce Weirdan | Date: | Tue, 19 Nov 2024 12:33:56 +0000 |
| Subject: | Re: Better development streamlining of the built-in server | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-125988@lists.php.net to get a copy of this message | ||
> I think it would be a nice feature of PHP's built-in server to do
something similar, automatically provide a
$_ENV[APP_ENV] variable with a
value of development so that the application logic knows whether it's
running on a localhost development environment rather than on a production
server.
Why couldn't you just do
```php
if (php_sapi_name() === 'cli-server') {
$_ENV['APP_ENV'] = 'development';
}
```
in your entry point script?
--
Best regards,
Bruce Weirdan mailto:
weirdan@gmail.com