public function checkConnectDb($path = null, $returnBool = false) {
		$connections = $this->getListDbConn($path);
		if (empty($connections)) {
			return null;
		}

		$cfgConnections = $this->_modelConfigInstaller->getListDbConnConfigs();
		if (empty($cfgConnections)) {
			return null;
		}

		$connections = array_intersect($connections, $cfgConnections);
		$notCfgConnections = array_diff($cfgConnections, $connections);
		$result = [];
		$resultBool = true;
		foreach ($connections as $connectionName) {
			try {
				//@codingStandardsIgnoreStart
				$ds = @ConnectionManager::getDataSource($connectionName);
				//@codingStandardsIgnoreEnd
				$checkResult = $ds->isConnected();
			} catch (Exception $exception) {
				$checkResult = [$exception->getMessage()];
				$attributes = $exception->getAttributes();
				if (isset($attributes['message'])) {
					$checkResult[] = $attributes['message'];
				}
				$resultBool = false;
			}
			if (!$checkResult) {
				$resultBool = false;
			}
			$result[$connectionName] = $checkResult;
		}
		foreach ($notCfgConnections as $connectionName) {
			$result[$connectionName] = false;
			$resultBool = false;
		}
		if ($returnBool) {
			return $resultBool;
		}

		return $result;
	}
public function checkConnectDb($path = null, $returnBool = false) {
		$connections = $this->getListDbConn($path);
		if (empty($connections)) {
			return null;
		}

		$cfgConnections = $this->_modelConfigInstaller->getListDbConnConfigs();
		if (empty($cfgConnections)) {
			return null;
		}

		$connections = array_intersect($connections, $cfgConnections);
		$notCfgConnections = array_diff($cfgConnections, $connections);
		$result = [];
		$resultBool = true;
		foreach ($connections as $connectionName) {
			try {
				//@codingStandardsIgnoreStart
				$ds = @ConnectionManager::getDataSource($connectionName);
				//@codingStandardsIgnoreEnd
				$checkResult = $ds->isConnected();
			} catch (Exception $exception) {
				$checkResult = [$exception->getMessage()];
				$attributes = $exception->getAttributes();
				if (isset($attributes['message'])) {
					$checkResult[] = $attributes['message'];
				}
				$resultBool = false;
			}
			if (!$checkResult) {
				$resultBool = false;
			}
			$result[$connectionName] = $checkResult;
		}
		foreach ($notCfgConnections as $connectionName) {
			$result[$connectionName] = false;
			$resultBool = false;
		}
		if ($returnBool) {
			return $resultBool;
		}

		return $result;
	}
public function checkConnectDb ( $ path = null , $ returnBool = false ) { $ connections = $ this -> getListDbConn ( $ path ) ; if ( empty ( $ connections ) ) { return null ; } $ cfgConnections = $ this -> _modelConfigInstaller -> getListDbConnConfigs ( ) ; if ( empty ( $ cfgConnections ) ) { return null ; } $ connections = array_intersect ( $ connections , $ cfgConnections ) ; $ notCfgConnections = array_diff ( $ cfgConnections , $ connections ) ; $ result = [ ] ; $ resultBool = true ; foreach ( $ connections as $ connectionName ) { try { //@codingStandardsIgnoreStart $ ds = @ ConnectionManager :: getDataSource ( $ connectionName ) ; //@codingStandardsIgnoreEnd $ checkResult = $ ds -> isConnected ( ) ; } catch ( Exception $ exception ) { $ checkResult = [ $ exception -> getMessage ( ) ] ; $ attributes = $ exception -> getAttributes ( ) ; if ( isset ( $ attributes [ 'message' ] ) ) { $ checkResult [ ] = $ attributes [ 'message' ] ; } $ resultBool = false ; } if ( ! $ checkResult ) { $ resultBool = false ; } $ result [ $ connectionName ] = $ checkResult ; } foreach ( $ notCfgConnections as $ connectionName ) { $ result [ $ connectionName ] = false ; $ resultBool = false ; } if ( $ returnBool ) { return $ resultBool ; } return $ result ; }
Check connections to database

@param string $path Path to database connection configuration file.
@param bool $returnBool If True, return boolean. Otherwise,
return array otherwise in format:
- key - database connection name;
- value - True, if connection success. Otherwise False or Array or
error messages.
@return null|bool|array Return Null, if checking is not configured.
Check connections to database