Return false if the database connection has not been configured in the eShop configuration file.

@param ConfigFile $config

@return bool
964106
protected function isDatabaseConfigured(\OxidEsales\Eshop\Core\ConfigFile $config)
    {
        $isValid = true;

        // If the shop has not been configured yet the hostname has the format '<dbHost>'
        if (false  !== strpos($config->getVar('dbHost'), '<')) {
            $isValid = false;
        }

        return $isValid;
    }
34619
public function check(array $config): bool
    {
        try {
            if (Arr::get($config, 'default_connection', true)) {
                if (!$this->testConnection()) {
                    $this->message = trans('self-diagnosis::checks.redis_can_be_accessed.message.default_cache');
                    return false;
                }
            }

            foreach (Arr::get($config, 'connections', []) as $connection) {
                if (!$this->testConnection($connection)) {
                    $this->message = trans('self-diagnosis::checks.redis_can_be_accessed.message.named_cache', [
                        'name' => $connection,
                    ]);
                    return false;
                }
            }
        } catch (\Exception $e) {
            $this->message = $e->getMessage();
            return false;
        }

        return true;
    }
1041236
protected function checkConfig($config)
    {
        $required_fields = ['namespace', 'table', 'path', 'mapping', 'import_keys'];

        foreach ($required_fields as $key) {
            if (!array_has($config, $key)) {
                $this->error(sprintf('Missing \'%s\' from the dataset configuration file.', $key));
                $this->line('');
                $this->line('');

                exit(1);
            }
        }
    }
161003
private static function isLoggingConfigured($wurflConfig)
    {
        if (is_null($wurflConfig)) {
            return false;
        }
        return !is_null($wurflConfig->logDir) && is_writable($wurflConfig->logDir);
    }
187027
public function init(array $config = [])
    {
        if (!extension_loaded('redis')) {
            return false;
        }

        if (!empty($config['host'])) {
            $config['server'] = $config['host'];
        }

        parent::init($config);

        return $this->_connect();
    }
155
public function save($config)
    {
        if (!file_put_contents($this->filename, Yaml::dump($config))) {
            return false;
        }
        return true;
    }
30522
public function connect(array $config)
    {
        $port = (isset($config['port'])) ? (int) $config['port'] : 21; //端口号
        $this->linkid = ftp_connect($config['service'], $port);
        if (!$this->linkid) {
            return false;
        }
        @ftp_set_option($this->linkid, FTP_TIMEOUT_SEC, $this->timeout);
        if (@!ftp_login($this->linkid, $config['username'], $config['password'])) {
            return false;
        }

        return true;
    }
558032
protected function getConfigFilename($configFile)
    {
        foreach ($this->configDirectories as $configDirectory) {
            $configPathname = sprintf('%s/%s', $configDirectory, $configFile);
            if (file_exists($configPathname)) {
                return $configPathname;
            }
        }

        return null;
    }
684428
protected function _remove($config)
    {
        if ($config['namespaced'] && !is_dir($config['destDir'])) {
            $this->verbose(
                $config['destDir'] . $config['link'] . ' does not exist',
                1
            );

            return false;
        }

        $dest = $config['destDir'] . $config['link'];

        if (!file_exists($dest)) {
            $this->verbose(
                $dest . ' does not exist',
                1
            );

            return false;
        }

        if (is_link($dest)) {
            // @codingStandardsIgnoreLine
            if (@unlink($dest)) {
                $this->out('Unlinked ' . $dest);

                return true;
            } else {
                $this->err('Failed to unlink  ' . $dest);

                return false;
            }
        }

        $folder = new Folder($dest);
        if ($folder->delete()) {
            $this->out('Deleted ' . $dest);

            return true;
        } else {
            $this->err('Failed to delete ' . $dest);

            return false;
        }
    }
1292616
public function connect( $config )
    {
        if ( $config !== NULL )
        {
            if ( NULL === $config[ 'db_name' ] || '' === $config[ 'db_name' ] )
            {
                throw new DatabaseException( 'Invalid database name.' );
            }

            $this->name = $config[ 'db_name' ];

            try
            {
                $dns = "sqlite:" . $this->name;

                $this->database = new PDO( $dns );

            }
            catch ( Exception $e )
            {
                throw new DatabaseException( $e->getMessage() );
            }
        }
    }
291953
public function config($config = null)
    {
        if (is_array($config)) {
            $this->_config = $config;
        } elseif (is_string($config)) {
            if (!empty($this->_config[$config])) {
                return $this->_config[$config];
            }

            return false;
        }

        return $this->_config;
    }
1325850
final protected function hasConfigs($config = null)
    {
        if (null !== $config) {
            return array_key_exists($config, self::$_configs);
        }

        return count(self::$_configs) > 0;
    }
1022632
public function check(array $config): bool
    {
        try {
            return $this->filesystem->isDirectory(public_path('storage'));
        } catch (\Exception $e) {
            return false;
        }
    }
104247
protected function preloadConfiguration($configFile)
    {
        try {
            Configuration::config($configFile);
        } catch (ConfigurationException $e) {
            if ($e->getCode() == 404) {
                throw new ConfigurationException("Your configuration file `{$configFile}` could not be found.", 405);
            }
            throw $e;
        }
    }
1163903
public function has(string $key): bool
    {
        if (!is_array($this->data)) {
            throw new ConfigException('Unable to get config data when config wasn\'t loaded for config name=' . $this->name);
        }

        return array_key_exists($key, $this->data);
    }
448342
protected function _connection(array $config)
    {
        $redis = new \Redis;
        $host = empty($config['host']) ? self::DEFAULT_HOST : $config['host'];
        $port = empty($config['port']) ? self::DEFAULT_PORT : $config['port'];
        $timeout = empty($config['timeout']) ? self::DEFAULT_TIMEOUT : $config['timeout'];
        $connect = empty($config['persistent']) ? 'connect' : 'pconnect';
        $redis->$connect($host, $port, $timeout);
        return $redis;
    }
141999
public function isGoodFile(Config $source) {
		$info = pathinfo($this->path);

		if (!isset($info['extension']) or (!in_array(strtolower($info['extension']), $source->extensions))) {
			return false;
		}

		if (in_array(strtolower($info['extension']), $source->imageExtensions) and !$this->isImage()) {
			return false;
		}

		return true;
	}