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


PHP sockets::getframework方法代码示例

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


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

示例1: page

function page()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    if (!isset($_GET["uuid"])) {
        $_GET["uuid"] = $sock->getframework("cmd.php?system-unique-id=yes");
    }
    if (!is_file("/usr/share/artica-postfix/ressources/interface-cache/CPU_NUMBER")) {
        $sock = new sockets();
        $cpunum = intval($sock->getFrameWork("services.php?CPU-NUMBER=yes"));
    } else {
        $cpunum = intval(@file_get_contents("/usr/share/artica-postfix/ressources/interface-cache/CPU_NUMBER"));
    }
    $CPU_NUMBER = $cpunum;
    $DisableAnyCache = $sock->GET_INFO("DisableAnyCache");
    if (!is_numeric($DisableAnyCache)) {
        $DisableAnyCache = 0;
    }
    $SquidCacheLevel = $sock->GET_INFO("SquidCacheLevel");
    if (!is_numeric($SquidCacheLevel)) {
        $SquidCacheLevel = 4;
    }
    if ($SquidCacheLevel == 0) {
        $DisableAnyCache = 1;
    }
    if ($DisableAnyCache == 1) {
        $html = FATAL_ERROR_SHOW_128("{all_cache_method_are_globally_disabled}");
        $html = $html . "<div style='width:100%'>\n\t\t\t\t<div style='margin-top:10px;width:99%' class=form>\n\t\t\t\t\t<a href=\"javascript:blur();\" OnClick=\"Loadjs('squid.caches.disable.php')\"\n\t\t\t\t\tstyle='font-size:16px;text-decoration:underline;font-weight:bold'\n\t\t\t\t\t>{access_to_parameters}</a>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t";
        echo $tpl->_ENGINE_parse_body($html);
        return;
    }
    $maintoolbar = "\n\t<center id='main-smp-toolbar'>\n\t<table style='width:85%' class=form>\n\t\t<tr>\n\t\t\t<td align='center'>" . imgtootltip("apply-config-44.png", "{apply}", "Loadjs('{$page}?apply-js=yes')", null, time()) . "</td>\n\t\t\t<td align='center'>" . imgtootltip("events-64.png", "{events}", "Loadjs('{$page}?events-js=yes&uuid={$_GET["uuid"]}')", null, time() + 3) . "</td>\t\t\t\t\t\t\t\n\t\t\t<td align='center'>" . imgtootltip("48-refresh.png", "{refresh}", "RefreshTab('squid_main_caches_new')", null, time() + 2) . "</td>\n\t\t\t<td align='center'>" . imgtootltip("48-cancel.png", "{back_to_single_proc}", "Loadjs('{$page}?back-js=yes&uuid={$_GET["uuid"]}')", null, time() + 2) . "</td>\n\t\t</tr>\n\t</table>\n\t</center>";
    $t = time();
    $tpl = new templates();
    $sql = "SELECT * FROM cachestatus WHERE uuid='{$_GET["uuid"]}'";
    $q = new mysql_squid_builder();
    $results = $q->QUERY_SQL($sql);
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $array[trim($ligne["cachedir"])]["CURSIZE"] = FormatBytes($ligne["currentsize"]);
        $array[trim($ligne["cachedir"])]["MAXSIZE"] = trim($ligne["maxsize"]);
        $array[trim($ligne["cachedir"])]["POURC"] = trim($ligne["pourc"]);
    }
    $arraySerialize = urlencode(base64_decode(serialize($array)));
    for ($i = 1; $i < $CPU_NUMBER + 1; $i++) {
        $tr[] = "<div id='section-smp-{$i}'></div>";
        $js[] = "\n\t\t\tfunction SectionSMP{$t}{$i}(){\t\n\t\t\t\tLoadAjax('section-smp-{$i}','{$page}?section-smp&procnum={$i}&uuid={$_GET["uuid"]}&arraySerialize={$arraySerialize}');\n\t\t\n\t\t}";
        $jswait[] = "setTimeout(\"SectionSMP{$t}{$i}()\",1{$i}00);";
    }
    $html = "<center>{$maintoolbar}<div style='width:700px'>" . CompileTr2($tr) . "</div></center>\n\t<script>\n" . @implode("\n", $js) . "\n" . @implode("\n", $jswait) . "</script>\n\t\t\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
    $sock = new sockets();
    $sock->getFrameWork("squid.php?refresh-caches-infos=yes");
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:54,代码来源:squid.caches.smp.php

示例2: status_squid_left

