本文整理匯總了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'));
}