/** * @param PreExecuteRequest $event */ public function preExecuteRequest(PreExecuteRequest $event) { $endpoint = $event->getEndpoint(); $uri = $event->getRequest()->getUri(); $path = sprintf('%s://%s:%s%s/%s', $endpoint->getScheme(), $endpoint->getHost(), $endpoint->getPort(), $endpoint->getPath(), urldecode($uri)); $this->logger->startRequest($path); }
public function testConstructorAndGetters() { $client = new Client(); $request = new Request(); $request->addParam('testparam', 'test value'); $endpoint = $client->getEndpoint(); $event = new PreExecuteRequest($request, $endpoint); $this->assertEquals($request, $event->getRequest()); $this->assertEquals($endpoint, $event->getEndpoint()); return $event; }
public function preExecuteRequest(PreExecuteRequest $event) { $this->currentRequest = $event->getRequest(); $this->currentEndpoint = $event->getEndpoint(); $this->currentStartTime = TimeUtil::getCurrentTime(); }
public function preExecuteRequest(SolariumPreExecuteRequestEvent $event) { if (isset($this->currentRequest)) { $this->failCurrentRequest(); } if (null !== $this->stopwatch) { $this->stopwatch->start('solr', 'solr'); } $this->currentRequest = $event->getRequest(); $this->currentEndpoint = $event->getEndpoint(); if (null !== $this->logger) { $this->logger->debug($event->getEndpoint()->getBaseUri() . $this->currentRequest->getUri()); } $this->currentStartTime = microtime(true); }
public function preExecuteRequest(SolariumPreExecuteRequestEvent $event) { if (isset($this->currentRequest)) { // mop: hmmm not sure what happens when an exception is thrown :S lets be restrictive for the moment throw new \RuntimeException('Request already set'); } if (null !== $this->stopwatch) { $this->stopwatch->start('solr', 'solr'); } $this->currentRequest = $event->getRequest(); if (null !== $this->logger) { $this->logger->debug($event->getEndpoint()->getBaseUri() . $this->currentRequest->getUri()); } $this->currentStartTime = microtime(true); }