Пример #1
0
 private function logEvent($event)
 {
     $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));
     }
 }
Пример #2
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));
     }
 }
Пример #3
0
 public function logEvent($event)
 {
     $event = $this->makeEventArray($event);
     $evenId = $this->getEventId($event);
     if ($evenId) {
         $objectName = $this->getObjectName($event);
         $classId = $this->getClassId($objectName);
         $this->eventLogRepository->create(array('log_id' => $this->logRepository->getCurrentLogId(), 'event_id' => $evenId, 'class_id' => $classId));
     }
 }
Пример #4
0
 private function logQuery($query)
 {
     $sqlQuery = htmlentities($query['query']);
     $bindings = $query['bindings'];
     $time = $query['time'];
     $name = $query['name'];
     if (!$this->sqlQueryIsLoggable($sqlQuery)) {
         return;
     }
     $connectionId = $this->connectionRepository->findOrCreate(array('name' => $name), array('name'));
     $sqlQueryId = $this->findOrCreate(array('sha1' => sha1($sqlQuery), 'statement' => $sqlQuery, 'time' => $time, 'connection_id' => $connectionId), array('sha1'));
     if ($bindings && $this->canLogBindings()) {
         $bindingsSerialized = $this->serializeBindings($bindings);
         $sqlQuery_bindings_id = $this->sqlQueryBindingRepository->findOrCreate(array('sha1' => sha1($bindingsSerialized), 'serialized' => $bindingsSerialized), array('sha1'), $created);
         if ($created) {
             foreach ($bindings as $parameter => $value) {
                 $this->sqlQueryBindingParameterRepository->create(array('sql_query_bindings_id' => $sqlQuery_bindings_id, 'name' => '?', 'value' => $value));
             }
         }
     }
     $this->sqlQueryLogRepository->create(array('log_id' => $this->logRepository->getCurrentLogId(), 'sql_query_id' => $sqlQueryId));
 }