Build configuration helper for a given class

@param string $databaseClass Name of class
@return DatabaseConfigurationHelper|null Instance of helper, or null if cannot be loaded
500407
public static function getDatabaseConfigurationHelper($databaseClass)
    {
        $adapters = static::get_adapters();
        if (empty($adapters[$databaseClass]) || empty($adapters[$databaseClass]['helperClass'])) {
            return null;
        }

        // Load if path given
        if (isset($adapters[$databaseClass]['helperPath'])) {
            include_once $adapters[$databaseClass]['helperPath'];
        }

        // Construct
        $class = $adapters[$databaseClass]['helperClass'];
        return (class_exists($class)) ? new $class() : null;
    }
352844
final public function set(string $id, string $class = null): ServiceConfigurator
    {
        $this->__destruct();

        return $this->parent->set($id, $class);
    }
832696
public function buildService($class)
    {
        $options = [
            'var_dir' => $this->configResolver->getParameter('var_dir'),
            'storage_dir' => $this->configResolver->getParameter('storage_dir'),
            'draft_images_dir' => $this->configResolver->getParameter('image.versioned_images_dir'),
            'published_images_dir' => $this->configResolver->getParameter('image.published_images_dir'),
        ];

        return new $class($this->publishedIOService, $this->draftIOService, $options);
    }
443122
protected function configuration($name)
	{
		$name = $name ?: $this->getDefaultConnection();

		// To get the database connection configuration, we will just pull each of the
		// connection configurations and get the configurations for the given name.
		// If the configuration doesn't exist, we'll throw an exception and bail.
		$connections = $this->prop['database.connections'];
		if (is_null($config = Arr::get($connections, $name)))
		{
			throw new InvalidArgumentException("Database [$name] not configured.");
		}

		return $config;
	}
416801
public static function make()
    {
        $class = str_replace(
            'DatabaseManager',
            ucfirst(config('database.default')).'Database',
            self::class
        );

        try {
            return new self(new $class());
        } catch (\Exception $e) {
            return new self(new MysqlDatabase());
        }
    }
1249410
protected function loadDatabase()
    {
        $this->hook->trigger(self::HOOK_INIT_DATABASE_BEFORE);

        $database = \Parable\DI\Container::get(\Parable\ORM\Database::class);
        $database->setConfig($this->config->get('parable.database'));

        $this->hook->trigger(self::HOOK_INIT_DATABASE_AFTER);
        return $this;
    }
660238
public function bootEloquent($config){
        try{
            $this->app->container->singleton('db',function(){
                return new DatabaseManager;
            });

            $this->app->db->addConnection($config['connections'][$config['default']]);
            $this->app->db->setAsGlobal();
            $this->app->db->bootEloquent();
        }catch(\Exception $e){
            throw $e;
        }
    }
787160
private function configureDatabase(array $config) {
        if (!isset($config['database']) || !isset($config['database']['adapter'])) {
            throw new InvalidArgumentException('Missing database adapter configuration for the image variations event listener', 500);
        }

        $config = $config['database'];

        if (is_callable($config['adapter'])) {
            $databaseAdapter = $config['adapter']();
        } else if (is_string($config['adapter'])) {
            $databaseAdapter = new $config['adapter'](isset($config['params']) ? $config['params'] : null);
        } else {
            $databaseAdapter = $config['adapter'];
        }

        if (!($databaseAdapter instanceof DatabaseInterface)) {
            throw new InvalidArgumentException('Invalid database adapter for the image variations event listener', 500);
        }

        $this->database = $databaseAdapter;
    }
683546
public function getDatabase(string $database): DatabasePartial
    {
        if (!$this->hasDatabase($database)) {
            throw new ConfigException("Undefined database `{$database}`.");
        }

        $config = $this->config['databases'][$database];

        return new DatabasePartial(
            $database,
            $config['tablePrefix'] ?? $config['prefix'] ?? '',
            $config['connection'] ?? $config['write'] ?? $config['driver'],
            $config['readConnection'] ?? $config['read'] ?? $config['readDriver'] ?? null
        );
    }
675334
protected function getDatabaseClass($databaseClasses)
    {
        $envDatabase = Environment::getEnv('SS_DATABASE_CLASS');
        if ($envDatabase) {
            return $envDatabase;
        }

        // Check supported versions
        foreach ($this->preferredDatabases as $candidate) {
            if (!empty($databaseClasses[$candidate]['supported'])) {
                return $candidate;
            }
        }
        return null;
    }
150770
public static function connectDb() {
        if 
            (!isset(self::$dbLink)) {
            $dbParams = self::getDatabaseParameters();
            self::validateDbParameters($dbParams);
            $dbParamsSan = self::sanitizeDbParameters($dbParams);
            $config = new Configuration();
            self::$dbLink = DriverManager::getConnection($dbParamsSan, $config);
        }
        
        return self::$dbLink;
    }
601660
public function getBackupInstance($database = null)
	{
		$configuration = array_merge($this->getConfig('database'), $this->getConfig('backup::config'));
		$this->backupInstance = $this->backupFactory->build($configuration, $database);

		return $this->backupInstance;
	}
1169295
public function getConfigurator($configuratorClass)
    {
        if (!array_key_exists($configuratorClass, $this->configurators)) {
            throw new ConfiguratorNotFound($configuratorClass);
        }

        return $this->configurators[$configuratorClass];
    }
737658
public static function createDatabaseObject($dbConfig = null)
    {
        $dbConfig = self::getDatabaseConfig($dbConfig);

        $db = @Adapter::factory($dbConfig['adapter'], $dbConfig);

        self::$connection = $db;
    }
71130
public static function makeDB(\Native5\Core\Database\DBConfig $configuration)
    {
        if (empty($configuration))
            throw new \Exception('Empty connection settings provided'); 

        $port = $configuration->getPort();
        $port = !empty($port) ? $port : 3306;
        $dsn = $configuration->getType().':host='.$configuration->getHost().';port='.$port.';dbname='.$configuration->getName();
        $dbKey = md5($dsn.'.'.$configuration->getUser());

        if (isset(self::$_dbs[$dbKey]) && !empty(self::$_dbs[$dbKey]) && self::$_dbs[$dbKey]->checkConnection())
            return self::$_dbs[$dbKey];

        // Create a DB Instance for this user + database combination
        return (self::$_dbs[$dbKey] = new \Native5\Core\Database\DB($configuration));
    }
718402
@Override
   public <C extends ConnectionFactoryConfigurationBuilder<?>> C connectionFactory(Class<C> klass) {
      if (connectionFactory != null) {
         throw new IllegalStateException("A ConnectionFactory has already been configured for this store");
      }
      try {
         Constructor<C> constructor = klass.getDeclaredConstructor(AbstractJdbcStoreConfigurationBuilder.class);
         C builder = constructor.newInstance(this);
         this.connectionFactory = (ConnectionFactoryConfigurationBuilder<ConnectionFactoryConfiguration>) builder;
         return builder;
      } catch (Exception e) {
         throw new CacheConfigurationException("Could not instantiate loader configuration builder '" + klass.getName() + "'", e);
      }
   }
1228715
public function build(): GetDatabaseTableNamesRequest
	{
		$instance = new GetDatabaseTableNamesRequest();
		if ($this->databaseId === null) {
			throw new BuilderException('Property [databaseId] is required.');
		}
		$instance->databaseId = $this->databaseId;
		return $instance;
	}