当前位置: 首页>>代码示例>>PHP>>正文


PHP squidbee::VerifStreamProxyBindIP方法代码示例

本文整理汇总了PHP中squidbee::VerifStreamProxyBindIP方法的典型用法代码示例。如果您正苦于以下问题:PHP squidbee::VerifStreamProxyBindIP方法的具体用法?PHP squidbee::VerifStreamProxyBindIP怎么用?PHP squidbee::VerifStreamProxyBindIP使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在squidbee的用法示例。


在下文中一共展示了squidbee::VerifStreamProxyBindIP方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: CHECK_STREAMCACHE

function CHECK_STREAMCACHE()
{
    $unix = new unix();
    $sock = new sockets();
    $squid = new squidbee();
    $masterbin = $unix->find_program("streamsquidcache");
    if (!is_file($masterbin)) {
        return;
    }
    $enabled = intval($sock->GET_INFO("EnableStreamCache"));
    if ($enabled == 0) {
        return;
    }
    $php = $unix->LOCATE_PHP5_BIN();
    if (!is_file("/usr/share/videocache/videocache.py")) {
        squid_admin_mysql(0, "VideoCache backend ( missing videocache.py) not installed, re-install it...", null, __FILE__, __LINE__);
        shell_exec("{$php} /usr/share/artica-postfix/exec.squidstream.php --reinstall");
        return;
    }
    if (!is_file("/usr/share/videocache/vc-scheduler")) {
        squid_admin_mysql(0, "VideoCache backend ( missing vc-scheduler) not installed, re-install it...", null, __FILE__, __LINE__);
        shell_exec("{$php} /usr/share/artica-postfix/exec.squidstream.php --reinstall");
        return;
    }
    $VerifStreamProxyBindIP = $squid->VerifStreamProxyBindIP();
    $pid = streamsquidcache_pid();
    if ($GLOBALS["VERBOSE"]) {
        echo "streamsquidcache: PID: {$pid}\n";
    }
    if ($unix->process_exists($pid)) {
        if ($GLOBALS["VERBOSE"]) {
            echo "streamsquidcache: Running -> YES\n";
        }
    } else {
        if ($GLOBALS["VERBOSE"]) {
            echo "streamsquidcache: Running -> NO\n";
        }
        squid_admin_mysql(0, "VideoCache backend not running, start it...", null, __FILE__, __LINE__);
        shell_exec("/etc/init.d/squid-stream start");
        return;
    }
    $StreamCachePort = intval($sock->GET_INFO("StreamCachePort"));
    if ($StreamCachePort == 0) {
        $StreamCachePort = 5559;
    }
    if ($GLOBALS["VERBOSE"]) {
        echo "streamsquidcache: {$VerifStreamProxyBindIP}:{$StreamCachePort}\n";
    }
    if (!@fsockopen($VerifStreamProxyBindIP, $StreamCachePort, $errno, $errstr, 1)) {
        squid_admin_mysql(0, "VideoCache backend unable to open port {$VerifStreamProxyBindIP}:{$StreamCachePort} (action = restart)", "Err.{$errno} {$errstr}\n", __FILE__, __LINE__);
        shell_exec("/etc/init.d/squid-stream restart");
        return;
    }
    if ($GLOBALS["VERBOSE"]) {
        echo "streamsquidcache: {$VerifStreamProxyBindIP}:{$StreamCachePort} OK\n";
    }
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:57,代码来源:exec.squid.watchdog.php

示例2: build

function build()
{
    $sock = new sockets();
    $emailprefix = null;
    $unix = new unix();
    $ini = new Bs_IniHandler();
    $IPADDRSSL = array();
    $IPADDRSSL2 = array();
    $users = new usersMenus();
    $uuid = $unix->GetUniqueID();
    if ($uuid == null) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} no UUID !!, return\n";
        }
        return;
    }
    $ArticaSquidParameters = $sock->GET_INFO('ArticaSquidParameters');
    $visible_hostname = $ini->_params["NETWORK"]["visible_hostname"];
    if ($visible_hostname == null) {
        $visible_hostname = $unix->hostname_g();
    }
    $SquidBinIpaddr = $sock->GET_INFO("SquidBinIpaddr");
    $AllowAllNetworksInSquid = $sock->GET_INFO("AllowAllNetworksInSquid");
    if (!is_numeric($AllowAllNetworksInSquid)) {
        $AllowAllNetworksInSquid = 1;
    }
    $ini->loadString($ArticaSquidParameters);
    NETWORK_ALL_INTERFACES();
    $LISTEN_PORT = intval($ini->_params["NETWORK"]["LISTEN_PORT"]);
    $ICP_PORT = intval(trim($ini->_params["NETWORK"]["ICP_PORT"]));
    $certificate_center = $ini->_params["NETWORK"]["certificate_center"];
    $SSL_BUMP = intval($ini->_params["NETWORK"]["SSL_BUMP"]);
    $ssl = false;
    if ($ICP_PORT == 0) {
        $ICP_PORT = 3130;
    }
    if ($LISTEN_PORT == 0) {
        $LISTEN_PORT = 3128;
    }
    $squid = new squidbee();
    $q = new mysql_squid_builder();
    $LogsWarninStop = intval($sock->GET_INFO("LogsWarninStop"));
    $chown = $unix->find_program("chown");
    $python = $unix->find_program("python");
    $StreamCachePort = intval($sock->GET_INFO("StreamCachePort"));
    $StreamCacheSize = intval($sock->GET_INFO("StreamCacheSize"));
    $StreamCacheSSLPort = intval($sock->GET_INFO("StreamCacheSSLPort"));
    $StreamCacheICPPort = intval($sock->GET_INFO("StreamCacheICPPort"));
    $StreamCacheLocalPort = intval($sock->GET_INFO("StreamCacheLocalPort"));
    $StreamCacheUrlRewiteNumber = intval($sock->GET_INFO("StreamCacheUrlRewiteNumber"));
    if ($StreamCacheSize == 0) {
        $StreamCacheSize = 1500;
    }
    if ($StreamCachePort == 0) {
        $StreamCachePort = 5559;
    }
    if ($StreamCacheLocalPort == 0) {
        $StreamCacheLocalPort = 5563;
    }
    if ($StreamCacheSSLPort == 0) {
        $StreamCacheSSLPort = 5560;
    }
    if ($StreamCacheICPPort == 0) {
        $StreamCacheICPPort = 5562;
    }
    if ($StreamCacheUrlRewiteNumber == 0) {
        $StreamCacheUrlRewiteNumber = 15;
    }
    $StreamCacheBindProxy = $squid->VerifStreamProxyBindIP();
    $StreamCacheOutProxy = $sock->GET_INFO("StreamCacheOutProxy");
    if (!isset($GLOBALS["NETWORK_ALL_INTERFACES"][$StreamCacheOutProxy])) {
        $StreamCacheOutProxy = null;
    }
    $f[] = "";
    $f[] = "# ************** REDIRECTOR ********************";
    $f[] = "url_rewrite_program {$python} /usr/share/videocache/videocache.py";
    $f[] = "url_rewrite_children {$StreamCacheUrlRewiteNumber}";
    $f[] = "url_rewrite_concurrency {$StreamCacheUrlRewiteNumber}";
    $f[] = "";
    $f[] = "# ***********************************************";
    $f[] = "";
    $f[] = "acl vc_deny_myport myport {$StreamCacheLocalPort}";
    $f[] = "";
    $f[] = "acl vc_deny_url url_regex -i \\.blip\\.tv\\/(.*)filename \\.hardsextube\\.com\\/videothumbs \\.xtube\\.com\\/(.*)(Thumb|videowall) www\\.youtube\\.com\\/";
    $f[] = "acl vc_deny_url url_regex -i \\.(youtube|googlevideo)\\.com\\/.*\\/manifest";
    $f[] = "acl vc_deny_url url_regex -i \\.(youtube|googlevideo)\\.com\\/videoplayback?.*playerretry=[0-9]";
    $f[] = "acl vc_deny_dom dstdomain .manifest.youtube.com .manifest.googlevideo.com";
    $f[] = "acl vc_deny_dom dstdomain .redirector.googlevideo.com .redirector.youtube.com";
    $f[] = "";
    $f[] = "acl vc_url url_regex -i \\/youku\\/[0-9A-Z]+\\/[0-9A-Z\\-]+\\.(flv|mp4|avi|mkv|mp3|rm|rmvb|m4v|mov|wmv|3gp|mpg|mpeg)";
    $f[] = "acl vc_url url_regex -i \\/(.*)key=[a-z0-9]+(.*)\\.flv";
    $f[] = "acl vc_url url_regex -i \\-xh\\.clients\\.cdn[0-9a-zA-Z]?[0-9a-zA-Z]?[0-9a-zA-Z]?\\.com\\/data\\/(.*)\\.flv";
    $f[] = "acl vc_url url_regex -i \\.(youtube|youtube-nocookie|googlevideo)\\.com\\/feeds\\/api\\/videos\\/[0-9a-zA-Z_-]{11}\\/";
    $f[] = "acl vc_url url_regex -i \\.(youtube|youtube-nocookie|googlevideo)\\.com\\/(videoplayback|get_video|watch_popup|user_watch|stream_204|get_ad_tags|get_video_info|player_204|ptracking|set_awesome)\\?";
    $f[] = "acl vc_url url_regex -i \\.(youtube|youtube-nocookie|googlevideo)\\.com\\/(v|e|embed)\\/[0-9a-zA-Z_-]{11}";
    $f[] = "acl vc_url url_regex -i \\.youtube\\.com\\/s\\? \\.youtube\\.com\\/api\\/stats\\/(atr|delayplay|playback|watchtime)\\?";
    $f[] = "acl vc_url url_regex -i \\.(youtube|youtube-nocookie|googlevideo)\\.com\\/videoplayback\\/id\\/[0-9a-zA-Z_-]+\\/";
    $f[] = "acl vc_url url_regex -i \\.android\\.clients\\.google\\.com\\/market\\/GetBinary\\/";
    $f[] = "acl vc_url url_regex -i cs(.*)\\.vk\\.me\\/(.*)/([a-zA-Z0-9.]+)\\.(flv|mp4|avi|mkv|mp3|rm|rmvb|m4v|mov|wmv|3gp|mpg|mpeg)";
    $f[] = "acl vc_url url_regex -i video(.*)\\.rutube\\.ru\\/(.*)/([a-zA-Z0-9.]+)\\.(flv|mp4|avi|mkv|mp3|rm|rmvb|m4v|mov|wmv|3gp|mpg|mpeg)Seg[0-9]+-Frag[0-9]+";
//.........这里部分代码省略.........
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:101,代码来源:exec.squidstream.php


注:本文中的squidbee::VerifStreamProxyBindIP方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。