/** * phpwind初始化 * * @return void */ public static function init($name) { function_exists('set_magic_quotes_runtime') && @set_magic_quotes_runtime(0); self::_loadSystemConfig($name); $_conf = (include WEKIT_PATH . self::S('directory')); foreach ($_conf as $namespace => $path) { $realpath = realpath(WEKIT_PATH . $path); Wind::register($realpath, $namespace); define($namespace . '_PATH', $realpath . DIRECTORY_SEPARATOR); } Wind::register(WEKIT_PATH, 'WEKIT'); self::_loadBase(); self::$_var = self::S('global-vars'); }
/** * 创建当前应用实例 */ public static function createapp($appName) { if (!is_object(self::$_app)) { self::$_var = (include CONF_PATH . 'baseconfig.php'); self::$_cache = new PwCache(); if (self::$_var['dbcache'] && self::$_cache->isDbCache()) { PwLoader::importCache(include CONF_PATH . 'cacheService.php'); } $class = Wind::import('SRC:bootstrap.' . $appName . 'Boot'); self::$_app = new $class(); self::$_config = self::$_app->getConfig(); define('WEKIT_TIMESTAMP', self::$_app->getTime()); } }