Example #1
0
define('VIEW_OFF', $view_off ? TRUE : FALSE);
$allow_method = array('show_license', 'env_check', 'app_reg', 'db_init', 'ext_info', 'install_check', 'tablepre_check');
$step = intval(getgpc('step', 'R')) ? intval(getgpc('step', 'R')) : 0;
$method = getgpc('method');
if (empty($method) || !in_array($method, $allow_method)) {
    $method = isset($allow_method[$step]) ? $allow_method[$step] : '';
}
if (empty($method)) {
    show_msg('method_undefined', $method, 0);
}
if (file_exists($lockfile) && $method != 'ext_info') {
    show_msg('install_locked', '', 0);
} elseif (!class_exists('dbstuff')) {
    show_msg('database_nonexistence', '', 0);
}
timezone_set();
$uchidden = getgpc('uchidden');
if ($method == 'show_license') {
    transfer_ucinfo($_POST);
    show_license();
} elseif ($method == 'env_check') {
    VIEW_OFF && function_check($func_items);
    env_check($env_items);
    dirfile_check($dirfile_items);
    show_env_result($env_items, $dirfile_items, $func_items);
} elseif ($method == 'app_reg') {
    @(include ROOT_PATH . CONFIG);
    @(include ROOT_PATH . CONFIG_UC);
    if (!defined('UC_API')) {
        define('UC_API', '');
    }
Example #2
0
function init_defines()
{
    $Config =& loader::config();
    if (isset($Config['img_engine']) && in_array($Config['img_engine'], array('imagick', 'gd'))) {
        define('IMG_ENGINE', $Config['img_engine']);
    } else {
        define('IMG_ENGINE', 'gd');
    }
    if (isset($Config['storage_engine'])) {
        define('STORAGE_ENGINE', $Config['storage_engine']);
    } else {
        define('STORAGE_ENGINE', 'file');
    }
    $setting =& loader::model('setting');
    define('GRAVATAR_URL', $setting->get_conf('system.gravatar_url'));
    if (!defined('LANGSET')) {
        define('LANGSET', $setting->get_conf('system.language', 'zh_cn'));
    }
    if (!defined('TIMEZONE')) {
        define('TIMEZONE', $setting->get_conf('system.timezone', 8.0));
    }
    timezone_set(TIMEZONE);
}