. * * @copyright Copyright: 2009 Chunsheng Wang * @author Chunsheng Wang * @package install * @version $Id$ * @link http://www.zentao.cn */ ?> = 0 ? 'ok' : 'fail'; } /* 检查PDO扩展是否载入。*/ public function checkPDO() { return $result = extension_loaded('pdo') ? 'ok' : 'fail'; } /* 检查PDO_MySQL扩展是否载入。*/ public function checkPDOMySQL() { return $result = extension_loaded('pdo_mysql') ? 'ok' : 'fail'; } /* 获得tmpRoot目录的信息。*/ public function getTmpRoot() { $result['path'] = $this->app->getTmpRoot(); $result['exists'] = is_dir($result['path']); $result['writable']= is_writable($result['path']); return $result; } /* 检查tmpRoot目录权限。*/ public function checkTmpRoot() { $tmpRoot = $this->app->getTmpRoot(); return $result = (is_dir($tmpRoot) and is_writable($tmpRoot)) ? 'ok' : 'fail'; } /* 获得DataRoot目录的信息。*/ public function getDataRoot() { $result['path'] = $this->app->getAppRoot() . 'www' . $this->app->getPathFix() . 'data'; $result['exists'] = is_dir($result['path']); $result['writable']= is_writable($result['path']); return $result; } /* 检查dataRoot目录权限。*/ public function checkDataRoot() { $dataRoot = $this->app->getAppRoot() . 'www' . $this->app->getPathFix() . 'data'; return $result = (is_dir($dataRoot) and is_writable($dataRoot)) ? 'ok' : 'fail'; } /* 获得INI文件的信息。*/ public function getIniInfo() { $iniInfo = ''; ob_start(); phpinfo(1); $lines = explode("\n", strip_tags(ob_get_contents())); ob_end_clean(); foreach($lines as $line) if(strpos($line, 'ini') !== false) $iniInfo .= $line . "\n"; return $iniInfo; } /* 获得webRoot的地址。*/ public function getWebRoot() { return rtrim(pathinfo($_SERVER['SCRIPT_NAME'], PATHINFO_DIRNAME), '/') . '/'; } }