Example #1
0
    $installer->upgrade_db();
}
// If we're doing unit testing, stop here
if (defined('UNIT_TEST')) {
    return;
}
// if this is an asyncronous call, ignore abort.
if (isset($_GET['asyncronous']) && Utils::crypt(Options::get('guid'), $_GET['asyncronous'])) {
    ignore_user_abort(true);
}
// Send the Content-Type HTTP header.
// @todo Find a better place to put this.
header('Content-Type: text/html;charset=utf-8');
// Load all the active plugins.
spl_autoload_register(array('Plugins', '_autoload'));
Plugins::load_active();
// 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.
Example #2
0
 public static function run_dir($directory = null)
 {
     self::$run_all = true;
     if (!isset($directory)) {
         $directory = dirname(__FILE__);
     }
     spl_autoload_register(array('\\Habari\\Plugins', '_autoload'));
     Plugins::load_active();
     // Find unit tests, include them
     $unit_tests = glob($directory . '/units/test_*.php');
     $unit_tests = Plugins::filter('list_unit_tests', $unit_tests);
     foreach ($unit_tests as $test) {
         include $test;
     }
     // Find feature steps, include them
     $feature_steps = glob($directory . '/steps/step_*.php');
     $feature_steps = Plugins::filter('list_feature_steps', $feature_steps);
     foreach ($feature_steps as $step) {
         include $step;
     }
     // Find feature files, list them
     self::$features = glob($directory . '/features/*.feature');
     self::$features = Plugins::filter('list_features', self::$features);
     // Find step files, list them
     self::$step_files = glob($directory . '/features/step_definitions/*.php');
     self::$step_files = Plugins::filter('list_step_definitions', self::$step_files);
     self::run_all();
 }