0) { ob_end_flush(); } ob_start(static function ($buffer) { return $buffer; }); try { $config_path = APPPATH . 'config/config.php'; $dotenv = new Dotenv($config_path); $dotenv->overload(); } catch (Exception $e) { // continue, .env file not present } } /* * -------------------------------------------------------------------- * 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(); } }); Events::on('post_controller_constructor', ['Load_config', 'load_config']); //TODO: This fails. Load_config not found Events::on('post_controller', ['Db_log', 'db_log_queries']); Events::on('pre_controller', ['Method', 'validate_method']);