Hi,
I am developing a cms (content management system) using cakephp 3, and would like the user of the cms to be able to enable and disable the debugkit through an administrator form.
I store this choice in database. Problem is, DebugKit is initiated in bootstrap.php, before the value are read from database. I read the value in AppController::initialize(), way too late in the cakephp page load ride.
Is there a better way to let the user enable/disable debugging than letting them edit app.php?
For some reason I cannot use the TableRegistry in bootstrap.php. I get the following exception:
Fatal error: Uncaught Cake\Datasource\Exception\MissingDatasourceConfigException: The datasource configuration “default” was not found.
I have the following line:
use Cake\ORM\TableRegistry;
Further down in code:
$kitchenSink = TableRegistry::get(‘KitchenSink’);
And it is this line of code where the exception happens.
Hi raul338,
that is what I have done, it is at the very bottom of the file bootstrap.php.
I never checked in the code with the kitchensink, but the it was at line 256 here at github:
/madskullcreations/simplicity/blob/master/config/bootstrap.php
(sorry for the incomplete url, I am not allowed to put full links)