public function init() { $this->iaDb = $this->factory('db'); $this->factory(array('sanitize', 'validate', 'language', 'users')); $this->iaView = $this->factory('view'); $this->iaCache = $this->factory('cache'); iaSystem::renderTime('core', 'Basic Classes Initialized'); $this->getConfig(); iaSystem::renderTime('core', 'Configuration Loaded'); iaSystem::setDebugMode(); $this->_parseUrl(); setlocale(LC_COLLATE | LC_TIME, $this->get('locale')); // we can only load strings when we know if a specific language is requested based on URL iaLanguage::load($this->iaView->language); $this->_fetchHooks(); iaSystem::renderTime('core', 'Hooks Loaded'); $this->startHook('phpCoreUrlRewrite'); $this->_setConstants(); $this->startHook('init'); $this->_authorize(); $this->_forgeryCheck(); $this->getCustomConfig(); $this->startHook('phpCoreBeforePageDefine'); $this->iaView->definePage(); $this->iaView->loadSmarty(); $this->startHook('bootstrap'); $this->_defineModule(); $this->iaView->defineOutput(); $this->_checkPermissions(); $this->_executeModule(); $this->startHook('phpCoreBeforeJsCache'); $this->iaCache->createJsCache(); if (self::ACCESS_FRONT == $this->getAccessType() && iaView::REQUEST_HTML == $this->iaView->getRequestType() && iaView::PAGE_ERROR != $this->iaView->name()) { $this->factory('users')->registerVisitor(); } $this->startHook('phpCoreBeforePageDisplay'); $this->iaView->output(); $this->startHook('finalize'); }
public static function loadCoreClass($name, $type = 'admin') { if (!class_exists('iaCore')) { define('IA_INCLUDES', IA_HOME . 'includes' . IA_DS); define('IA_SMARTY', IA_INCLUDES . 'smarty' . IA_DS); define('IA_CLASSES', IA_INCLUDES . 'classes' . IA_DS); define('IA_PACKAGES', IA_HOME . 'packages' . IA_DS); define('IA_PLUGINS', IA_HOME . 'plugins' . IA_DS); define('IA_TMP', IA_HOME . 'tmp' . IA_DS); define('IA_CACHEDIR', IA_TMP . 'cache' . IA_DS); if (file_exists(IA_INCLUDES . 'config.inc.php')) { include_once IA_INCLUDES . 'config.inc.php'; } else { define('INTELLI_CONNECT', 'mysql'); define('INTELLI_DBHOST', self::getPost('dbhost', 'localhost')); define('INTELLI_DBPORT', self::getPost('dbport', 3306)); define('INTELLI_DBUSER', self::getPost('dbuser')); define('INTELLI_DBPASS', self::getPost('dbpwd')); define('INTELLI_DBNAME', self::getPost('dbname')); define('INTELLI_DBPREFIX', self::getPost('prefix', '', false)); define('INTELLI_DEBUG', false); } set_include_path(IA_CLASSES); require_once 'ia.system.php'; if (function_exists('spl_autoload_register') && function_exists('spl_autoload_unregister')) { spl_autoload_register(array('iaSystem', 'autoload')); } require_once IA_INCLUDES . 'function.php'; require_once 'ia.interfaces.php'; $iaCore = iaCore::instance(); iaSystem::setDebugMode(); $iaCore->factory(array('sanitize', 'validate')); $iaCore->iaDb = $iaCore->factory('db'); $iaCore->factory('language'); $iaCore->iaView = $iaCore->factory('view'); $iaCore->iaCache = $iaCore->factory('cache'); $config = array('baseurl', 'timezone'); $config = $iaCore->iaDb->keyvalue(array('name', 'value'), "`name` IN ('" . implode("','", $config) . "')", iaCore::getConfigTable()); $iaCore->languages = array('en' => 'English'); $iaCore->iaView->language = 'en'; date_default_timezone_set($config['timezone']); define('IA_CLEAR_URL', $config['baseurl']); define('IA_URL', IA_CLEAR_URL); define('IA_FRONT_TEMPLATES', IA_HOME . 'templates' . IA_DS); define('IA_TEMPLATES', IA_FRONT_TEMPLATES); } return iaCore::instance()->factory($name, $type); }