src/Controller/Component/SetupComponent.php
public function databaseConnection($dataSource = 'default')
    {
        try {
            $connection = ConnectionManager::get($dataSource);
            $connected = $connection->connect();
        } catch (MissingConnectionException $connectionError) {
            $connected = false;
        }
        return $connected;
    }
public function databaseConnection($dataSource = 'default')
    {
        try {
            $connection = ConnectionManager::get($dataSource);
            $connected = $connection->connect();
        } catch (MissingConnectionException $connectionError) {
            $connected = false;
        }
        return $connected;
    }
public function databaseConnection ( $ dataSource = 'default' ) { try { $ connection = ConnectionManager :: get ( $ dataSource ) ; $ connected = $ connection -> connect ( ) ; } catch ( MissingConnectionException $ connectionError ) { $ connected = false ; } return $ connected ; }
Test database connection.

@param type $dataSource name of data source.
@return bool True if we're able to connect to the database
Test database connection .