IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Writing your own Connection Class
editWriting your own Connection Class
editIf you wish to completely write your own connection class, you just need to implement the ConnectionInterface
.
namespace Elasticsearch\Connections; use Psr\Log\LoggerInterface; interface ConnectionInterface { public function __construct($hostDetails, $connectionParams, LoggerInterface $log, LoggerInterface $trace); public function getTransportSchema(); public function isAlive(); public function markAlive(); public function markDead(); public function getLastRequestInfo(); public function performRequest($method, $uri, $params = null, $body = null); }
The abstract AbstractConnection
class provides useful boilerplate which you may wish to extend, such as various
utility logging methods.