0) { ob_end_flush(); } ob_start(static function ($buffer){ return $buffer; }); } /* * -------------------------------------------------------------------- * Debug Toolbar Listeners. * -------------------------------------------------------------------- * If you delete, they will no longer be collected. */ if (CI_DEBUG && !is_cli()) { Events::on('DBQuery', 'CodeIgniter\Debug\Toolbar\Collectors\Database::collect'); Services::toolbar()->respond(); } }); $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', ['\App\Events\Db_log', 'db_log_queries']); Events::on('pre_controller', ['\App\Events\Method', 'validate_method']);