Пример #1
0
 /**
  * Public function that creates a single instance
  */
 public static function getInstance()
 {
     if (!isset(self::$_instance)) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
Пример #2
0
    $url_rewrite = false;
}
// start database engine
if ($db_use && !database_connect()) {
    die('There was an error while trying to connect database.');
}
// transfer display control
$cache = CacheHandler::getInstance();
$module_handler = ModuleHandler::getInstance();
if ($cache->isCached()) {
    // only include specified modules
    $module_handler->loadModules(true);
    // show cached page
    $cache->printCache();
} else {
    // get main section handler so we can transfer control
    $section_handler = MainSectionHandler::getInstance();
    // load all the modules
    $module_handler->loadModules();
    // show page and cache it along the way
    $cache->startCapture();
    $section_handler->transferControl($section, $action, $language);
    $cache->endCapture();
}
// print out copyright and timing
$time_end = explode(" ", microtime());
$time_end = $time_end[0] + $time_end[1];
$time = round($time_end - $time_start, 3);
if (!defined('_OMIT_STATS') && !_AJAX_REQUEST) {
    echo "\n<!-- Page generated with Caracal in {$time} second(s) -->";
}