本文整理汇总了PHP中Parseline函数的典型用法代码示例。如果您正苦于以下问题:PHP Parseline函数的具体用法?PHP Parseline怎么用?PHP Parseline使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Parseline函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unix
$GLOBALS["PDNS_HACK_DB"]=array();
$unix=new unix();
$GLOBALS["NODRYREBOOT"]=$sock->GET_INFO("NoDryReboot");
$GLOBALS["CLASS_SOCKET"]=$sock;
$GLOBALS["CLASS_UNIX"]=$unix;
$sock=null;
$unix=null;
$mem=round(((memory_get_usage()/1024)/1000),2);events("{$mem}MB before forking","MAIN",__LINE__);
$_GET["server"]=$users->hostname;
$pipe = fopen("php://stdin", "r");
while(!feof($pipe)){
$buffer .= fgets($pipe, 4096);
try{ Parseline($buffer);}catch (Exception $e) {events("fatal error:". $e->getMessage());}
$buffer=null;
}
fclose($pipe);
events("Shutdown...");
die();
function Parseline($buffer){
$buffer=trim($buffer);
if(preg_match("#artica-filter#",$buffer)){return true;}
if(preg_match("#postfix\/#",$buffer)){return true;}
if(preg_match("#CRON\[#",$buffer)){return true;}
if(preg_match("#: CACHEMGR:#",$buffer)){return true;}
if(preg_match("#exec\.postfix-logger\.php:#",$buffer)){return true;}
if(preg_match("#artica-install\[#",$buffer)){return true;}
示例2: die
if (posix_getuid() != 0) {
die("Cannot be used in web server mode\n\n");
}
if (!Build_pid_func(__FILE__, "MAIN")) {
events("Already executed.. aborting the process");
die;
}
$pid = getmypid();
$pidfile = "/etc/artica-postfix/" . basename(__FILE__) . ".pid";
@mkdir("/home/apache/artica-stats", 0666, true);
events("running {$pid} ");
file_put_contents($pidfile, $pid);
$pipe = fopen("php://stdin", "r");
while (!feof($pipe)) {
$buffer .= fgets($pipe, 4096);
Parseline(trim($buffer));
$buffer = null;
}
fclose($pipe);
DumpMemory();
events("Shutdown...");
die;
function Parseline($buffer)
{
if ($buffer == null) {
return;
}
$FOUND = false;
if (preg_match('#ngx\\[(.*?)\\]\\s+(.+?)\\s+(.+?)\\s+(.*?)\\s+\\[(.+?)\\]\\s+([A-Z]+)\\s+(.+?)\\s+[A-Z]+\\/[0-9\\.]+\\s+"([0-9]+)"\\s+([0-9]+)#', $buffer, $re)) {
$FOUND = true;
$hostname = $re[1];