Пример #1
0
 /**
  * Class destructor
  * 
  * Stores the cache and outputs and performance data requested
  * 
  * @access public
  * @return void
  */
 public function __destruct()
 {
     if (defined('USU5_ENABLED') && USU5_ENABLED == 'true') {
         $this->getVar('cache')->store($this->getVar('registry')->store());
         if (defined('USU5_OUPUT_PERFORMANCE') && USU5_OUPUT_PERFORMANCE == 'true') {
             performance();
         }
         if (defined('USU5_DEBUG_OUPUT_VARS') && USU5_DEBUG_OUPUT_VARS == 'true') {
             usu5_show_vars($this->vars);
         }
     }
 }
Пример #2
0
<?php

include 'neutralfunctions.php';
db();
$title = "Deleted Torrents";
title($title);
echo "<table>";
$output = array();
$q = "SELECT hash FROM torrents WHERE dateofdeletion !=\n'0000-00-00'";
$list = mysql_query($q);
$n = 0;
while ($names = mysql_fetch_array($list, MYSQL_ASSOC)) {
    foreach ($names as $l) {
        $out = performance($l);
        array_push($output, $out);
    }
}
sort($output);
makeDeletedTable($output);
Пример #3
0
    $k = 'libo';
    $f = $k . $i . $i;
    return $redis->hSet($k, $f, json_encode($arr));
}
function redis_31($i)
{
    global $redis, $arr;
    $k = 'libo';
    $f = $k . $i . $i;
    return json_decode($redis->hGet($k, $f), true);
}
function performance($func)
{
    echo "========= {$func} =============\n";
    $t1 = microtime(true);
    $ret = [];
    for ($i = 0, $c = 130; $i < $c; $i++) {
        $ret[] = $func($i);
    }
    $t2 = microtime(true);
    //    ob_start();
    //print_r($ret);
    //ob_clean();
    echo "total: " . ($t2 - $t1) . "\n";
}
//performance('redis');
//performance('json');
performance('redis_2');
//performance('redis_3');
//performance('redis_21');
//performance('redis_31');
	include_once('ressources/class.templates.inc');
	include_once('ressources/class.ldap.inc');
	include_once('ressources/class.users.menus.inc');
	include_once('ressources/class.squid.inc');
	
	
$usersmenus=new usersMenus();
if(!$usersmenus->AsSquidAdministrator){
	$tpl=new templates();
	$alert=$tpl->_ENGINE_parse_body('{ERROR_NO_PRIVS}');
	echo "<script>alert('$alert');</script>";
	die();	
}

if(isset($_GET["explain"])){explain_this();exit;}
if(isset($_GET["performance"])){performance();exit;}
if(isset($_POST["SquidPerformance"])){SquidPerformance();exit;}

tabs();
function tabs(){
	$page=CurrentPageName();
	$sock=new sockets();
	$users=new usersMenus();
	$q=new mysql_blackbox();
	$tpl=new templates();
	$language=$tpl->language;
	$array["performance"]="{global_performance}";
	$array["squid-memory"]='{memory}';
	$array["peristent_cnx"]="{persistent_connections}";
	$array["performance-reports"]="{performance_reports}";
	$array["logger"]="{artica_logger}";
Пример #5
0
<!-- 头部 -->
<header class="header theme-header">
    <?php 
if (current_user_can('level_10')) {
    ?>
 		<div class="admin"><a href="<?php 
    bloginfo('url');
    ?>
/wp-admin">管理</a></div>
	<?php 
}
?>
    <?php 
if (current_user_can('level_10')) {
    if (function_exists('performance')) {
        performance(true);
    }
}
?>
	<div class="header-box">
        <a id="menu-btn" class="menu-button" href="javascript:void(0)"><i class="fa fa-list"></i></a>
        <div class="blog-info">
            <a href="<?php 
bloginfo('url');
?>
"><span class="blog-name"><?php 
bloginfo('name');
?>
</span></a>
            <span class="blog-descption type"><?php 
bloginfo('description');
include_once 'ressources/class.ldap.inc';
include_once 'ressources/class.users.menus.inc';
include_once 'ressources/class.squid.inc';
$usersmenus = new usersMenus();
if (!$usersmenus->AsSquidAdministrator) {
    $tpl = new templates();
    $alert = $tpl->_ENGINE_parse_body('{ERROR_NO_PRIVS}');
    echo "<script>alert('{$alert}');</script>";
    die;
}
if (isset($_GET["explain"])) {
    explain_this();
    exit;
}
if (isset($_GET["performance"])) {
    performance();
    exit;
}
if (isset($_POST["SquidPerformance"])) {
    SquidPerformance();
    exit;
}
tabs();
function tabs()
{
    $page = CurrentPageName();
    $sock = new sockets();
    $users = new usersMenus();
    $q = new mysql_blackbox();
    $tpl = new templates();
    $language = $tpl->language;