+ add session.save_path check.
* adjust align of checking title.
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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 = '<p>Should creat the directory %s。<br /> Under linux, can try<br /> mkdir -p %s</p>';
|
||||
$lang->install->chmod = 'Should change the permission of "%s".<br />Under linux, can try<br />chmod o=rwx -R %s';
|
||||
|
||||
|
||||
@@ -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 = '<p>需要创建目录%s。<br /> linux下面命令为:<br /> mkdir -p %s</p>';
|
||||
$lang->install->chmod = '需要修改目录 "%s" 的权限。<br />linux下面命令为:<br />chmod o=rwx -R %s';
|
||||
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
<table align='center' class='table-6 a-center'>
|
||||
<caption><?php echo $lang->install->checking;?></caption>
|
||||
<tr>
|
||||
<th class='w-p20'><?php echo $lang->install->checkItem;?></th>
|
||||
<th class='w-p25'><?php echo $lang->install->current?></th>
|
||||
<th class='w-p15'><?php echo $lang->install->result?></th>
|
||||
<th><?php echo $lang->install->action?></th>
|
||||
<th class='w-p20 a-center'><?php echo $lang->install->checkItem;?></th>
|
||||
<th class='w-p25 a-center'><?php echo $lang->install->current?></th>
|
||||
<th class='w-p15 a-center'><?php echo $lang->install->result?></th>
|
||||
<th class="a-center"><?php echo $lang->install->action?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->install->phpVersion;?></th>
|
||||
@@ -74,6 +74,29 @@
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->install->session;?></th>
|
||||
<td>
|
||||
<?php
|
||||
$sessionInfo['exists'] ? print($lang->install->exists) : print($lang->install->notExists);
|
||||
$sessionInfo['writable'] ? print($lang->install->writable) : print($lang->install->notWritable);
|
||||
?>
|
||||
</td>
|
||||
<td class='<?php echo $sessionResult;?>'><?php echo $lang->install->$sessionResult;?></td>
|
||||
<td class='a-left f-12px'>
|
||||
<?php
|
||||
if($sessionInfo['path'])
|
||||
{
|
||||
if(!$sessionInfo['exists']) printf($lang->install->mkdir, $sessionInfo['path'], $sessionInfo['path']);
|
||||
if(!$sessionInfo['writable']) printf($lang->install->chmod, $sessionInfo['path'], $sessionInfo['path']);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $lang->install->sessionFail;
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='4'>
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user