Example #1
0
 * 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;