コード例 #1
0
ファイル: Sonar.php プロジェクト: stanislav-web/PhalconSonar
 /**
  * Close conversation event
  *
  * @param ConnectionInterface $conn
  */
 public function onClose(ConnectionInterface $conn)
 {
     // The connection is closed, remove it, as we can no longer send it messages
     $this->clients->detach($conn);
     // pulled data from queues
     $data = $this->queueService->pull(['hash' => md5($this->getIpAddress($conn) . $this->getUserAgent($conn))], function ($response) use($conn) {
         return array_merge($response, ['ua' => $this->getUserAgent($conn), 'language' => $this->getLanguage($conn), 'location' => $this->getLocation($conn), 'close' => time()]);
     });
     // save data to storage
     $this->storageService->add($data);
     echo Messenger::close($this->getIpAddress($conn));
     // end profiler
     if (defined('SONAR_VERBOSE') === true) {
         Profiler::finish();
         Profiler::getProfilingData();
     }
 }
コード例 #2
0
 /**
  * Enable storage profiler
  *
  * @return array
  */
 public static function enableStorageProfiler(StorageService $storageService)
 {
     return $storageService->enableProfiler();
 }