public function test_should_alert_works_fine() { Alert::init(__DIR__ . '/ini/alert.ini'); ob_start(); Alert::push('test', Alert::URGENCE); $this->assertContains(' [dev] test', ob_get_contents()); @ob_end_clean(); }
/** * 执行函数 * * @access public * @return Boolean true or false : next loop ? */ public function execute($loop = true) { $status = array_filter(self::queque_status_monitor()); if (!empty($status)) { Alert::push(sprintf('queque_status: (%s)', json_encode($status)), Alert::NORMAL | Alert::URGENCE); } $status = self::import_consist_monitor(); if (!empty($status)) { Alert::push(sprintf('import_consist: (%s)', json_encode($status)), Alert::NORMAL | Alert::URGENCE); } return $loop; }