Ejemplo n.º 1
0
 private function logEvent($event)
 {
     file_put_contents('/tmp/event.txt', $this->eventStorage->isOn() ? 'on' : 'off' . ' - event = ' . $event['event'] . ' -- object = ' . $this->getObject($event['object']) . "\n", FILE_APPEND);
     $evenId = $event['event'] ? $this->findOrCreate(array('name' => $event['event']), array('name')) : null;
     $classId = $this->getObject($event['object']) ? $this->systemClassRepository->findOrCreate(array('name' => $this->getObject($event['object'])), array('name')) : null;
     if ($evenId) {
         $this->eventLogRepository->create(array('log_id' => $this->logRepository->getCurrentLogId(), 'event_id' => $evenId, 'class_id' => $classId));
     }
 }
Ejemplo n.º 2
0
 public function logEvents()
 {
     if (!$this->logRepository->getCurrentLogId()) {
         return;
     }
     foreach ($this->eventStorage->popAll() as $event) {
         if ($this->isLoggableEvent($event)) {
             $this->logEvent($event);
         }
     }
 }