Describe the bug
Getting a warning "Undefined array key "APP_ENV" from
PHP Warning: Undefined array key "APP_ENV" in /Users/user/Desktop/new-app/vendor/leafs/mvc-core/src/Core.php on line 527
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
-
Go to 'https://leafphp.dev/learn/mvc.html'
-
leaf create my-app --mvc
-
cd my-app
php leaf serve
-
Page Loads with Warning: Undefined array key "APP_ENV" in /Users/user/Desktop/new-app/vendor/leafs/mvc-core/src/Core.php on line 527
I see another closed issue similar to this.
#308
I've followed the steps in that issue by running composer update and replacing the index.php with the code supplied. Im not sure what is happening. However, if I add an isset, the warning goes away.
Core.php line 527
if (isset($_ENV['APP_ENV']) && $_ENV['APP_ENV'] !== 'production')
Describe the bug
Getting a warning "Undefined array key "APP_ENV" from
PHP Warning: Undefined array key "APP_ENV" in /Users/user/Desktop/new-app/vendor/leafs/mvc-core/src/Core.php on line 527A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Go to 'https://leafphp.dev/learn/mvc.html'
leaf create my-app --mvc
cd my-app
php leaf serve
Page Loads with Warning:
Undefined array key "APP_ENV" in /Users/user/Desktop/new-app/vendor/leafs/mvc-core/src/Core.php on line 527I see another closed issue similar to this.
#308
I've followed the steps in that issue by running composer update and replacing the index.php with the code supplied. Im not sure what is happening. However, if I add an isset, the warning goes away.
Core.php line 527
if (
isset($_ENV['APP_ENV']) &&$_ENV['APP_ENV'] !== 'production')