public function __construct($xml = null, $verbose = false, $logFile = null)
 {
     if ($xml) {
         $this->setCronsXMLPath($xml);
     }
     parent::__construct($xml, $verbose, $logFile);
 }
 /**
  * @see CronJobParser
  */
 public function __construct($model = null, $verbose = false, $logFile = null)
 {
     if ($model) {
         $this->setModel($model);
     }
     self::$connection = AgaviContext::getInstance()->getDatabaseManager()->getDatabase('icinga_web')->getConnection();
     $this->setAgavi(CronAgaviAdapter::getInstance());
     if (!self::$connected) {
         self::$connected = true;
     }
     parent::__construct($model, $verbose, $logFile);
 }
Esempio n. 3
0
 /**
  * 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);
     }
 }
 public function __construct($model = null, $verbose = false, $logFile = null)
 {
     $this->setAgavi(CronAgaviAdapter::getInstance());
     parent::__construct($model, $verbose, $logFile);
 }