Elastica\Client::getConfig PHP 메소드

getConfig() 공개 메소드

Returns a specific config key or the whole config array if not set.
public getConfig ( string $key = '' ) : array | string
$key string Config key
리턴 array | string Config value
    public function getConfig($key = '')
    {
        if (empty($key)) {
            return $this->_config;
        }
        if (!array_key_exists($key, $this->_config)) {
            throw new InvalidException('Config key is not set: ' . $key);
        }
        return $this->_config[$key];
    }

Usage Example

예제 #1
0
파일: LogTest.php 프로젝트: kskod/Elastica
 public function testSetLogConfigEnable()
 {
     $client = new Client(array('log' => true));
     $this->assertTrue($client->getConfig('log'));
 }
All Usage Examples Of Elastica\Client::getConfig