Fixing runtime bugs

- instantiating Load_config
- Added todos
This commit is contained in:
objecttothis
2022-11-20 21:03:37 +04:00
committed by Steve Ireland
parent 6a9e1f6fc1
commit eaeabd8850
2 changed files with 6 additions and 4 deletions

View File

@@ -2,6 +2,7 @@
namespace Config;
use App\Events\Load_config;
use CodeIgniter\Events\Events;
use CodeIgniter\Exceptions\FrameworkException;
@@ -52,8 +53,9 @@ Events::on('pre_system', function ()
}
});
Events::on('post_controller_constructor', ['Load_config', 'load_config']);
$config = new Load_config(); //TODO: Not 100% sure this is the best way to do this, but without instantiating the class, the event engine tries to run the function as if it were static.
Events::on('post_controller_constructor', [$config, 'load_config']);
Events::on('post_controller', ['Db_log', 'db_log_queries']);
Events::on('post_controller', ['\App\Events\Db_log', 'db_log_queries']);
Events::on('pre_controller', ['Method', 'validate_method']);
Events::on('pre_controller', ['\App\Events\Method', 'validate_method']);

View File

@@ -23,7 +23,7 @@ class Load_config
{
//Migrations
$migration_config = config('Migrations');
$migration = new My_Migration($migration_config);
$migration = new MY_Migration($migration_config); //TODO: This errors out. We need to figure out how to automatically check and run latest migrations in CI4... the CI3 method is different.
$this->session = session();