/** * get_instance function * * Return singleton instance * * @return object **/ static function get_instance() { if (self::$_instance === NULL) { self::$_instance = new self(); } return self::$_instance; }
@ini_set('unserialize_callback_func', 'spl_autoload_call'); spl_autoload_register('Ai1ec_Loader::autoload'); global $ai1ec_log4php_config; $ai1ec_log4php_config = (include AI1EC_PATH . DIRECTORY_SEPARATOR . 'log4php-config.php'); if (!AI1EC_DEBUG) { foreach ($ai1ec_log4php_config['appenders'] as &$appender) { if (!isset($appender['filters'])) { $appender['filters'] = array(); } $appender['filters'][] = array('class' => 'LoggerFilterLevelRange', 'params' => array('levelMin' => 'warn')); } unset($appender); } Logger::configure($ai1ec_log4php_config); global $ai1ec_themes_controller; $ai1ec_themes_controller = Ai1ec_Themes_Controller::get_instance(); // get the active theme from the the theme controllor $active_theme = $ai1ec_themes_controller->active_template_path(); // Are we in preview_mode? $preview_mode = false; // If we are previewing the theme, use the theme passed in the url if (isset($_GET['preview']) && isset($_GET['ai1ec_stylesheet'])) { Ai1ec_Less_Factory::set_preview_mode(true); $active_theme = $_GET['ai1ec_stylesheet']; $preview_mode = true; } // Start_up the factories Ai1ec_Less_Factory::set_active_theme_path(AI1EC_THEMES_ROOT . DIRECTORY_SEPARATOR . $active_theme); Ai1ec_Less_Factory::set_default_theme_path(AI1EC_DEFAULT_THEME_PATH); Ai1ec_Less_Factory::set_default_theme_url(AI1EC_DEFAULT_THEME_URL); // ==================================