You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use getenv() instead of $_ENV in bootstrap file to ensure environment variables are accessible
This PR updates the `bootstrap` file to use `getenv()` instead of `$_ENV` when retrieving environment variables.
In some PHP configurations, `$_ENV` returns `null` unless the `variables_order` setting in `php.ini` includes the `E` flag. This can cause Octane to fail when resolving the application base path or vendor directory.
By switching to `getenv()`, Octane can reliably fetch environment variables without requiring users to modify their PHP configuration.
### Changes
- Replaced `$_ENV['APP_RUNNING_IN_CONSOLE']` with `getenv('APP_RUNNING_IN_CONSOLE')`.
- Ensured `COMPOSER_VENDOR_DIR` and other variables are resolved consistently.
### Why
When extending the Swoole server start process and attempting to change the vendor file path, `$_ENV` returned `null` unless `variables_order` was explicitly configured. This fix ensures smoother setup for developers across different environments.
### Impact
- No breaking changes.
- Improves reliability of environment variable handling in Swoole/Octane bootstrap.
0 commit comments