fix bug#272.

This commit is contained in:
wangchunsheng
2011-11-21 05:17:32 +00:00
parent 4063eaf614
commit df0d768bf5
6 changed files with 24 additions and 0 deletions
+2
View File
@@ -568,6 +568,8 @@ EOT;
*/
static public function exportConfigVars()
{
if(!function_exists('json_encode')) return false;
global $app, $config, $lang;
$defaultViewType = $app->getViewType();
$themeRoot = $app->getWebRoot() . 'theme/';
+1
View File
@@ -54,6 +54,7 @@ class install extends control
$this->view->phpResult = $this->install->checkPHP();
$this->view->pdoResult = $this->install->checkPDO();
$this->view->pdoMySQLResult = $this->install->checkPDOMySQL();
$this->view->jsonResult = $this->install->checkJSON();
$this->view->tmpRootInfo = $this->install->getTmpRoot();
$this->view->tmpRootResult = $this->install->checkTmpRoot();
$this->view->dataRootInfo = $this->install->getDataRoot();
+2
View File
@@ -58,6 +58,8 @@ $lang->install->pdo = 'PDO extension';
$lang->install->pdoFail = 'Edit the php.ini file to load PDO extsion.';
$lang->install->pdoMySQL = 'PDO_MySQL extension';
$lang->install->pdoMySQLFail = 'Edit the php.ini file to load PDO_MySQL extsion.';
$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->mkdir = '<p>Should creat the directory %s。<br /> Under linux, can try<br /> mkdir -p %s</p>';
+2
View File
@@ -58,6 +58,8 @@ $lang->install->pdo = 'PDO扩展';
$lang->install->pdoFail = '修改PHP配置文件,加载PDO扩展。';
$lang->install->pdoMySQL = 'PDO_MySQL扩展';
$lang->install->pdoMySQLFail = '修改PHP配置文件,加载pdo_mysql扩展。';
$lang->install->json = 'JSON扩展';
$lang->install->jsonFail = '修改PHP配置文件,加载JSON扩展。';
$lang->install->tmpRoot = '临时文件目录';
$lang->install->dataRoot = '上传文件目录';
$lang->install->mkdir = '<p>需要创建目录%s。<br /> linux下面命令为:<br /> mkdir -p %s</p>';
+11
View File
@@ -88,6 +88,17 @@ class installModel extends model
return $result = extension_loaded('pdo_mysql') ? 'ok' : 'fail';
}
/**
* Check json extension.
*
* @access public
* @return string ok|fail
*/
public function checkJSON()
{
return $result = extension_loaded('json') ? 'ok' : 'fail';
}
/**
* Get tempRoot info.
*
+6
View File
@@ -36,6 +36,12 @@
<td class='<?php echo $pdoMySQLResult;?>'><?php echo $lang->install->$pdoMySQLResult;?></td>
<td class='a-left f-12px'><?php if($pdoMySQLResult == 'fail') echo $lang->install->pdoMySQLFail;?></td>
</tr>
<tr>
<th><?php echo $lang->install->json;?></th>
<td><?php $jsonResult == 'ok' ? printf($lang->install->loaded) : printf($lang->install->unloaded);?></td>
<td class='<?php echo $jsonResult;?>'><?php echo $lang->install->$jsonResult;?></td>
<td class='a-left f-12px'><?php if($jsonResult == 'fail') echo $lang->install->jsonFail;?></td>
</tr>
<tr>
<th><?php echo $lang->install->tmpRoot;?></th>
<td>