$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); unset($_SESSION['extData']); } // 安装工作流数据 if (getIsInstall('workflow')) { $sqlFlowData = file_get_contents(PATH_ROOT . './install/data/installFlow.sql'); executeSql($sqlFlowData); } // 为用户添加GUID $users = User::model()->fetchAll(); foreach ($users as $user) { $guid = String::createGuid(); Yii::app()->db->createCommand()->update("{{user}}", array('guid' => $guid), "`uid` = '{$user['uid']}'"); } $cacheArr = array('AuthItem', 'CreditRule', 'Department', 'Ipbanned', 'Nav', 'NotifyNode', 'Role', 'Position', 'PositionCategory', 'Setting', 'UserGroup'); foreach ($cacheArr as $cache) { Cache::update($cache); } Cache::load('usergroup'); // 要注意小写 Cache::update('Users'); // 因为用户缓存要依赖usergroup缓存,所以放在最后单独更新 file_put_contents(PATH_ROOT . 'data/install.lock', ''); $configfile = CONFIG_PATH . 'config.php'; $config = (require $configfile); $host = getHostInfo(); //设置aeskey并保存