Exemple #1
0
 require_once $yii;
 require_once $ibosApplication;
 $commonConfig = (require CONFIG_PATH . 'common.php');
 Yii::setPathOfAlias('application', PATH_ROOT . DIRECTORY_SEPARATOR . 'system');
 Yii::createApplication('application\\core\\components\\Application', $commonConfig);
 Cache::rm('module');
 $allModules = getModuleDirs();
 $customModules = array_diff($allModules, $sysModules);
 $modules = !empty($customModules) ? array_merge($sysModules, $customModules) : $sysModules;
 defined('IN_MODULE_ACTION') or define('IN_MODULE_ACTION', true);
 foreach ($modules as $module) {
     if (getIsInstall($module)) {
         $installPath = getInstallPath($module);
         $config = (require $installPath . 'config.php');
         if (isset($config['authorization'])) {
             Module::updateAuthorization($config['authorization'], $module, $config['param']['category']);
         }
         $extentionScript = $installPath . 'extention.php';
         // 执行模块扩展脚本(如果有)
         if (file_exists($extentionScript)) {
             include_once $extentionScript;
         }
     }
 }
 // 安装演示数据
 if (isset($_SESSION['extData']) && $_SESSION['extData'] == md5('extData')) {
     $sqlData = file_get_contents(PATH_ROOT . './install/data/installExtra.sql');
     $search = array('{time}', '{time1}', '{time2}', '{date}', '{date+1}');
     $replace = array(time(), strtotime('-1 hour'), strtotime('+1 hour'), strtotime(date('Y-m-d')), strtotime('-1 day', strtotime(date('Y-m-d'))));
     $sql = str_replace($search, $replace, $sqlData);
     executeSql($sql);