Creates a new Schema instance for the current config type.

Reads the following configuration option: `ModuleConfig.schemaPath`.

@param mixed[] $config Schema config.
@return SchemaInterface Schema object.
356937
public function createSchema(array $config = []): SchemaInterface
    {
        $path = rtrim(Configure::read('ModuleConfig.schemaPath'), '/');
        $file = $this->configType . '.json';
        $schemaPath = implode(DIRECTORY_SEPARATOR, [$path, $file]);

        return new Schema($schemaPath, null, $config);
    }
1081956
public static function createFromConfig(array $config)
    {
        $fields = [];
        foreach ($config as $name => $field) {
            $fields[$name] = Fields::create($name, $field);
        }
        return new static($fields);
    }
396413
public function getSchemaTables(Schema $schema, Config $config)
    {
        if ($this->tableSchemas !== null) {
            return $this->tableSchemas;
        }

        /** @var $fieldManager FieldManager */
        $fieldManager = $config->getFields();
        $contentTypes = $this->getNormalisedContentTypes($config);
        $tables = [];

        foreach ($this->tables->keys() as $name) {
            $contentType = $contentTypes[$name];
            /** @var ContentType $table */
            $table = $this->tables[$name];
            $tables[$name] = $table->buildTable($schema, $name, $this->charset, $this->collate);
            if (isset($contentType['fields']) && is_array($contentType['fields'])) {
                $this->addContentTypeTableColumns($this->tables[$name], $tables[$name], $contentType['fields'], $fieldManager);
            }
        }

        return $this->tableSchemas = $tables;
    }
1291944
final public static function getInstance($config = array())
    {
        static $instance;

        if ($instance === NULL)
        {
            if(!$config instanceof KObjectConfig) {
                $config = new KObjectConfig($config);
            }

            $instance = new self($config);
        }

        return $instance;
    }
627025
public static function createWithConfig(array $config = []) {
        $plates = new self();

        $plates->register(new PlatesExtension());
        $plates->register(new Extension\Data\DataExtension());
        $plates->register(new Extension\Path\PathExtension());
        $plates->register(new Extension\RenderContext\RenderContextExtension());
        $plates->register(new Extension\LayoutSections\LayoutSectionsExtension());
        $plates->register(new Extension\Folders\FoldersExtension());

        $plates->addConfig($config);

        return $plates;
    }
449673
public static function getInstance($config = array())
    {
        static $instance;

        if ($instance === null) {
            if (!$config instanceof AnConfig) {
                $config = new AnConfig($config);
            }

            $instance = new self($config);
        }

        return $instance;
    }
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;
    }
1300250
public static function create($config = null)
    {
        if ($config === null) {
            return self::getStandard();
        }
        if (is_array($config) || ($config instanceof Config)) {
            return new Env($config);
        }
        if ($config instanceof Env) {
            return $config;
        }
        $message = 'Factory accepts Env, Config, array or NULL';
        throw new InvalidConfig('Env', $message, 0, null, __NAMESPACE__);
    }
260762
public static function factory($config = array())
    {
        $defaults = array(
            'session' => '',
        );

        $required = array(
            'base_url',
            'api_user',
            'api_key',
            'session',
        );

        // Instantiate the Acquia Search plugin.
        $config = Collection::fromConfig($config, $defaults, $required);
        return new static($config->get('base_url'), $config);
    }
22096
public static function instance($name = 'default', array $config = array())
    {
        if ( ! isset(self::$instances[$name])) {
            if (empty($config)) {
                // Load the configuration for this database
                $config = self::config($name);
            }

            self::$instances[$name] = new self($name, $config);
        }

        return self::$instances[$name];
    }
902227
public function createConnector( array $config )
	{
		if ( !isset( $config['driver'] ) )
			throw new InvalidArgumentException( 'A driver must be specified.' );

		switch ( $config['driver'] )
		{
			case 'mysql':
				return new MySqlConnector;
			case 'pgsql':
				return new PostgresConnector;
			case 'sqlite':
				return new SQLiteConnector;
			case 'sqlsrv':
				return new SqlServerConnector;
		}

		throw new InvalidArgumentException( "Unsupported driver [{$config['driver']}]" );
	}
680510
protected function createSingleConnection(array $config)
    {
        $pdo = $this->createPdoResolver($config);

        return $this->createConnection(
            $config['driver'], $pdo, $config['database'], $config['prefix'], $config
        );
    }
302578
protected function createSingleConnection(array $config)
    {
        $pdo = $this->createConnector($config)->connect($config);

        return $this->createConnection($config['driver'], $pdo, $config['database'], $config['prefix'], $config);
    }
788592
public function create(array $config)
    {
        $dashboard = new Dashboard();

        foreach ($config as $name => $cfg) {
            $widget = $this->widgetFactory->create($name, $cfg['type'], $cfg['options']);
            $dashboard->addWidget($widget);
        }

        return $dashboard;
    }
428828
public static function factory($config = array())
    {
        $defaults = array();

        $required = array(
            'base_url',
            'login',
            'password'
        );

        $config = Collection::fromConfig($config, $defaults, $required);

        $client = new self($config['base_url'], $config);

        return $client;
    }
1193688
public static function create(array $config)
    {
        if (\Tripod\Config::getConfig() !== $config) {
            \Tripod\Config::setConfig($config);
        }
        if (isset($config['class']) && class_exists($config['class'])) {
            $tripodConfig = call_user_func(array($config['class'], 'deserialize'), $config);
        } else {
            $tripodConfig = \Tripod\Mongo\Config::deserialize($config);
        }
        return $tripodConfig;
    }
508892
public function addConfig($config) {
        if (is_array($config)) {
            // array of paths to config files
            if (array_is_indexed($config)) {
                $this->addPaths($config);
            }
            // array of key value configs
            else {
                $this->addRuntimeConfig($config);
            }
        }
        // path to config file
        else if (is_string($config)) {
            $this->addPath($config);
        }
        // config object
        else if ($config instanceof IConfig) {
            $this->addRuntimeConfig($config);
        }

        return $this;
    }