function status_squid_left($asroot=false){
	
	if(GET_CACHED(__FILE__, __FUNCTION__,__FUNCTION__)){return;}
	$page=CurrentPageName();
	$tpl=new templates();
	$users=new usersMenus();

	include_once(dirname(__FILE__)."/ressources/class.status.inc");
	$sock=new sockets();
	$SquidBinIpaddr=$sock->GET_INFO("SquidBinIpaddr");
	if($SquidBinIpaddr==null){$SquidBinIpaddr="0.0.0.0";}
	$urgency_mode_img="20-check-grey.png";
	if($SquidBinIpaddr=="0.0.0.0"){$SquidBinIpaddr="{all}";}
	$CacheManagement2=$sock->GET_INFO("CacheManagement2");
	if(!is_numeric($CacheManagement2)){$CacheManagement2=0;}
	$squid=new squidbee();
	$q=new mysql();
	$master_version=$squid->SQUID_VERSION;
	$text_kavicap_error=null;
	$text_script=null;
	$cache_mem=$squid->global_conf_array["cache_mem"];	
	$users=new usersMenus();
	
	$As32=false;
	if(!isset($_GET["uuid"])){$_GET["uuid"]=$sock->getframework("cmd.php?system-unique-id=yes");}
	

	$EnableKavICAPRemote=$sock->GET_INFO("EnableKavICAPRemote");
	$KavICAPRemoteAddr=$sock->GET_INFO("KavICAPRemoteAddr");
	$KavICAPRemotePort=$sock->GET_INFO("KavICAPRemotePort");	
	if(!is_numeric($EnableKavICAPRemote)){$EnableKavICAPRemote=0;}
	$CPU_NUMBER=$sock->getFrameWork("services.php?CPU-NUMBER=yes");
	
	if($EnableKavICAPRemote==1){
		$fp=@fsockopen($KavICAPRemoteAddr, $KavICAPRemotePort, $errno, $errstr, 1);
			if(!$fp){
				$text_kavicap_error="<div>{kavicap_unavailable_text}<br><strong>
				<a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('squid.kavicap.php');\" style='font-size:12px;color:#D70707;text-decoration:underline'>$KavICAPRemoteAddr:$KavICAPRemotePort</a><br>$errstr</div>";				
			}
		
		@fclose($fp);			
	}
	
	$q=new mysql_squid_builder();
	
	$text_error_sql="<div id='db-status-infos'></div>
	<script>LoadAjax('db-status-infos','$page?db-status-infos=yes',true);</script>
	";
	
	
	
	$q=new mysql_squid_builder();
	$requests=$q->EVENTS_SUM();
	$requests=numberFormat($requests,0,""," ");
	
	
	$tableblock=date('Ymd')."_blocked";
	$ligneW=$q->COUNT_ROWS($tableblock);
	$blocked_today=numberFormat($ligneW,0,""," ")." {blocked_websites} {this_day}";
	
	$q=new mysql_squid_builder();
	$websitesnums=$q->COUNT_ROWS("dansguardian_sitesinfos","artica_backup");
	$websitesnums=numberFormat($websitesnums,0,""," ");	
	
	$q=new mysql_squid_builder();
	$categories=$q->COUNT_ROWS("dansguardian_community_categories");
	$categories=numberFormat($categories,0,""," ");		
	
	$sock=new sockets();
	$sock->SET_INFO("squidStatsCategoriesNum",$categories);
	$sock->SET_INFO("squidStatsWebSitesNum",$websitesnums);
	$sock->SET_INFO("squidStatsBlockedToday",$blocked_today);
	$sock->SET_INFO("squidStatsRequestNumber",$requests);
	$styleText="font-size:12px;font-weight:bold";
	$migration_pid=unserialize(base64_decode($sock->getFrameWork("squid.php?migration-stats=yes")));
	if(is_array($migration_pid)){
		$text_script="<span style='color:#B80000;font-size:13px'>{migration_script_run_text} PID:{$migration_pid[0]} {since}:{$migration_pid[1]}Mn</span>";
	}	
	
	
	$DisableSquidSNMPModeText="{disabled}";
	$DisableSquidSNMPModeCK="20-check-grey.png";
	$SquidEnableRockStoreCK="20-check-grey.png";
	if(preg_match("#^([0-9]+)\.([0-9]+)#", $master_version,$re)){
		$MAJOR=$re[1];
		$MINOR=$re[2];
		if($MAJOR>2){if($MINOR>1){$As32=true;}}
		$master_version_text="$MAJOR.$MINOR";
	}	
	
	if(preg_match("#^([0-9]+)\.([0-9]+)\.([0-9]+)#", $master_version,$re)){
		$MAJOR=$re[1];
		$MINOR=$re[2];
		$REV=$re[3];
		$master_version_text="$MAJOR.$MINOR.$REV";
	}
	
	
	if($master_version_text==null){$master_version_text="Unknown";}
	
//.........这里部分代码省略.........
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:101,代码来源:squid.main.quicklinks.php


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