Пример #1
0
/**
 * 环境检查
 * @param array $lang 语言变量
 * @param array $envItems 要检测的环境
 * @param array $funcItems 要检测的函数
 * @param array $filesockItems 要检测的函数
 * @param array $dirfileItems 要检测的文件、文件夹权限
 * @param array $extLoadedItems 要检测的扩展
 */
function envCheckAll($lang, $envItems, $funcItems, $filesockItems, $dirfileItems, $extLoadedItems)
{
    $envCheck = envCheck($envItems);
    $funcCheck = funcCheck($funcItems);
    $filesorkCheck = filesorkCheck($filesockItems);
    $dirfileCheck = dirfileCheck($dirfileItems);
    $extLoadedCheck = extLoadedCheck($extLoadedItems);
    if (!$envCheck['envCheckRes'] || !$funcCheck['funcCheckRes'] || !$filesorkCheck['filesorkCheckRes'] || !$dirfileCheck['dirfileCheckRes'] || !$extLoadedCheck['extLoadedCheckRes']) {
        include 'envCheck.php';
        exit;
    } else {
        //通过环境检查,继续执行
    }
}
Пример #2
0
    $yii = PATH_ROOT . '/library/yii.php';
    $ibosConfig = (require PATH_ROOT . '/system/config/config.php');
    require_once $yii;
    $config = array('basePath' => PATH_ROOT . 'system', 'components' => array('db' => array('connectionString' => "mysql:host={$ibosConfig['db']['host']};port={$ibosConfig['db']['port']};dbname={$ibosConfig['db']['dbname']}", 'emulatePrepare' => true, 'username' => $ibosConfig['db']['username'], 'password' => $ibosConfig['db']['password'], 'charset' => $ibosConfig['db']['charset'], 'tablePrefix' => $ibosConfig['db']['tableprefix'])));
    Yii::createWebApplication($config);
}
// 是否已安装过
if (file_exists($lockfile) && $option != 'extData') {
    $errorMsg = $lang['Install locked'] . str_replace(PATH_ROOT, '', $lockfile);
    include 'errorInfo.php';
    exit;
}
if ($option == 'envCheck') {
    // 检测环境
    $envCheck = envCheck($envItems);
    $funcCheck = funcCheck($funcItems);
    $filesorkCheck = filesorkCheck($filesockItems);
    $dirfileCheck = dirfileCheck($dirfileItems);
    $extLoadedCheck = extLoadedCheck($extLoadedItems);
    if (!$envCheck['envCheckRes'] || !$funcCheck['funcCheckRes'] || !$filesorkCheck['filesorkCheckRes'] || !$dirfileCheck['dirfileCheckRes'] || !$extLoadedCheck['extLoadedCheckRes']) {
        include 'envCheck.php';
    } else {
        header("Location: index.php?op=dbInit");
    }
} elseif ($option == 'dbInit') {
    // 创建数据库数据
    if (isset($_SESSION['extData'])) {
        unset($_SESSION['extData']);
    }
    $configFile = CONFIG_PATH . 'config.php';
    $defaultConfigfile = CONFIG_PATH . 'configDefault.php';