diff options
| author | Damien Regad <dregad@mantisbt.org> | 2022-01-10 10:00:46 +0100 |
|---|---|---|
| committer | Damien Regad <dregad@mantisbt.org> | 2022-01-16 16:50:41 +0100 |
| commit | 1d079fff12b872f9267dc018f6be870cf5805666 (patch) | |
| tree | 4a1108b9dc8e756f54f4faed428b1c37d5a4bbc4 /drivers/adodb-postgres64.inc.php | |
| parent | b4d5ce70034c5aac3a1d51d317d93c037a0938d2 (diff) | |
| download | adodb-1d079fff12b872f9267dc018f6be870cf5805666.tar.gz adodb-1d079fff12b872f9267dc018f6be870cf5805666.tar.bz2 adodb-1d079fff12b872f9267dc018f6be870cf5805666.zip | |
PHPDoc and coding guidelines
Remove old, commented-out code
Diffstat (limited to 'drivers/adodb-postgres64.inc.php')
| -rw-r--r-- | drivers/adodb-postgres64.inc.php | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/drivers/adodb-postgres64.inc.php b/drivers/adodb-postgres64.inc.php index 2f2e4584..3f351f97 100644 --- a/drivers/adodb-postgres64.inc.php +++ b/drivers/adodb-postgres64.inc.php @@ -673,14 +673,26 @@ class ADODB_postgres64 extends ADOConnection{ return $indexes; } - // returns true or false - // - // examples: - // $db->Connect("host=host1 user=user1 password=secret port=4341"); - // $db->Connect('host1','user1','secret'); - function _connect($str,$user='',$pwd='',$db='',$ctype=0) + /** + * Connect to a database. + * + * Examples: + * $db->Connect("host=host1 user=user1 password=secret port=4341"); + * $db->Connect('host1:4341', 'user1', 'secret'); + * + * @param string $str pg_connect() Connection string or Hostname[:port] + * @param string $user (Optional) The username to connect as. + * @param string $pwd (Optional) The password to connect with. + * @param string $db (Optional) The name of the database to start in when connected. + * @param int $ctype Connection type + * @return bool|null True if connected successfully, false if connection failed, or + * null if the PostgreSQL extension is not loaded. + */ + function _connect($str, $user='', $pwd='', $db='', $ctype=0) { - if (!function_exists('pg_connect')) return null; + if (!function_exists('pg_connect')) { + return null; + } $this->_errorMsg = false; @@ -713,8 +725,6 @@ class ADODB_postgres64 extends ADOConnection{ } } - //if ($user) $linea = "user=$user host=$linea password=$pwd dbname=$db port=5432"; - if ($ctype === 1) { // persistent $this->_connectionID = pg_pconnect($str); } else { |
