function wakka2callbackdb($things) { $thing = $things[1]; global $wiki; print $thing; print "bla"; if (preg_match("/(~\\*~|~~)/s", $thing)) { $thing = preg_replace("/<br \\/>/", "", $thing); return parsedb($thing); } // if we reach this point, it must have been an accident. return $thing; }
function parse() { $TimeFile = "/etc/artica-postfix/pids/exec.squid.stats.mime.proto.php.time"; $pidfile = "/etc/artica-postfix/pids/exec.squid.stats.mime.proto.php.pid"; $GLOBALS["LogFileDeamonLogDir"] = @file_get_contents("/etc/artica-postfix/settings/Daemons/LogFileDeamonLogDir"); if ($GLOBALS["LogFileDeamonLogDir"] == null) { $GLOBALS["LogFileDeamonLogDir"] = "/home/artica/squid/realtime-events"; } $unix = new unix(); $pid = $unix->get_pid_from_file($pidfile); if ($unix->process_exists($pid, basename(__FILE__))) { $timepid = $unix->PROCCESS_TIME_MIN($pid); if ($GLOBALS["VERBOSE"]) { echo "{$pid} already executed since {$timepid}Mn\n"; } if ($timepid < 14) { return; } $kill = $unix->find_program("kill"); unix_system_kill_force($pid); } @file_put_contents($pidfile, getmypid()); $TimeExec = $unix->file_time_min($TimeFile); if (!$GLOBALS["FORCE"]) { if ($TimeExec < 20) { return; } } @unlink($TimeFile); @file_put_contents($TimeFile, time()); parsedb("/var/log/squid"); parsedb($GLOBALS["LogFileDeamonLogDir"]); }