Create a custom log driver instance.

@param  array  $config
@return \Psr\Log\LoggerInterface
775175
protected function createCustomDriver(array $config)
    {
        $factory = is_callable($via = $config['via']) ? $via : $this->app->make($via);

        return $factory($config);
    }
413855
protected function createRedisDriver(array $config)
    {
        $connection = Arr::get($config, 'connection');

        // Create a Redis Database instance.
        $redis = $this->app->make('redis');

        return new RedisBroadcaster($this->app, $redis, $connection);
    }
1058179
public function createConnector( array $config )
	{
		if( !isset( $config['driver'] ) )
		{
			throw new InvalidArgumentException( 'A driver must be specified.' );
		}

		if( $this->container->getIs( $key = "db.connector.{$config['driver']}" ) )
		{
			return $this->container->get( $key );
		}

		switch( $config[ 'driver' ] ) {
			case 'mysql':
				return new MySqlConnector;
			/* TODO add support
			 * case 'pgsql':
				return new PostgresConnector;*/
		}

		throw new InvalidArgumentException( "Unsupported driver [{$config['driver']}]" );
	}
785455
public function setLogConfig(array $logConfig)
    {
        $this->logConfig = $logConfig;

        $this->hostConfig = array_merge($this->hostConfig, ['LogConfig' => $logConfig]);

        return $this;
    }
775852
public static function createServiceManager(array $config = [])
    {
        $serviceManager = new ServiceManager(new Config($config));

        $serviceManager->addInitializer(
            function ($instance, ServiceLocatorInterface $serviceLocator) {
                if ($instance instanceof ModelManagerAwareInterface) {
                    $instance->setModelManager($serviceLocator->get('modelmanager'));
                }
            }
        );

        $serviceManager->addInitializer(
            function ($instance, ServiceLocatorInterface $serviceLocator) {
                if ($instance instanceof ServiceLocatorAwareInterface) {
                    $instance->setServiceLocator($serviceLocator);
                }
            }
        );

        return $serviceManager;
    }
671390
public static function createFromConfig(array $config)
    {
        $manager = static::createEmptyFromConfig($config);

        $manager->addCollection(new CssCollection)
                ->addCollection(new JavascriptCollection);

        return $manager;
       
    }
613778
protected function createSingleDriver(array $config)
    {
        return new Monolog($this->parseChannel($config), [
            $this->prepareHandler(
                new StreamHandler($config['path'], $this->level($config))
            ),
        ]);
    }
330858
public function getDriver($driver = null, array $config = [])
    {
        $driver = strtolower($driver);

        if (!isset($this->drivers[$driver])) {
            $this->drivers[$driver] = $this->createDriver($driver, $config);
        }

        return $this->drivers[$driver];
    }
433796
public function make(array $config)
    {
        if (!isset($config['driver'])) {
            throw new InvalidArgumentException('A driver must be specified.');
        }

        return $this->factory($config['driver'])->make($config);
    }
1190216
private function buildDriver(array $driverConfig)
    {
        $class = array_get($driverConfig, 'class', '');
        if ($class && class_exists($class)) {
            $implements = class_implements($class);

            // Make sure that the provided class implements the DriverInterface
            if (isset($implements['Stash\Interfaces\DriverInterface'])) {
                /* @var \Stash\Interfaces\DriverInterface $tempDriver */

                // Only add if the driver is available
                if ($class::isAvailable()) {
                    $tempDriver = new $class(array_get($driverConfig, 'options', null));

                    return $tempDriver;
                }
            } else {
                throw new \RuntimeException('Cache driver class must implement \Stash\Interfaces\DriverInterface.');
            }
        }

        return null;
    }
380739
public function createLogger(string $id, array $config): LoggerInterface
    {
        if (!isset($this->_loggers[$id])) {
            $handlers = [];
            $processors = [];

            if (isset($config['handlers'])) {
                foreach ($config['handlers'] as $handlerId) {
                    $handlers[$handlerId] = $this->getHandler($handlerId);
                }
            }

            if (isset($config['processors'])) {
                foreach ($config['processors'] as $processorId) {
                    $processors[$processorId] = $this->getProcessor($processorId);
                }
            }

            $this->setLogger(
                $id,
                new Logger(
                    $id,
                    $handlers,
                    $processors,
                    isset($config['timezone']) ?
                        $config['timezone'] :
                        null
                )
            );
        }

        return $this->_loggers[$id];
    }
122624
protected function createPdoResolver(array $config)
    {
        return array_key_exists('host', $config)
                            ? $this->createPdoResolverWithHosts($config)
                            : $this->createPdoResolverWithoutHosts($config);
    }
302578
protected function createSingleConnection(array $config)
    {
        $pdo = $this->createConnector($config)->connect($config);

        return $this->createConnection($config['driver'], $pdo, $config['database'], $config['prefix'], $config);
    }
1058583
public function make(array $config)
    {
        Arr::requires($config, ['token']);

        $client = new Client();

        return new GitterGateway($client, $config);
    }
680510
protected function createSingleConnection(array $config)
    {
        $pdo = $this->createPdoResolver($config);

        return $this->createConnection(
            $config['driver'], $pdo, $config['database'], $config['prefix'], $config
        );
    }
792217
public function createNullDriver(array $config)
    {
        return $this->adapt($this->createFlysystem(new \League\Flysystem\Adapter\NullAdapter, $config));
    }
1208451
public function make(array $config): SearchClient
    {
        $config = $this->getConfig($config);

        return $this->getClient($config);
    }