src/Textpattern/Composer/Installer/Textpattern/Validate.php
public function hasDatabase()
    {
        try {
            $pdo = new \PDO(
                'mysql:host='.$this->txpcfg['host'].';dbname='.$this->txpcfg['db'],
                $this->txpcfg['user'],
                $this->txpcfg['pass']
            );
        } catch (\PDOException $e) {
            $pdo = false;
        }

        if ($pdo === false) {
            throw new \InvalidArgumentException(
                'Unable connect to Textpattern database: '.$this->txpcfg['db'].'@'.$this->txpcfg['host']
            );
        }

        if (!$pdo->prepare('SHOW TABLES LIKE ?')->execute(array($this->txpcfg['table_prefix'] . 'textpattern'))) {
            throw new \InvalidArgumentException('Textpattern is not installed');
        }
    }
public function hasDatabase()
    {
        try {
            $pdo = new \PDO(
                'mysql:host='.$this->txpcfg['host'].';dbname='.$this->txpcfg['db'],
                $this->txpcfg['user'],
                $this->txpcfg['pass']
            );
        } catch (\PDOException $e) {
            $pdo = false;
        }

        if ($pdo === false) {
            throw new \InvalidArgumentException(
                'Unable connect to Textpattern database: '.$this->txpcfg['db'].'@'.$this->txpcfg['host']
            );
        }

        if (!$pdo->prepare('SHOW TABLES LIKE ?')->execute(array($this->txpcfg['table_prefix'] . 'textpattern'))) {
            throw new \InvalidArgumentException('Textpattern is not installed');
        }
    }
public function hasDatabase ( ) { try { $ pdo = new \ PDO ( 'mysql:host=' . $ this -> txpcfg [ 'host' ] . ';dbname=' . $ this -> txpcfg [ 'db' ] , $ this -> txpcfg [ 'user' ] , $ this -> txpcfg [ 'pass' ] ) ; } catch ( \ PDOException $ e ) { $ pdo = false ; } if ( $ pdo === false ) { throw new \ InvalidArgumentException ( 'Unable connect to Textpattern database: ' . $ this -> txpcfg [ 'db' ] . '@' . $ this -> txpcfg [ 'host' ] ) ; } if ( ! $ pdo -> prepare ( 'SHOW TABLES LIKE ?' ) -> execute ( array ( $ this -> txpcfg [ 'table_prefix' ] . 'textpattern' ) ) ) { throw new \ InvalidArgumentException ( 'Textpattern is not installed' ) ; } }
Checks if the database exists.

@throws \InvalidArgumentException
Checks if the database exists .