Hi,
I am using php spark to bootstrap the tables/database seeding in my codeigniter 4 app, but spark is not recognizing the "ENVIRONMENT" environment variable set by docker-compose.yml. To clarify, my CI4 app is picking up the environment variables, just not spark.
Here is the stack trace from the docker container when I run: php spark
Code:
Fatal error: Uncaught Error: Undefined constant "ENVIRONMENT" in /var/www/html/Tooths/system/Common.php:777
Stack trace:
#0 /var/www/html/Tooths/system/Debug/Exceptions.php(458): log_message('warning', '[DEPRECATED] {m...', Array)
#1 /var/www/html/Tooths/system/Debug/Exceptions.php(216): CodeIgniter\Debug\Exceptions->handleDeprecationError('Creation of dyn...', '/var/www/html/T...', 218)
#2 /var/www/html/Tooths/app/Config/App.php(218): CodeIgniter\Debug\Exceptions->errorHandler(8192, 'Creation of dyn...', '/var/www/html/T...', 218)
#3 /var/www/html/Tooths/system/Config/Factories.php(235): Config\App->__construct()
#4 /var/www/html/Tooths/system/Config/Factories.php(169): CodeIgniter\Config\Factories::createInstance('config', 'Config\\App', Array)
#5 /var/www/html/Tooths/system/Config/Factories.php(188): CodeIgniter\Config\Factories::__callStatic('config', Array)
#6 /var/www/html/Tooths/system/Common.php(207): CodeIgniter\Config\Factories::get('config', 'Config\\App')
#7 /var/www/html/Tooths/system/Config/Services.php(564): config('Config\\App')
#8 /var/www/html/Tooths/system/Config/BaseService.php(311): CodeIgniter\Config\Services::incomingrequest(NULL, false)
#9 /var/www/html/Tooths/system/Config/Services.php(526): CodeIgniter\Config\BaseService::__callStatic('incomingrequest', Array)
#10 /var/www/html/Tooths/system/Config/BaseService.php(311): CodeIgniter\Config\Services::request(NULL, false)
#11 /var/www/html/Tooths/system/Config/BaseService.php(250): CodeIgniter\Config\BaseService::__callStatic('request', Array)
#12 /var/www/html/Tooths/system/Config/Services.php(522): CodeIgniter\Config\BaseService::getSharedInstance('request', NULL)
#13 /var/www/html/Tooths/system/Config/BaseService.php(311): CodeIgniter\Config\Services::request()
#14 /var/www/html/Tooths/system/Debug/Exceptions.php(129): CodeIgniter\Config\BaseService::__callStatic('request', Array)
#15 /var/www/html/Tooths/system/Debug/Exceptions.php(252): CodeIgniter\Debug\Exceptions->exceptionHandler(Object(ErrorException))
#16 [internal function]: CodeIgniter\Debug\Exceptions->shutdownHandler()
#17 {main}
thrown in /var/www/html/Tooths/system/Common.php on line 777
Not sure if relevant, but I also found the following output in the logs:
Code:
This "system/bootstrap.php" is no longer used. If you are seeing this error message,
the upgrade is not complete. Please refer to the upgrade guide and complete the upgrade.
See https://codeigniter4.github.io/userguide/installation/upgrade_450.html