/** * 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); }
/** * Create Sqlite connection. * * @param string $file filename * @param int $mode mode */ function __construct($file, $mode = 0666) { parent::__construct("sqlite:{$file}"); }
/** * 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}"); }