* Include all the active plugins. * By loading them here they'll have global scope. * * We loop through them twice so we can cache all plugin classes on the first load() call. * This gives about 60% improvement. */ foreach (Plugins::list_active() as $file) { include_once $file; } // Call the plugin's load procedure. foreach (Plugins::list_active() as $file) { Plugins::load($file); } // All plugins loaded, tell the plugins. Plugins::act('plugins_loaded'); // Start the session. Session::init(); // Replace the $_COOKIE superglobal with an object representation SuperGlobal::process_c(); // Initiating request handling, tell the plugins. Plugins::act('init'); // Parse and handle the request. Controller::parse_request(); // Run the cron jobs asyncronously. CronTab::run_cron(true); // Dispatch the request (action) to the matched handler. Controller::dispatch_request(); // Flush (send) the output buffer. $buffer = ob_get_clean(); $buffer = Plugins::filter('final_output', $buffer); echo $buffer;
} // Send the Content-Type HTTP header. // @todo Find a better place to put this. header('Content-Type: text/html;charset=utf-8'); // Load and upgrade all the active plugins. spl_autoload_register(array('Plugins', '_autoload')); Plugins::load_active(); Plugins::upgrade(); // All plugins loaded, tell the plugins. Plugins::act('plugins_loaded'); // Start the session. Session::init(); // Replace the $_COOKIE superglobal with an object representation SuperGlobal::process_c(); // Initiating request handling, tell the plugins. Plugins::act('init'); // Load Stack Items Stack::load_stackitems(); if (defined('SUPPRESS_REQUEST')) { return; } // Parse and handle the request. Controller::parse_request(); // Run the cron jobs asyncronously. CronTab::run_cron(Config::get('cron_async', true)); // Dispatch the request (action) to the matched handler. Controller::dispatch_request(); // Flush (send) the output buffer. $buffer = ob_get_clean(); $buffer = Plugins::filter('final_output', $buffer); echo $buffer;