From 979fcceb99e555800fdfbc2cecf4ba585e780b73 Mon Sep 17 00:00:00 2001 From: osmiy Date: Wed, 19 Apr 2006 14:47:21 +0000 Subject: - code optimization (Eugene) git-svn-id: svn://svn.zabbix.com/trunk@2744 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/include/config.inc.php | 175 ++--------------------------------- 1 file changed, 7 insertions(+), 168 deletions(-) (limited to 'frontends/php/include/config.inc.php') diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php index 3c8924f0..ac694a90 100644 --- a/frontends/php/include/config.inc.php +++ b/frontends/php/include/config.inc.php @@ -22,6 +22,8 @@ function SDI($msg="SDI") { echo "DEBUG INFO: $msg ".BR; } // DEBUG INFO!!! ?> 10 to something like localhost:procload.last(0)>10 - - function explode_exp ($expression, $html) - { -# echo "EXPRESSION:",$expression,"
"; - - $functionid=''; - $exp=''; - $state=''; - for($i=0;$i".$row1["host"].":".$row1["key_"].".".$row1["function"]."(".$row1["parameter"].")}"; - } - else - { - $exp=$exp."{".$row1["host"].":".$row1["key_"].".".$row1["function"]."(".$row1["parameter"].")}"; - } - } - continue; - } - if($state == "FUNCTIONID") - { - $functionid=$functionid.$expression[$i]; - continue; - } - $exp=$exp.$expression[$i]; - } -# echo "EXP:",$exp,"
"; - return $exp; - } - - # Translate localhost:procload.last(0)>10 to {12}>10 - - /*function implode_exp ($expression, $triggerid) - { -// echo "Expression:$expression
"; - $exp=''; - $state=""; - for($i=0;$i"; -// echo "KEY:$key
"; -// echo "FUNCTION:$function
"; -// echo "PARAMETER:$parameter
"; - $state=''; - - $sql="select i.itemid from items i,hosts h where i.key_=".zbx_dbstr($key). - " and h.host=".zbx_dbstr($host)." and h.hostid=i.hostid"; -# echo $sql,"
"; - $res=DBselect($sql); - $row=DBfetch($res); - - $itemid=$row["itemid"]; -# echo "ITEMID:$itemid
"; - - $sql="insert into functions (itemid,triggerid,function,parameter)". - " values ($itemid,$triggerid,".zbx_dbstr($function).",". - zbx_dbstr($parameter).")"; -# echo $sql,"
"; - $res=DBexecute($sql); - if(!$res) - { -# echo "ERROR
"; - return $res; - } - $functionid=DBinsert_id($res,"functions","functionid"); - - $exp=$exp.'{'.$functionid.'}'; - - continue; - } - if($expression[$i] == '(') - { - if($state == "FUNCTION") - { - $state='PARAMETER'; - continue; - } - } - if($expression[$i] == ')') - { - if($state == "PARAMETER") - { - $state=''; - continue; - } - } - if(($expression[$i] == ':') && ($state == "HOST")) - { - $state="KEY"; - continue; - } - if($expression[$i] == '.') - { - if($state == "KEY") - { - $state="FUNCTION"; - continue; - } - // Support for '.' in KEY - if($state == "FUNCTION") - { - $state="FUNCTION"; - $key=$key.".".$function; - $function=""; - continue; - } - } - if($state == "HOST") - { - $host=$host.$expression[$i]; - continue; - } - if($state == "KEY") - { - $key=$key.$expression[$i]; - continue; - } - if($state == "FUNCTION") - { - $function=$function.$expression[$i]; - continue; - } - if($state == "PARAMETER") - { - $parameter=$parameter.$expression[$i]; - continue; - } - $exp=$exp.$expression[$i]; - } - return $exp; - }*/ - function add_image($name,$imagetype,$file) { if(!is_null($file)) @@ -1975,6 +1811,9 @@ function SDI($msg="SDI") { echo "DEBUG INFO: $msg ".BR; } // DEBUG INFO!!! "page_footer_r") )); $table->Show(); + + COpt::profiling_stop("page"); + echo "\n"; echo "\n"; } -- cgit