diff --git a/module/install/control.php b/module/install/control.php index b379f27744..cfbbabf510 100644 --- a/module/install/control.php +++ b/module/install/control.php @@ -55,6 +55,8 @@ class install extends control $this->view->phpVersion = $this->install->getPhpVersion(); $this->view->phpResult = $this->install->checkPHP(); $this->view->pdoResult = $this->install->checkPDO(); + $this->view->sessionResult = $this->install->checkSessionSavePath(); + $this->view->sessionInfo = $this->install->getSessionSavePath(); $this->view->pdoMySQLResult = $this->install->checkPDOMySQL(); $this->view->jsonResult = $this->install->checkJSON(); $this->view->tmpRootInfo = $this->install->getTmpRoot(); diff --git a/module/install/lang/en.php b/module/install/lang/en.php index 7adb1c502b..d8b53ebdda 100644 --- a/module/install/lang/en.php +++ b/module/install/lang/en.php @@ -61,6 +61,8 @@ $lang->install->json = 'JSON extension'; $lang->install->jsonFail = 'Edit the php.ini file to load JSON extension'; $lang->install->tmpRoot = 'Temp directory'; $lang->install->dataRoot = 'Upload directory.'; +$lang->install->session = 'Session save path'; +$lang->install->sessionFail = 'Edit the php.ini file to set session.save_path'; $lang->install->mkdir = '

Should creat the directory %s。
Under linux, can try
mkdir -p %s

'; $lang->install->chmod = 'Should change the permission of "%s".
Under linux, can try
chmod o=rwx -R %s'; diff --git a/module/install/lang/zh-cn.php b/module/install/lang/zh-cn.php index 7990f48424..fc6e0271e3 100644 --- a/module/install/lang/zh-cn.php +++ b/module/install/lang/zh-cn.php @@ -61,6 +61,8 @@ $lang->install->json = 'JSON扩展'; $lang->install->jsonFail = '修改PHP配置文件,加载JSON扩展。'; $lang->install->tmpRoot = '临时文件目录'; $lang->install->dataRoot = '上传文件目录'; +$lang->install->session = 'Session存储目录'; +$lang->install->sessionFail = '修改PHP配置文件,设置session.save_path'; $lang->install->mkdir = '

需要创建目录%s。
linux下面命令为:
mkdir -p %s

'; $lang->install->chmod = '需要修改目录 "%s" 的权限。
linux下面命令为:
chmod o=rwx -R %s'; diff --git a/module/install/model.php b/module/install/model.php index 377412593a..29e415d3f9 100644 --- a/module/install/model.php +++ b/module/install/model.php @@ -125,6 +125,32 @@ class installModel extends model return $result = (is_dir($tmpRoot) and is_writable($tmpRoot)) ? 'ok' : 'fail'; } + /** + * Get session save path. + * + * @access public + * @return array + */ + public function getSessionSavePath() + { + $result['path'] = session_save_path(); + $result['exists'] = is_dir($result['path']); + $result['writable'] = is_writable($result['path']); + return $result; + } + + /** + * Check session save path. + * + * @access public + * @return string + */ + public function checkSessionSavePath() + { + $sessionSavePath = session_save_path(); + return $result = (is_dir($sessionSavePath) and is_writable($sessionSavePath)) ? 'ok' : 'fail'; + } + /** * Get data root * diff --git a/module/install/view/step1.html.php b/module/install/view/step1.html.php index df81b189a2..80cc0f6b97 100644 --- a/module/install/view/step1.html.php +++ b/module/install/view/step1.html.php @@ -13,10 +13,10 @@ - - - - + + + + @@ -74,6 +74,29 @@ ?> + + + + + +
install->checking;?>
install->checkItem;?>install->current?>install->result?>install->action?>install->checkItem;?>install->current?>install->result?>install->action?>
install->phpVersion;?>
install->session;?> + install->exists) : print($lang->install->notExists); + $sessionInfo['writable'] ? print($lang->install->writable) : print($lang->install->notWritable); + ?> + install->$sessionResult;?> + install->mkdir, $sessionInfo['path'], $sessionInfo['path']); + if(!$sessionInfo['writable']) printf($lang->install->chmod, $sessionInfo['path'], $sessionInfo['path']); + } + else + { + echo $lang->install->sessionFail; + } + ?> +