FOSElasticaBundle/Client.php

26 lines
596 B
PHP
Raw Normal View History

2011-10-04 17:01:38 +02:00
<?php
2011-10-04 17:26:14 +02:00
namespace FOS\ElasticaBundle;
2011-10-04 17:01:38 +02:00
use Elastica\Client as ElasticaClient;
2013-05-06 10:32:50 +02:00
use Elastica\Request;
2011-10-04 17:01:38 +02:00
/**
* @author Gordon Franke <info@nevalon.de>
*/
class Client extends ElasticaClient
2011-10-04 17:01:38 +02:00
{
public function request($path, $method = Request::GET, $data = array(), array $query = array())
2011-10-04 17:26:14 +02:00
{
$start = microtime(true);
2012-05-02 00:06:28 +02:00
$response = parent::request($path, $method, $data, $query);
if (null !== $this->_logger) {
$time = microtime(true) - $start;
$this->_logger->logQuery($path, $method, $data, $time);
2011-10-04 17:26:14 +02:00
}
2011-10-04 17:01:38 +02:00
return $response;
2011-10-04 17:01:38 +02:00
}
}