本文整理汇总了PHP中Elastica\Client::getConnection方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::getConnection方法的具体用法?PHP Client::getConnection怎么用?PHP Client::getConnection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Elastica\Client
的用法示例。
在下文中一共展示了Client::getConnection方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testConstruct
public function testConstruct()
{
$host = 'localhost';
$port = 9500;
$client = new Client(array('host' => $host, 'port' => $port, 'transport' => 'Thrift'));
$this->assertEquals($host, $client->getConnection()->getHost());
$this->assertEquals($port, $client->getConnection()->getPort());
}
示例2: testPassBigIntSettingsToConnectionConfig
/**
* @group unit
*/
public function testPassBigIntSettingsToConnectionConfig()
{
$client = new Client(['bigintConversion' => true]);
$this->assertTrue($client->getConnection()->getConfig('bigintConversion'));
}
示例3: testWithoutProxy
public function testWithoutProxy()
{
$client = new \Elastica\Client(array('transport' => 'Guzzle'));
$client->getConnection()->setProxy('');
$transferInfo = $client->request('/_nodes')->getTransferInfo();
$this->assertEquals(200, $transferInfo['http_code']);
}
示例4: testConnectionParamsArePreparedForDefaultOptions
public function testConnectionParamsArePreparedForDefaultOptions()
{
$client = new Client(array('url' => 'https://localhost:9200'));
$connection = $client->getConnection();
$this->assertEquals('https://localhost:9200', $connection->getConfig('url'));
}