Ejemplo n.º 1
0
 public function runEvents()
 {
     $process = $this->_getProcess();
     foreach ($this->_events as $event) {
         if (!$this->_isRunning($event)) {
             if ($this->_shouldRun($event)) {
                 $this->_runEvent($event);
             } elseif (null === $this->_storage->getLastRuntime($event) && $this->_isIntervalEvent($event)) {
                 $this->_storage->setRuntime($event, $this->_startTime);
             }
         }
     }
     $resultList = $process->listenForChildren();
     foreach ($resultList as $identifier => $result) {
         $event = $this->_getRunningEvent($identifier);
         $this->_markStopped($event);
         $this->_storage->setRuntime($event, $this->_getCurrentDateTime());
     }
 }
Ejemplo n.º 2
0
 /**
  * @param CM_Clockwork_Event $event
  */
 protected function _markCompleted(CM_Clockwork_Event $event)
 {
     $startTime = $this->_eventsRunning[$event->getName()]['startTime'];
     $this->_storage->setRuntime($event, $startTime);
 }