src/Connection.php
public static function create($config)
    {

        $clientBuilder = ClientBuilder::create();

        if (!empty($config['handler'])) {
            $clientBuilder->setHandler($config['handler']);
        }

        $clientBuilder->setHosts($config["servers"]);

        $clientBuilder = self::configureLogging($clientBuilder,$config);

        $query = new Query($clientBuilder->build());

        if (array_key_exists("index", $config) and $config["index"] != "") {
            $query->index($config["index"]);
        }

        return $query;
    }
public static function create($config)
    {

        $clientBuilder = ClientBuilder::create();

        if (!empty($config['handler'])) {
            $clientBuilder->setHandler($config['handler']);
        }

        $clientBuilder->setHosts($config["servers"]);

        $clientBuilder = self::configureLogging($clientBuilder,$config);

        $query = new Query($clientBuilder->build());

        if (array_key_exists("index", $config) and $config["index"] != "") {
            $query->index($config["index"]);
        }

        return $query;
    }
public static function create ( $ config ) { $ clientBuilder = ClientBuilder :: create ( ) ; if ( ! empty ( $ config [ 'handler' ] ) ) { $ clientBuilder -> setHandler ( $ config [ 'handler' ] ) ; } $ clientBuilder -> setHosts ( $ config [ "servers" ] ) ; $ clientBuilder = self :: configureLogging ( $ clientBuilder , $ config ) ; $ query = new Query ( $ clientBuilder -> build ( ) ) ; if ( array_key_exists ( "index" , $ config ) and $ config [ "index" ] != "" ) { $ query -> index ( $ config [ "index" ] ) ; } return $ query ; }
Create a native connection
suitable for any non-laravel or non-lumen apps
any composer based frameworks
@param $config
@return Query
Create a native connection suitable for any non - laravel or non - lumen apps any composer based frameworks