public function createService(ServiceLocatorInterface $serviceLocator) { $publicKey = $serviceLocator->get('servicePublicKeyReader'); $request = $serviceLocator->get('Request'); $uri = $request->getUri(); $scheme = $uri->getScheme(); $host = $uri->getHost(); $base = sprintf('%s://%s', $scheme, $host); $remoteAddr = $request->getServer('REMOTE_ADDR'); $params = $request->getContent(); $method = $request->getMethod(); /** * sends login info to message queue * @author Mustafa Zeynel Dağlı * @todo after tests , thif feature will be added as a service manager entity */ $PageEntryLogMQ = new \Utill\MQ\PageEntryLogMQ(); $PageEntryLogMQ->setChannelProperties(array('queue.name' => \Utill\MQ\abstractMQ::PAGE_ENTRY_LOG_QUEUE_NAME)); $message = new \Utill\MQ\MessageMQ\MQMessagePageEntryLog(); $message->setMessageBody(array('message' => 'Kullanıcı sayfa giris log servis!', 'log_datetime' => date('Y-m-d G:i:s '), 'pk' => $publicKey, 'url' => $base, 'path' => $host, 'method' => $method, 'ip' => $remoteAddr, 'params' => $params, 'type_id' => \Utill\MQ\MessageMQ\MQMessagePageEntryLog::PAGE_ENTRY_OPERATIN, 'logFormat' => 'database')); $message->setMessageProperties(array('delivery_mode' => 2, 'content_type' => 'application/json')); $PageEntryLogMQ->setMessage($message->setMessage()); $PageEntryLogMQ->basicPublish(); return true; }
public function createService(ServiceLocatorInterface $serviceLocator) { $serviceLogMQ = new \Utill\MQ\restEntryMQ(); $slimApp = $serviceLocator->get('slimApp'); $request = $slimApp->container['request']; $params = $request->params(); $requestHeaderData = $request->headers(); $base = $request->getRootUri(); $path = $request->getResourceUri(); $ip = $request->getIp(); $method = $request->getMethod(); /** * sends login info to message queue * @author Mustafa Zeynel Dağlı * @todo after tests , thif feature will be added as a service manager entity */ $PageEntryLogMQ = new \Utill\MQ\PageEntryLogMQ(); $PageEntryLogMQ->setChannelProperties(array('queue.name' => \Utill\MQ\abstractMQ::PAGE_ENTRY_LOG_QUEUE_NAME)); $message = new \Utill\MQ\MessageMQ\MQMessagePageEntryLog(); $message->setMessageBody(array('message' => 'Kullanıcı sayfa giris log servis!', 'log_datetime' => date('Y-m-d G:i:s '), 'pk' => $requestHeaderData['X-Public'], 'url' => $base, 'path' => $controller . '/' . $action, 'method' => $method, 'ip' => $remoteAddr, 'params' => $params, 'type_id' => \Utill\MQ\MessageMQ\MQMessagePageEntryLog::PAGE_ENTRY_OPERATIN, 'logFormat' => 'database')); $message->setMessageProperties(array('delivery_mode' => 2, 'content_type' => 'application/json')); $PageEntryLogMQ->setMessage($message->setMessage()); $PageEntryLogMQ->basicPublish(); return true; }