Create the model.

@param array $config

@return bool
169471
public function createModel($config)
    {
        $repoParts = [
            '_path_model_',
        ];

        foreach ($repoParts as $repoPart) {
            $this->fileService->mkdir($config[$repoPart], 0777, true);
        }

        $model = $this->fileService->get($config['template_source'].'/Model.txt');
        $model = $this->modelService->configTheModel($config, $model);

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

        $model = $this->putIfNotExists($config['_path_model_'].'/'.$config['_camel_case_'].'.php', $model);

        return $model;
    }
899352
public static function createRedisByConfig(array $config) {
        $Redis = new Connection();
        $Redis->setHost(@$config['host'])
            ->setPort(@$config['port']);
        (isset($config['persistent']))      && $Redis->setPersistent($config['persistent']);
        (isset($config['connect_timeout'])) && $Redis->setConnectTimeout($config['connect_timeout']);
        (isset($config['connect_tries']))   && $Redis->setConnectTries($config['connect_tries']);
        return $Redis;
    }
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;
    }
1291547
public function connect(array $config)
    {
        $options = $this->getOptions($config);

        return $this->createConnection($this->getDsn($config), $config, $options);
    }
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;
    }
628638
public function set_config(array $config)
    {
        if (isset($config['convert_integers'])) {
            $this->config['convert_integers'] = (bool)$config['convert_integers'];
        }

        if (isset($config['typecast_objects'])) {
            $this->config['typecast_objects'] = (bool)$config['typecast_objects'];
        }

        return $this;
    }
557379
protected function createClient(array $config)
    {
        return tap(new Redis, function ($client) use ($config) {
            $this->establishConnection($client, $config);

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

            if (! empty($config['database'])) {
                $client->select($config['database']);
            }

            if (! empty($config['prefix'])) {
                $client->setOption(Redis::OPT_PREFIX, $config['prefix']);
            }

            if (! empty($config['read_timeout'])) {
                $client->setOption(Redis::OPT_READ_TIMEOUT, $config['read_timeout']);
            }
        });
    }
811805
public function create( $model, $config = [] ) {

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

		$modelClass = static::$modelClass;

		// Save Files
		$this->fileService->saveFiles( $model, [ 'avatarId' => $avatar ] );

		// Default Private
		$model->visibility = $model->visibility ?? $modelClass::VISIBILITY_PRIVATE;

		// Default New
		$model->status = $model->status ?? $modelClass::STATUS_NEW;

		// Create Model
		return parent::create( $model, $config );
	}
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);
    }
803405
public function factory($type, array $config)
    {
        $this->setFactoryCreationOptions($type, $config);

        return $this->get($type, $config, false);
    }
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);
    }
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']]]);

    }
117184
public function make(array $config): Facebook
    {
        $config = $this->getConfig($config);

        return $this->getClient($config);
    }
1211776
public function create(array $config = [])
    {
        if (null === $this->handler) {
            $this->handler = DefaultHandler::create();
        }

        return new Client(
            array_merge_recursive(
                [
                    'verify'  => false,
                    'handler' => $this->handler,
                ],
                $config
            )
        );
    }
791166
protected function createDatabaseDriver( array $config )
	{
		return new DatabaseStore( DatabaseManager::i()->connection( Arr::get( $config, 'connection' ) ), Encrypter::i(), $config['table'], $this->getPrefix( $config ) );
	}
109616
public static function create(array $config = [])
    {
        $config        = self::mergeDefaults($config);
        $metricFactory = new MetricFactory($config['default_tags'], $config['prefix']);
        $eventFactory  = new EventFactory($config['hostname']);
        $logger        = $config['logger']['instance'] instanceof LoggerInterface ? $config['logger']['instance'] : null;
        $debug         = $config['logger']['debug'];
        $monitor       = new Monitor($metricFactory, $eventFactory, $debug ? $logger : null);

        if (!empty($config['datadog']['metrics'])) {
            $monitor->pushMetricSender(DataDogMetrics::create($config['datadog']['host'], $config['datadog']['port']));
        }

        if (!empty($config['datadog']['events'])) {
            $monitor->pushEventSender(DataDogEvents::create($config['datadog']['host'], $config['datadog']['port']));
        }

        if ($logger && $config['logger']['metrics']) {
            $monitor->pushMetricSender(new PsrLoggerMetrics($logger), $config['logger']['level']);
        }

        if ($logger && $config['logger']['events']) {
            $monitor->pushEventSender(new PsrLoggerEvents($logger), $config['logger']['level']);
        }

        return $monitor;
    }
465499
public function createUser(array $config = [ ])
    {
        $result = $this->createUserInternal($config);
        $statusCode = (int)$result[ 'statusCode' ];
        
        if ($statusCode === 200) {
            return $this->getResultAsArrayWithoutStatusCode($result);
        }
        
        $this->reportUnexpectedResponse($result, 1490802526);
    }