Create an instance of the daily file log driver.

@param array $config

@return \Psr\Log\LoggerInterface
482162
protected function createDailyDriver(array $config)
    {
        return new Monolog($this->parseChannel($config), [
            $this->prepareHandler(new RotatingFileHandler(
                $config['path'], $config['days'] ?? 7, $this->level($config)
            )),
        ]);
    }
692169
public static function createFromArray(array $config)
    {
        $self = new self();

        if (!empty($config['base_url'])) {
            $self->setBaseUrl($config['base_url']);
        }

        if (!empty($config['auth_path'])) {
            $self->setAuthPath($config['auth_path']);
        }

        if (!empty($config['api_path'])) {
            $self->setApiPath($config['api_path']);
        }

        if (!empty($config['debug'])) {
            $self->setDebug($config['debug']);
        }

        if (!empty($config['auth'])) {
            $self->setAuth($config['auth']);
        }

        return $self;
    }
565174
public static function create(array $config = [])
    {
        if (!isset($config['driver'])) {
            throw new InvalidArgumentException("'driver' in config missing");
        }
        if (!isset($config['drivers'][$config['driver']])) {
            throw new InvalidArgumentException("driver '{$config['driver']}' is not configured");
        }
        if (!isset($config['drivers'][$config['driver']]['tagHeaderName'])) {
            throw new InvalidArgumentException("'tagHeaderName' is not configured");
        }

        $driverConfig = $config['drivers'][$config['driver']];
        $driverClass = $driverConfig['class'] ?? self::DRIVERS_NAMESPACE . '\\' . ucfirst($config['driver']);

        // tagHeaderName and tagHeaderDelimiter are not relevant to the Purger
        unset($driverConfig['tagHeaderName'], $driverConfig['tagHeaderDelimiter']);
        return \Craft::createObject($driverClass,[$driverConfig + ['useLocalTags' => $config['useLocalTags']]]);

    }
194801
protected function createSingleConnection($config)
    {
        $pdo = false;
        $connection = $this->createConnection($config['driver'], $pdo, $config['database'], $config['prefix'], $config);
        $connection->connect($config['host'], $config['username'], $config['password'], $config['database']);
        return $connection;
    }
857008
protected function createStackDriver(array $config)
    {
        $handlers = collect($config['channels'])->flatMap(function ($channel) {
            return $this->channel($channel)->getHandlers();
        })->all();

        if ($config['ignore_exceptions'] ?? false) {
            $handlers = [new WhatFailureGroupHandler($handlers)];
        }

        return new Monolog($this->parseChannel($config), $handlers);
    }
1361621
private function createDriver(array $config)
	{
		if (empty($config['driver'])) {
			throw new InvalidStateException('Undefined driver');
		} elseif ($config['driver'] instanceof IDriver) {
			return $config['driver'];
		} else {
			$name = ucfirst($config['driver']);
			$class = "Mva\\Dbm\\Driver\\{$name}\\{$name}Driver";
			return new $class;
		}
	}
117184
public function make(array $config): Facebook
    {
        $config = $this->getConfig($config);

        return $this->getClient($config);
    }
619016
protected function createDatabaseDriver(array $config)
	{
		$connection = $this->app['db']->connection(array_get($config, 'connection'));

		return $this->repository(
			new DatabaseStore(
				$connection, $this->app['encrypter'], $config['table'], $this->getPrefix($config)
			)
		);
	}
824576
public function createFtpDriver(array $config)
    {
        $ftpConfig = Arr::only($config, [
            'host', 'username', 'password', 'port', 'root', 'passive', 'ssl', 'timeout',
        ]);

        return $this->adapt($this->createFlysystem(
            new FtpAdapter($ftpConfig), $config
        ));
    }
789659
public static function getInstance(array $config = array(), DriverInterface $driver = null)
    {
        static $instance = null;

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

        if ($config) {
            $instance->config = $config;
        }

        if ($driver) {
            $instance->driver = $driver;
        }

        return $instance;
    }
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;
		};
	}
282566
protected function createFileSystem(array $config): FileSystem
    {
        if (! isset($config['adapter'])) {
            throw new RuntimeException('Filesystem adapter is undefined');
        }

        $adapters = [
            'local' => 'Local',
            'aliyun' => 'Aliyun',
        ];

        if (! isset($adapters[$config['adapter']])) {
            throw new RuntimeException(
                sprintf('Filesystem adapter "%s" is invalid', $config['adapter'])
            );
        }

        $adapter = $adapters[$config['adapter']];

        unset($adapters);

        return new FileSystem(
            $this->createAdapter($adapter, $config)
        );
    }
300607
protected function makeGoogleCloudAdapter(array $config)
    {
        $clientConfig = [
            'projectId' => $config['project_id'],
            'keyFilePath' => $config['key_file'],
        ];
        if (isset($config['auth_cache'])) {
            $clientConfig['authCache'] = $this->container->make($config['auth_cache']);
        }

        $client = $this->container->make('pubsub.gcloud.pub_sub_client', ['config' => $clientConfig]);

        $clientIdentifier = array_get($config, 'client_identifier');
        $autoCreateTopics = array_get($config, 'auto_create_topics', true);
        $autoCreateSubscriptions = array_get($config, 'auto_create_subscriptions', true);
        $backgroundBatching = array_get($config, 'background_batching', false);
        $backgroundDaemon = array_get($config, 'background_daemon', false);
        $maxMessages = array_get($config, 'max_messages', 1000);
        $returnImmediately = array_get($config, 'return_immediately', null);
        $returnImmediatelyPause = array_get($config, 'return_immediately_pause', null);

        if ($backgroundDaemon) {
            putenv('IS_BATCH_DAEMON_RUNNING=true');
        }

        return new GoogleCloudPubSubAdapter(
            $client,
            $clientIdentifier,
            $autoCreateTopics,
            $autoCreateSubscriptions,
            $backgroundBatching,
            $maxMessages,
            $returnImmediately,
            $returnImmediatelyPause
        );
    }
331163
public function createFactory($config)
    {
        $this->fileService->mkdir(dirname($config['_path_factory_']), 0777, true);

        if (!file_exists($config['_path_factory_'])) {
            $this->putIfNotExists($config['_path_factory_'], '<?php');
        }

        $factory = $this->fileService->get($config['template_source'].'/Factory.txt');

        $factory = $this->tableService->getTableSchema($config, $factory);

        foreach ($config as $key => $value) {
            $factory = str_replace($key, $value, $factory);
        }

        return $this->filesystem->append($config['_path_factory_'], $factory);
    }
9527
protected function createDailyDriver(array $config)
    {
        return new Monolog($this->parseChannel($config), [
            $this->prepareHandler(new RotatingFileHandler(
                $config['path'], $config['days'] ?? 7, $this->level($config),
                $config['bubble'] ?? true, $config['permission'] ?? null, $config['locking'] ?? false
            ), $config),
        ]);
    }
258725
protected function createApcDriver(array $config)
    {
        $prefix = $this->getPrefix($config);

        return $this->repository(new ApcStore(new ApcWrapper, $prefix));
    }
1288311
public function createFileSystem(array $config)
    {
        if (isset($config[FileUploadConstants::LOCAL_PATH]) === false) {
            throw new InvalidConfigException(FileUploadConstants::LOCAL_PATH);
        }

        $localFilesystem = new Local($config[FileUploadConstants::LOCAL_PATH]);
        $filesystem = new Filesystem($localFilesystem);

        return $filesystem;
    }