/**
  * @test
  *
  * this will fail if mariadb is used because of library inconsistencies
  */
 public function connectToARealDatabaseWithTheMysqliAdapter()
 {
     try {
         $con = new MySQLConnection($this->generateMysqlSettings(), MySQLConnection::CONNECTION_MYSQLI);
     } catch (\Exception $e) {
         $this->fail($e->getMessage());
     }
     $this->assertTrue($con->isConnected());
 }
Пример #2
0
 /**
  * connects to the db based on the mysql Connection
  *
  * @param MySQLConnection $connection
  *
  * @throws DatabaseException|\Exception
  *
  * @return bool
  */
 public function connect(MySQLConnection $connection)
 {
     try {
         // if no connection to master and slave is possible
         if (!$connection->isConnected()) {
             throw new DatabaseException(__METHOD__ . "\nConnection failure no ressource given", self::NO_RESSOURCE, self::SEVERITY_LOG, __FILE__, __LINE__);
         }
         // get the mysql (only master) server details
         if ($this->_get_detail === true) {
             $this->db_detail = $this->getDatabaseDetail($this);
         }
     } catch (DatabaseException $ed) {
         throw $ed;
     }
     if (!$this->db) {
         $this->db = $connection;
     }
     return true;
 }