/** * Construct transport * * @param \Elastica\Connection $connection Connection object * @throws \Elastica\Exception\RuntimeException */ public function __construct(Connection $connection = null) { parent::__construct($connection); if (!class_exists('Elasticsearch\\RestClient')) { throw new RuntimeException('Elasticsearch\\RestClient class not found. Check that suggested package munkie/elasticsearch-thrift-php is required in composer.json'); } }
/** * Construct transport. */ public function __construct(Connection $connection = null, HttpAdapterInterface $httpAdapter) { parent::__construct($connection); $this->httpAdapter = $httpAdapter; }