本文整理汇总了PHP中proxyURL函数的典型用法代码示例。如果您正苦于以下问题:PHP proxyURL函数的具体用法?PHP proxyURL怎么用?PHP proxyURL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了proxyURL函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postParse
function postParse($input, $type)
{
switch ($type) {
case 'html':
# Create URL to JW Player
$player_url = GLYPE_URL . '/player.swf';
# Generate URL to flv file through proxy script
$flvUrl = rawurlencode(proxyURL(sprintf('%s', videourl)));
# Generate HTML for the flash object with our new FLV URL
$html = "<embed src=\"{$player_url}\" width=\"640\" height=\"360\" bgcolor=\"000000\" allowscriptaccess=\"always\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\" flashvars=\"width=640&height=360&type=video&fullscreen=true&volume=100&autostart=true&file={$flvUrl}\" />";
if (!defined('videourl')) {
$html = '<div style="color:#333;font-size:24px">This video cannot be displayed.</div>';
}
# Add our own player into the player div
$input = preg_replace('#<div id="player".*?<div id="watch7-main-container">#s', '<div id="player"><div id="player-api" class="player-width player-height off-screen-target" style="overflow: hidden;">' . $html . '</div></div><div id="watch7-main-container">', $input, 1);
$input = preg_replace('#http:\\\\/\\\\/s.ytimg.com\\\\/yt\\\\/swf\\\\/watch-vfl157150.swf\\\\#s', '' . $player_url . '\\', $input, 1);
$input = preg_replace('#http:\\\\/\\\\/s.ytimg.com\\\\/yt\\\\/swf\\\\/watch-vfl157150.swf\\\\#s', '' . $player_url . '\\', $input, 1);
$input = preg_replace('#http://s.ytimg.com/yt/swf/watch-vfl157150.swf#s', '' . $player_url . '', $input, 1);
$input = preg_replace('#http://s.ytimg.com/yt/swf/watch-vfl127661.swf#s', '' . $player_url . '', $input, 1);
$input = preg_replace('#http://s.ytimg.com/yt/swf/watch_as3-vfl128003.swf#s', '' . $player_url . '', $input, 1);
$input = preg_replace('#http://s.ytimg.com/yt/swf/watch_v8-vfl127661.swf#s', '' . $player_url . '', $input, 1);
$input = preg_replace('#http://s.ytimg.com/yt/swf/watch-vfl142129.swf#s', '' . $player_url . '', $input, 1);
$input = preg_replace('#http://s.ytimg.com/yt/swf/watch_v8-vfl142129.swf#s', '' . $player_url . '', $input, 1);
break;
}
return $input;
}
示例2: postParse
function postParse($input, $type)
{
switch ($type) {
case 'html':
if (!defined('video_url')) {
return $input;
}
# Create URL to JW Player
$player_url = GLYPE_URL . '/player.swf';
# Generate URL to flv file through proxy script
$flvUrl = rawurlencode(proxyURL(sprintf('%s', video_url)));
# Generate HTML for the flash object with our new FLV URL
$html = "<embed src=\"{$player_url}\" width=\"640\" height=\"360\" bgcolor=\"000000\" allowscriptaccess=\"always\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\" flashvars=\"width=640&height=360&type=video&fullscreen=true&volume=100&autostart=true&file={$flvUrl}\" />";
# Add our own player into the player div
$input = preg_replace('#<div id="watch-video-container">(.*?)</div>#s', '<div id="watch-video-container">', $input, 1);
$input = preg_replace('#<div id="watch-video-container">(.*?)</div>#s', '<div id="watch-video-container">', $input, 1);
$input = preg_replace('#<div id="watch-video-container">(.*?)</div>#s', '<div id="watch-video-container"><div id="watch-video" class=" "><script>if \\(window.yt.timing\\) \\{yt.timing.tick\\(\'bf\', \'\'\\)\\;\\}</script><div id="watch-player" class="flash-player">' . $html . '</div></div></div><div id="watch-main"></div>', $input, 1);
$input = preg_replace('#http:\\\\/\\\\/s.ytimg.com\\\\/yt\\\\/swf\\\\/watch-vfl157150.swf\\\\#s', '' . $player_url . '\\', $input, 1);
$input = preg_replace('#http:\\\\/\\\\/s.ytimg.com\\\\/yt\\\\/swf\\\\/watch-vfl157150.swf\\\\#s', '' . $player_url . '\\', $input, 1);
$input = preg_replace('#http://s.ytimg.com/yt/swf/watch-vfl157150.swf#s', '' . $player_url . '', $input, 1);
$input = preg_replace('#http://s.ytimg.com/yt/swf/watch-vfl127661.swf#s', '' . $player_url . '', $input, 1);
$input = preg_replace('#http://s.ytimg.com/yt/swf/watch_as3-vfl128003.swf#s', '' . $player_url . '', $input, 1);
$input = preg_replace('#http://s.ytimg.com/yt/swf/watch_v8-vfl127661.swf#s', '' . $player_url . '', $input, 1);
$input = preg_replace('#http://s.ytimg.com/yt/swf/watch-vfl142129.swf#s', '' . $player_url . '', $input, 1);
$input = preg_replace('#http://s.ytimg.com/yt/swf/watch_v8-vfl142129.swf#s', '' . $player_url . '', $input, 1);
break;
}
return $input;
}
示例3: preParse
function preParse($html, $type)
{
if (stripos($html, 'loadingError')) {
header("Location: " . proxyURL('http://mail.google.com/mail/?ui=html'));
exit;
}
return $html;
}
示例4: postParse
function postParse($input, $type)
{
switch ($type) {
case 'html':
if (defined('videourl')) {
# Create URL to JW Player
$player_url = GLYPE_URL . '/player.swf';
# Generate URL to flv file through proxy script
$flvUrl = rawurlencode(proxyURL(sprintf('%s', videourl)));
# Generate HTML for the flash object with our new FLV URL
$html = "<embed src=\"{$player_url}\" width=\"1280\" height=\"720\" bgcolor=\"000000\" allowscriptaccess=\"always\" allowfullscreen=\"true\" type=\"application/x-shockwave-flash\" flashvars=\"width=1280&height=720&type=video&fullscreen=true&volume=100&autostart=true&file={$flvUrl}\" />";
# Replace video player
$input = preg_replace('#<div id="player-api"([^>]*)>.*<div class="clear"#s', '<div id="player-api"$1>' . $html . '</div></div><div class="clear"', $input, 1);
}
break;
}
return $input;
}
示例5: Request
/*****************************************************************
* Execute the request
******************************************************************/
# Initiate cURL wrapper request object with our cURL options
$fetch = new Request($toSet);
# And make the request
$document = $fetch->go($URL);
/*****************************************************************
* Handle aborted transfers
******************************************************************/
if ($fetch->abort) {
switch ($fetch->abort) {
# Do a redirection
case 'redirect':
# Proxy the location
$location = proxyURL($fetch->headers['location'], $flag);
# Do not redirect in debug mode
if (DEBUG_MODE) {
$fetch->redirected = '<a href="' . $location . '">' . $fetch->headers['location'] . '</a>';
break;
}
# Go there
header('Location: ' . $location, true, $fetch->status);
exit;
# Send back a 304 Not modified and stop running the script
# Send back a 304 Not modified and stop running the script
case 'not_modified':
header("HTTP/1.1 304 Not Modified", true, 304);
exit;
# 401 Authentication (HTTP authentication hooks not available in all PHP versions
# so we have to use our method)
示例6: pow
}
# Current bit
$bit = pow(2, $i);
# Set bitfield
if (!empty($_POST[$name])) {
setBit($bitfield, $bit);
}
# Increase index
++$i;
}
# Save new bitfield in session
$_SESSION['bitfield'] = $bitfield;
# Save valid entry
$_SESSION['no_hotlink'] = true;
# Redirect to target
redirect(proxyURL($url, 'norefer'));
break;
/*************************************************************
* Agree to our SSL warning.
**************************************************************/
/*************************************************************
* Agree to our SSL warning.
**************************************************************/
case 'sslagree':
# Flag our SSL warnedness
$_SESSION['ssl_warned'] = true;
# Return to previous page
$redirectTo = isset($_SESSION['return']) ? $_SESSION['return'] : 'index.php';
# Clear session return value
unset($_SESSION['return']);
# Redirect
示例7: css_src
function css_src($input)
{
return 'src=' . $input[1] . proxyURL($input[2]) . $input[1];
}
示例8: proxifyURL
function proxifyURL($url, $givenFlag = false)
{
return proxyURL($url, $givenFlag);
}
示例9: define
<?
/*******************************************************************
* Glype is copyright and trademark 2007-2016 UpsideOut, Inc. d/b/a Glype
* and/or its licensors, successors and assigners. All rights reserved.
*
* Use of Glype is subject to the terms of the Software License Agreement.
* http://www.glype.com/license.php
******************************************************************/
define('mobilemail',proxyURL('http://m.yahoo.com/mail'));
if(stripos($toLoad,'mail.yahoo.com')){header('Location: '.mobilemail);exit;}
function preParse($html,$type){
if($type=='html') {
$html = preg_replace('#r/(m6|lk|l6|m7|m2|l4)#', mobilemail, $html);
}
return $html;
}