public function setConnectionInfo(array $connections)
    {

        foreach($connections as $connectionInfo)
        {
            if (empty($connectionInfo['hostname']))
                $connectionInfo['hostname'] = 'localhost';

            if (empty($connectionInfo['port']))
                $connectionInfo['port'] = 3306;

            if (empty($connectionInfo['timeout']))
                $connectionInfo['timeout'] = 30;

            if (empty($connectionInfo['database']))
                throw new DatabaseException("Database name is empty.");

            if (empty($connectionInfo['username']))
                throw new DatabaseException("Database username is empty.");

        }

         //if(empty($connectionInfo['password']))
         //    throw new DatabaseException("Database password is empty.");

        $this->connectionConfig = $connections;
    }
public function setConnectionInfo(array $connections)
    {

        foreach($connections as $connectionInfo)
        {
            if (empty($connectionInfo['hostname']))
                $connectionInfo['hostname'] = 'localhost';

            if (empty($connectionInfo['port']))
                $connectionInfo['port'] = 3306;

            if (empty($connectionInfo['timeout']))
                $connectionInfo['timeout'] = 30;

            if (empty($connectionInfo['database']))
                throw new DatabaseException("Database name is empty.");

            if (empty($connectionInfo['username']))
                throw new DatabaseException("Database username is empty.");

        }

         //if(empty($connectionInfo['password']))
         //    throw new DatabaseException("Database password is empty.");

        $this->connectionConfig = $connections;
    }
public function setConnectionInfo ( array $ connections ) { foreach ( $ connections as $ connectionInfo ) { if ( empty ( $ connectionInfo [ 'hostname' ] ) ) $ connectionInfo [ 'hostname' ] = 'localhost' ; if ( empty ( $ connectionInfo [ 'port' ] ) ) $ connectionInfo [ 'port' ] = 3306 ; if ( empty ( $ connectionInfo [ 'timeout' ] ) ) $ connectionInfo [ 'timeout' ] = 30 ; if ( empty ( $ connectionInfo [ 'database' ] ) ) throw new DatabaseException ( "Database name is empty." ) ; if ( empty ( $ connectionInfo [ 'username' ] ) ) throw new DatabaseException ( "Database username is empty." ) ; } //if(empty($connectionInfo['password'])) //    throw new DatabaseException("Database password is empty."); $ this -> connectionConfig = $ connections ; }
Validates required values are present for a database connection.

@param array $connectionInfo Connection info. See {@link __construct(...)} for details on keys and values.

@return void
@throws Exception If the required parameters aren't passed
Validates required values are present for a database connection .