本文整理匯總了PHP中Proxy::run方法的典型用法代碼示例。如果您正苦於以下問題:PHP Proxy::run方法的具體用法?PHP Proxy::run怎麽用?PHP Proxy::run使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Proxy
的用法示例。
在下文中一共展示了Proxy::run方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: while
}
}
} while ($code && --$mr);
curl_close($rch);
if (!$mr) {
if ($maxredirect === null) {
trigger_error('Too many redirects. When following redirects, libcurl hit the maximum amount.', E_USER_WARNING);
} else {
$maxredirect = 0;
}
return false;
}
curl_setopt($ch, CURLOPT_URL, $newurl);
}
}
return curl_exec($ch);
}
}
try {
// Use '' al default
if (isset($_GET['url'])) {
$url = $_GET['url'];
unset($_GET['url']);
} else {
$url = '';
}
$proxy = new Proxy();
echo $proxy->run($url, $_GET, $_POST);
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
}
示例2: run
}
}
}
static function run()
{
$self = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
$path_self = @$_SERVER['PATH_TRANSLATED'] ?: $_SERVER['SCRIPT_FILENAME'];
$a = strlen($self);
$b = strlen($path_self);
$i = 0;
while ($self[$a - $i - 1] == $path_self[$b - $i - 1] && $i < 1000) {
$i++;
}
if ($i == 0) {
return;
}
self::$base_url = substr($self, 0, strlen($self) - $i);
self::$base_path = substr($path_self, 0, strlen($path_self) - $i);
self::$tea = isset($_GET['tea']);
$urls = $_REQUEST['url'];
if (!is_array($urls)) {
$urls = array($urls);
}
foreach ($urls as $url) {
self::process($url);
}
echo json_encode(self::$cache);
}
}
Proxy::run();