Creates a bulk command for execution.
@param array $config the configuration for the [[BulkCommand]] class
@return BulkCommand the DB command
@since 2.0.5
513611
public function createBulkCommand($config = [])
    {
        $this->open();
        $config['db'] = $this;
        $command = new BulkCommand($config);

        return $command;
    }
855137
public static function create(array $config = [])
    {
        $container = new Container();

        foreach (self::$booleanSetters as $key => $method) {
            if (isset($config[$key])) {
                $container->$method((bool) $config[$key]);
            }
        }

        foreach (self::$arraySetters as $key => $method) {
            if (isset($config[$key]) && is_array($config[$key])) {
                foreach ($config[$key] as $name => $value) {
                    $container->$method($name, $value);
                }
            }
        }

        if (isset($config[Container::CONFIG_ENTRIES]) && is_array($config[Container::CONFIG_ENTRIES])) {
            self::createEntries($container, $config[Container::CONFIG_ENTRIES]);
        }

        return $container;
    }
1068826
public function build(array $config)
    {
        $container = new Container();
        foreach ((array) $config as $name => $component) {
            if (!is_array($component) || !array_key_exists('component', $component)) {
                $container->register($name, $component);
                continue;
            }

            $component = $this->applyDefaults($component);
            $container->register(
                $name,
                $this->buildDefinition($component['component']),
                $component['shared']
            );
        }

        return $container;
    }
988662
public function make(array $config)
    {
        $driver = $this->getDriver($config);

        // First we will check by the server driver type to see if an extension
        // has been registered specifically for that server.
        if (isset($this->serverExtensions[$driver])) {
            $server = call_user_func($this->serverExtensions[$driver], $config);
        }

        // Create a built-in server with given driver type.
        elseif (method_exists($this, $method = 'create'.Str::studly($driver).'Driver')) {
            $server = $this->$method($config);
        }

        // Otherwise, if the driver type does not support, an exception will be thrown.
        else {
            throw new InvalidArgumentException("Driver [{$driver}] is not supported.");
        }

        $this->configureServer($server, $config);

        return $server;
    }
1231907
protected function getDatabaseHandler(array $config)
    {
        return $this->app->make(PdoSessionHandler::class, [
            $this->app->make(Connection::class)->getWrappedConnection(),
            [
                'db_table' => 'Sessions',
                'db_id_col' => 'sessionID',
                'db_data_col' => 'sessionValue',
                'db_time_col' => 'sessionTime',
                'db_lifetime_col' => 'sessionLifeTime',
                'lock_mode' => PdoSessionHandler::LOCK_ADVISORY,
            ],
        ]);
    }
680510
protected function createSingleConnection(array $config)
    {
        $pdo = $this->createPdoResolver($config);

        return $this->createConnection(
            $config['driver'], $pdo, $config['database'], $config['prefix'], $config
        );
    }
430113
public static function make(array $config)
    {
        $builder = self::getBuilder();
        $configObject = $builder->build($config);
        $grid = new Grid($configObject);
        return $grid;
    }
101354
protected function createYaml(array $config)
    {
        $nested = [];

        array_walk(array_dot($config), function ($value, $key) use (&$nested) {
            array_set($nested, $key, $value);
        });

        return $this->yaml->dump($nested, 4);
    }
473515
protected function createTokenRepository( array $config )
	{
		$key = Config::get( 'app.key' );

		if ( Str::startsWith( $key, 'base64:' ) )
			$key = base64_decode( substr( $key, 7 ) );

		$connection = isset( $config['connection'] ) ? $config['connection'] : null;

		return new DatabaseTokenRepository( DatabaseManager::i()->connection( $connection ), $config['table'], $key, $config['expire'] );
	}
977835
protected function createDatabaseDriver(array $config)
    {
        $connection = $this->app['db']->connection(Arr::get($config, 'connection'));

        return $this->repository(
            new DatabaseStore(
                $connection, $config['table'], $this->getPrefix($config)
            )
        );
    }
287267
protected function getDblibDsn(array $config)
	{
		$arguments = array(
			'host' => $this->buildHostString($config, ':'),
			'dbname' => $config['database']
		);

		$arguments = array_merge(
			$arguments, array_only($config, ['appname', 'charset'])
		);

		return $this->buildConnectString('dblib', $arguments);
	}
1153907
public function getCommand($name, Config $config)
    {
        if (!$config->hasItem('commands', $name)) {
            if (!$config->hasItem('commands', '_'.$name)) {
                $config->checkItem('commands', $name);
            }
            $name = '_'.$name;
        }

        return $config->getItem('commands', $name);
    }
466372
protected function createPdoResolverWithHosts( array $config )
	{
		return function () use ( $config ) {

			foreach( Arr::shuffle( $hosts = $this->parseHosts( $config ) ) as $key => $host )
			{
				$config['host'] = $host;
				try
				{
					return $this->createConnector( $config )->connect( $config );
				}
				catch( PDOException $e )
				{
					if( count( $hosts ) - 1 === $key )
					{
						App::Log($e);
					}
				}
			}

			if(!isset($e)) {
				$e = new PDOException("Empty connection");
			}

			throw $e;
		};
	}
919402
public static function factory($config = array())
    {
        $configuration = static::buildConfig($config);

        $client = new self($configuration->get('base_url'), $configuration);

        $client->addSubscriber(new KeyAuthPlugin($configuration->get('key')));

        static::loadDefinitions($client);
        static::toggleRateLimitingPlugin($client, $config);

        return $client;
    }
769140
protected function _instance($name, array $config = []) {
		if ($class = Libraries::locate('command.create', Inflector::camelize($name))) {
			$this->request->params['template'] = $this->template;

			return new $class([
				'request' => $this->request,
				'classes' => $this->_classes
			]);
		}
		return parent::_instance($name, $config);
	}
361157
protected function createDataColumnByConfig(array $config = [])
    {
        return Yii::createObject(array_merge([
            'class' => $this->dataColumnClass ?: \yii\grid\DataColumn::class,
            'grid'  => $this,
        ], $config));
    }
1057933
protected function createPartOfStructure(array $config)
  {
    $return_properties    = array();
    $return_configuration = array();

    foreach ($config as $configuration)
    {
      $value = null;
      switch ($configuration->getType())
      {
        case TypeEnum::COLLECTION_TYPE:
          $value = array($this->createPartOfStructure($configuration->getChildren()));
          break;
        case TypeEnum::OBJECT_TYPE:
          $value = $this->createPartOfStructure($configuration->getChildren());
          break;
        case TypeEnum::ARRAY_TYPE:
          $value = array();
          break;
        default:
          break;
      }
      $this->modifyConfiguration($configuration);
      $parameter = new Parameter($configuration->getKey(), $value);

      $return_properties[$configuration->getKey()]    = $parameter;
      $return_configuration[$configuration->getKey()] = $configuration;
    }

    return $this->classBuilder->build('\stdClass', $return_configuration, $return_properties);
  }