Esempio n. 1
0
 /**
  * Create connection.
  *
  * @param string $host  database host (e.g. db.example.com)
  * @param string $user  database username
  * @param string $passwd  database password for user
  * @param string $db_name  database name
  * @param int $port  port number
  */
 function __construct($host, $user, $passwd, $db_name, $port = null)
 {
     parent::__construct("mysql:host={$host};dbname={$db_name}" . (!is_null($port) ? ";port={$port}" : ''), $user, $passwd);
 }
Esempio n. 2
0
 /**
  * Create Sqlite connection.
  *
  * @param string $file  filename
  * @param int $mode   mode
  */
 function __construct($file, $mode = 0666)
 {
     parent::__construct("sqlite:{$file}");
 }
Esempio n. 3
0
 /**
  * Create connection.
  *
  * @param string $host  database host (e.g. db.example.com)
  * @param string $user  database username
  * @param string $passwd  database password for user
  * @param string $db_name  database name
  * @param int $port  port number
  */
 function __construct($host, $user, $passwd, $db_name, $port = null)
 {
     parent::__construct("pgsql:host={$host};dbname={$db_name}" . (!is_null($port) ? ";port={$port}" : '') . ";user={$user};password={$passwd}");
 }