Example #1
0
function evo_check()
{
    /*
    $arr[0]['name'] = milu_lang('can_visit_url');
    $arr[0]['check'] = 1;
    if(!function_exists('ini_get')){
    	$arr[0]['msg'] = milu_lang('no_open_no_run');
    	$arr[0]['check'] = 0;
    	$arr[0]['tip'] = milu_lang('no_get_value');
    }else{
    	if(!ini_get('allow_url_fopen')){	
    		$arr[0]['check'] = 0;
    		$arr[0]['msg'] = milu_lang('pick_no_run');
    	}
    }
    */
    /*
    $arr[1]['name'] = milu_lang('open_crul');
    $arr[1]['check'] = 1;
    if(!function_exists('curl_init')){
    	$arr[1]['msg'] = milu_lang('open_crul_notice');
    	$arr[1]['check'] = 0;
    }
    */
    $arr[2]['name'] = milu_lang('open_tow_p');
    if (function_exists('fsockopen') || function_exists('pfsockopen')) {
        $arr[2]['check'] = 1;
    } else {
        $arr[2]['check'] = 0;
        $arr[2]['msg'] = milu_lang('no_tow_notice');
    }
    $arr[3]['name'] = 'file_get_contents()' . milu_lang('func');
    if (function_exists('file_get_contents')) {
        $arr[3]['check'] = 1;
    } else {
        $arr[3]['check'] = 0;
        if ($arr[2]['check'] == 0 && $arr[3]['check'] == 0) {
            $arr[1]['msg'] = '<ul id="tipslis"><li>' . milu_lang('no_use_pick') . '</li></ul>';
        }
    }
    $arr[4]['name'] = milu_lang('pick_dir_write');
    $arr[4]['check'] = 1;
    if (!dir_writeable(PICK_PATH . '/data/cache')) {
        $arr[4]['check'] = 0;
        $arr[4]['msg'] = '<li>' . milu_lang('dir_no_write', array('dir' => './source/plugin/milu_pick/data/cache')) . '</li>';
    }
    if (!dir_writeable(PICK_PATH . '/data/log')) {
        $arr[4]['check'] = 0;
        $arr[4]['msg'] .= '<li>' . milu_lang('dir_no_write', array('dir' => './source/plugin/milu_pick/data/log')) . '</li>';
    }
    if ($arr[4]['msg']) {
        $arr[4]['msg'] = '<ul id="tipslis">' . $arr[4]['msg'] . '</ul>';
    }
    /*
    $arr[6]['name'] =  '插件文件完整性';
    if($a == $b){
    	$arr[6]['check'] = 1;
    }else{
    	$arr[6]['check'] = 0;
    	$arr[6]['msg'] = '<ul id="tipslis"><li>插件上传过程中,文件丢失,请重新上传文件</li></ul>';
    }
    */
    $arr[7]['name'] = milu_lang('open_gzinflate');
    if (function_exists('gzinflate')) {
        $arr[7]['check'] = 1;
    } else {
        $arr[7]['check'] = 0;
        $arr[7]['msg'] = milu_lang('no_gzinflate_notice');
    }
    $arr[8]['name'] = milu_lang('open_zend');
    if (($zend_re = is_zend()) > 0) {
        $arr[8]['check'] = 1;
        $arr[8]['msg'] = milu_lang('zend_notice');
    } else {
        $arr[8]['check'] = 0;
        $arr[8]['msg'] = $zend_re == -1 ? milu_lang('http_visit', array('file' => 'source/plugin/milu_pick/zend/zendcheck.php')) : milu_lang('zend_enable');
    }
    return $arr;
}
Example #2
0
function pick_check()
{
    global $_G;
    if (!$_GET['checking']) {
        cpmsg(milu_lang('upgrade_checking'), PICK_GO . 'pick_info&ac=pick_check&checking=1', 'loading', '', false);
    }
    $zend_check = is_zend();
    if ($zend_check == -1) {
        cpmsg_error(lang('plugin/milu_pick', 'http_visit', array('file' => 'source/plugin/milu_pick/zend/zendcheck.php')));
    } else {
        if ($zend_check == -2) {
            cpmsg_error(lang('plugin/milu_pick', 'zend_enable'));
        }
    }
    $key_file = PICK_PATH . '/data/key.php';
    file_put_contents($key_file, $_G['timestamp']);
    if (!file_exists($key_file)) {
        cpmsg_error(milu_lang('dir_no_write', array('dir' => PICK_PATH . '/data')));
    }
    $get_site = GET_URL;
    $client_info = get_client_info();
    if (!$client_info || !$client_info['domain']) {
        cpmsg_error(milu_lang('lan_upgrage'));
    }
    $url = GET_URL . 'plugin.php?id=pick_user:upgrade&myac=upgrade_check&tpl=no&get_type=1&php_version=' . phpversion() . '&domain=' . urlencode($client_info['domain']) . '&dxc_version=' . $client_info['dxc_version'] . '&dxc_release=' . $client_info['dxc_release'] . '&siteurl=' . urlencode($client_info['siteurl']);
    $msg_arr = get_contents($url, array('cache' => -1));
    @unlink($key_file);
    if ($msg_arr < 0) {
        cpmsg_error(milu_lang('no_conn_up'));
    }
    $msg_arr = json_decode(base64_decode($msg_arr));
    $status = $msg_arr->status;
    if (!$status) {
        cpmsg_error(milu_lang('up_no_err'));
    }
    if ($status == -1) {
        cpmsg_error(milu_lang('up_no_free'));
    } else {
        if ($status == -2) {
            cpmsg_error(milu_lang('up_no_set_err'));
        } else {
            if ($status == -3) {
                cpmsg_error(milu_lang('up_newed'));
            } else {
                if ($status == -4 || !$msg_arr->key) {
                    cpmsg_error(milu_lang('no_normal_up'));
                } else {
                    $version_desc = base64_decode(dstripslashes($msg_arr->version_desc));
                    $msg_arr->version_filename = base64_decode(dstripslashes($msg_arr->version_filename));
                }
            }
        }
    }
    echo '<link href="' . PICK_URL . 'static/style.css?v=' . PICK_VERSION . '" rel="stylesheet" type="text/css" />';
    echo '<table class="tb tb2 ">
<tbody><tr class="header hover"><td>' . milu_lang('check_have_new') . '</td><td></td><td></td></tr>
<tr class="hover"><td>DXC ' . $msg_arr->version . milu_lang('version') . ' [Release ' . $msg_arr->version_dateline . ']</td><td><input type="button" class="btn" onclick="confirm(\'' . milu_lang('cofirm_up') . '\') ? window.location.href=\'?' . PICK_GO . 'pick_info&ac=pick_download&tpl=no&md5_total=' . $msg_arr->version_md5total . '&key=' . $msg_arr->key . '\' : \'\';" value="' . milu_lang('auto_up') . '"></td><td><a href="' . $msg_arr->version_filename . '" target="_blank">' . milu_lang('no_auto_up') . '</a></td></tr></tbody></table>';
    if ($version_desc) {
        $version_desc = $version_desc ? $version_desc : milu_lang('no_have');
        echo '<p class="partition">' . milu_lang('up_notice') . '</p><div id="show_upgrade_info" class="showmess"><p>' . str_iconv($version_desc) . '</p></div>';
    }
    exit;
}