src/Monashee/Backup/Database.php
private function checkMysqlConnection() {
        $this->connection = new \mysqli(
            $this->config->get('backup::config')['BACKUP_MYSQL_HOST'],
            $this->config->get('backup::config')['BACKUP_MYSQL_USER'],
            $this->config->get('backup::config')['BACKUP_MYSQL_PASSWORD']);

        if ($this->connection->connect_errno) {
            $this->event->fire('MonasheeBackupError', 'No database connection');

            throw new \Exception('Error connecting to MySQL');
        }

        echo 'Connected: '.$this->connection->host_info."\n";
        echo 'Server info: '.$this->connection->get_server_info()."\n";

        return true;
    }
private function checkMysqlConnection() {
        $this->connection = new \mysqli(
            $this->config->get('backup::config')['BACKUP_MYSQL_HOST'],
            $this->config->get('backup::config')['BACKUP_MYSQL_USER'],
            $this->config->get('backup::config')['BACKUP_MYSQL_PASSWORD']);

        if ($this->connection->connect_errno) {
            $this->event->fire('MonasheeBackupError', 'No database connection');

            throw new \Exception('Error connecting to MySQL');
        }

        echo 'Connected: '.$this->connection->host_info."\n";
        echo 'Server info: '.$this->connection->get_server_info()."\n";

        return true;
    }
private function checkMysqlConnection ( ) { $ this -> connection = new \ mysqli ( $ this -> config -> get ( 'backup::config' ) [ 'BACKUP_MYSQL_HOST' ] , $ this -> config -> get ( 'backup::config' ) [ 'BACKUP_MYSQL_USER' ] , $ this -> config -> get ( 'backup::config' ) [ 'BACKUP_MYSQL_PASSWORD' ] ) ; if ( $ this -> connection -> connect_errno ) { $ this -> event -> fire ( 'MonasheeBackupError' , 'No database connection' ) ; throw new \ Exception ( 'Error connecting to MySQL' ) ; } echo 'Connected: ' . $ this -> connection -> host_info . "\n" ; echo 'Server info: ' . $ this -> connection -> get_server_info ( ) . "\n" ; return true ; }
Check MySQL Connection

@return bool
@throws \Exception
Check MySQL Connection