new instance

@param array $config

@return static
358476
public static function instance($config = [])
    {
        if (null === self::$instance) {
            self::$instance = new static($config);
        }

        return self::$instance;
    }
455561
public static function getInstance($name, $config = array())
    {
        static $instance;

        if (!$instance) {
            $instance = new static();
        }

        $object = clone $instance;

        $config['name'] = $name;

        $object->append($config)
        ->append(array(
            'attribs' => array(
            'id' => null,
            ),
        ));

        return $object;
    }
361157
protected function createDataColumnByConfig(array $config = [])
    {
        return Yii::createObject(array_merge([
            'class' => $this->dataColumnClass ?: \yii\grid\DataColumn::class,
            'grid'  => $this,
        ], $config));
    }
994252
public static function instance($config = [], BarManager $barManager = null, Bar $bar = null)
    {
        static $instance;

        if (is_null($instance) === false) {
            return $instance;
        }

        return $instance = new static($config, $barManager, $bar);
    }
1110482
public function load(array $config)
    {
        $config = $this->getParsedConfig(
            $config,
            $this->config,
            $this->yamlConfigMap,
            $this->required
        );
        $this->setParsedConfig($config);

        return $this;
    }
563414
public static function configure($config)
    {
        if (is_null(static::$instance)) {
            static::$instance = new self();

            static::$name = $config['default'];

            static::$config = $config;
        }

        return static::$instance;
    }
892748
public static function instance(array $config = array())
    {
        if (!(self::$instance instanceof Phery)) {
            self::$instance = new Phery($config);
        } else if ($config) {
            self::$instance->config($config);
        }

        return self::$instance;
    }
1008926
public static function deserialize(array $config)
    {
        if (isset($config['class']) && isset($config['config'])) {
            $config = $config['config'];
        }
        $instance = new self();
        $instance->loadConfig($config);
        return $instance;
    }
1165496
public static function factory($config = array())
    {
        $required = array(
            'base_url',
            'username',
            'password',
        );

        $defaults = array(
            'base_url' => self::BASE_URL,
            'base_path' => self::BASE_PATH,
        );

        // Instantiate the Acquia Search plugin.
        $config = Collection::fromConfig($config, $defaults, $required);
        $client = new static($config->get('base_url'), $config);
        $client->setDefaultHeaders(array(
            'Content-Type' => 'application/json; charset=utf-8',
        ));

        // Attach the Acquia Search plugin to the client.
        $plugin = new CloudApiAuthPlugin($config->get('username'), $config->get('password'));
        $client->addSubscriber($plugin);

        return $client;
    }
1368858
public function createCommand($config = [])
    {
        $this->open();
        $config['db'] = $this;
        $command = new Command($config);

        return $command;
    }
557560
public function add(array $config) : self
    {
        $this->config = array_replace_recursive($this->config, $config);

        return $this;
    }
849472
protected function createSingleConnection(array $config)
    {
        $connector = $this->createConnector($config)->connect($config);

        return $this->createConnection($connector, $config);
    }
372486
public function setConfig(array $config)
    {
        $this->config = array_merge($this->config, $config);

        if ($this->config[ 'responsive' ]) {
            $this->responsive();
        }

        return $this;
    }
870154
public static function factory(array $config)
    {
        if ( ! array_key_exists('apiKey', $config)) {
            throw new \Exception('Api factory requires $apiKey parameter.');
        }

        $client = new Client([
            'defaults' => [
                'headers' => [
                    'X-ApiKey' => $config['apiKey'],
                ],
            ],
        ], [], $config);

        $description = self::getDescriptionFromConfig($config);

        $apiVersion = isset($config['apiVersion']) ? $config['apiVersion'] : 1;

        return new self($client, $description, ['defaults' => ['api_version' => $apiVersion]]);
    }
492132
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;
    }
486185
public function createContainer(array $config)
    {
        $container = new Container();
        $container->add('config.raw', $config);
        $this->setContainer($container);
        return $this->getContainer();
    }
1057711
public function setConfig(array $config)
    {
        foreach ($this->configurable as $setting) {
            if ( ! isset($config[$setting])) {
                continue;
            }

            $method = 'set' . ucfirst($setting);

            if (method_exists($this, $method)) {
                $this->$method($config[$setting]);
            }
        }

        return $this;
    }