同步操作将从 vb2005xu/phpcli 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<?phpdefine('IN_CLI', PHP_SAPI === 'cli');if ( IN_CLI ){set_time_limit(0);for ($i = 1; $i < $_SERVER['argc']; $i++){$arg = explode('=', $_SERVER['argv'][$i]);if (count($arg) > 1 || strncmp($arg[0], '-', 1) === 0){$_GET[ltrim($arg[0], '-')] = isset($arg[1]) ? $arg[1] : true;}$_REQUEST = array_merge($_REQUEST,$_GET);}require_once dirname(__FILE__) . '/unirest.class.php';if ( empty($_REQUEST['url']) ){return CliConsole::output('error', '无效参数 url');}$url = trim($_REQUEST['url']);$method = empty($_REQUEST['method']) ? 'get' : trim($_REQUEST['method']);unset($_REQUEST['url']);unset($_REQUEST['method']);$response = http_request($method, $url, $_REQUEST);$response_body = $response->body;if ( is_array($response_body) && !empty($response_body)){$response_body = $response->body;}else{$response_body = $response->raw_body;}return CliConsole::output('response', $response_body);}else{// header("Content-Type: text/html;charset=utf-8");header("Status: 404 Not Found");exit;}class CliConsole{static function output($note, $msg){$msg = print_r($msg,true);if ( is_windows() ){$msg = iconv("UTF-8", "GBK", $msg);}fwrite(STDOUT, "[$note]: " . $msg . PHP_EOL);}}/*** if operating system === windows*/function is_windows(){return 'win' === strtolower(substr(php_uname("s"), 0, 3));}function http_request($method, $url, $params=array()){Unirest::verifyPeer(false);Unirest::timeout(86400 * 360);// 修正缺省超时时间$method = trim(strtolower($method));switch ($method) {case 'post':$url .= '?' . time();$response = Unirest::post($url, array(), $params);break;default:$params['t'] = time();$response = Unirest::get($url, array(), $params);break;}return $response;}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。