/** * Creates a new icingaCron * * @param array $params Parameters to use. This can be * action: "exec" - execute the tasks * type : The source from which to parse * @param boolean $verbose use verbose logging * */ public function __construct(array $params = array(), $verbose = false) { $this->setVerbose($verbose); $this->setAction(@$params["action"]); try { switch ($params["type"]) { case 'XML': $this->setParser(CronJobParser::createParser("XML", $params["src"], $this->isVerbose())); break; case 'table': $this->setParser(CronJobParser::createParser("DB", $params["src"], $this->isVerbose())); break; case 'agavi': $this->setParser(CronJobParser::createParser("Agavi", "", $this->isVerbose())); break; } if ($this->getAction() == "exec") { $this->execute(); } } catch (Exception $e) { $this->log($e->getMessage(), true); $this->log($e->getTraceAsString(), true); } }