示例#1
0
文件: Zabbix.php 项目: jiang51/monda
 static function query($query)
 {
     if (!self::$zq) {
         Monda::init_sql();
     }
     if (!is_array($query)) {
         $args = func_get_args();
     } else {
         $args = $query;
     }
     $psql = new \Nette\Database\SqlPreprocessor(self::$zq->connection);
     list($sql) = $psql->process($args);
     CliDebug::dbg("zquery(\n{$sql}\n)=\n");
     if (Options::get("progress")) {
         CliDebug::progress("Z\r");
     }
     $ret = self::$zq->queryArgs(array_shift($args), $args);
     CliDebug::dbg(sprintf("%d\n", count($ret)));
     self::$lastsql = $sql;
     return $ret;
 }
示例#2
0
文件: Monda.php 项目: jiang51/monda
 static function exitJob()
 {
     if (getenv("MONDA_CHILD")) {
         CliDebug::info("Jobserver: Exit child.\n");
         unset(self::$zq);
         unset(self::$mq);
         unset(self::$api);
         for ($i = 3; $i < 100; $i++) {
             @fclose($i);
         }
         \App\Presenters\DefaultPresenter::mexit();
     }
 }