[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] phpgwapi/inc class.db_pgsql.inc.php, 1.30.2.1.2.4, 1
From: |
Dave Hall <address@hidden> |
Subject: |
[Phpgroupware-cvs] phpgwapi/inc class.db_pgsql.inc.php, 1.30.2.1.2.4, 1.30.2.1.2.5 |
Date: |
Fri, 10 Oct 2003 05:43:28 +0000 |
Update of /cvsroot/phpgroupware/phpgwapi/inc
In directory subversions:/tmp/cvs-serv32499
Modified Files:
Tag: Version-0_9_16-branch
class.db_pgsql.inc.php
Log Message:
db create fix from bjohnson
Index: class.db_pgsql.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.db_pgsql.inc.php,v
retrieving revision 1.30.2.1.2.4
retrieving revision 1.30.2.1.2.5
diff -C2 -d -r1.30.2.1.2.4 -r1.30.2.1.2.5
*** class.db_pgsql.inc.php 8 Sep 2003 01:27:44 -0000 1.30.2.1.2.4
--- class.db_pgsql.inc.php 10 Oct 2003 05:43:24 -0000 1.30.2.1.2.5
***************
*** 67,75 ****
if
($GLOBALS['phpgw_info']['server']['db_persistent'])
{
! $this->Link_ID=pg_pconnect($cstr);
}
else
{
! $this->Link_ID=pg_connect($cstr);
}
--- 67,75 ----
if
($GLOBALS['phpgw_info']['server']['db_persistent'])
{
! $this->address@hidden($cstr);
}
else
{
! $this->address@hidden($cstr);
}
***************
*** 77,80 ****
--- 77,81 ----
{
$this->halt('Link-ID == false,
'.($GLOBALS['phpgw_info']['server']['db_persistent']?'p':'').'connect failed');
+ return 0;
}
else
***************
*** 88,91 ****
--- 89,93 ----
}
}
+ return $this->Link_ID;
}
***************
*** 154,172 ****
return 0;
}
!
! $this->connect();
!
! /* printf("<br>Debug: query = %s<br>\n",
$Query_String); */
$this->Query_ID = @pg_Exec($this->Link_ID,
$Query_String);
$this->Row = 0;
! $this->Error = pg_ErrorMessage($this->Link_ID);
$this->Errno = ($this->Error == '') ? 0 : 1;
if (! $this->Query_ID)
{
$this->halt('Invalid SQL: ' . $Query_String,
$line, $file);
}
!
return $this->Query_ID;
}
--- 156,185 ----
return 0;
}
! if (!$this->connect())
! {
! return 0; /* we already complained in connect()
about that. */
! };
! # New query, discard previous result.
! if ($this->Query_ID)
! {
! $this->free();
! }
!
! if ($this->Debug)
! {
! printf("Debug: query = %s<br>\n",
$Query_String);
! }
$this->Query_ID = @pg_Exec($this->Link_ID,
$Query_String);
$this->Row = 0;
! $this->Error = @pg_ErrorMessage($this->Link_ID);
$this->Errno = ($this->Error == '') ? 0 : 1;
if (! $this->Query_ID)
{
$this->halt('Invalid SQL: ' . $Query_String,
$line, $file);
+ return 0;
}
! # Will return nada if it fails. That's fine.
return $this->Query_ID;
}
***************
*** 206,211 ****
$this->Record = @pg_fetch_array($this->Query_ID,
$this->Row++);
! $this->Error = pg_ErrorMessage($this->Link_ID);
! $this->Errno = ($this->Error == '') ? 0 : 1;
$stat = is_array($this->Record);
--- 219,227 ----
$this->Record = @pg_fetch_array($this->Query_ID,
$this->Row++);
! if ($this->Link_ID)
! {
! $this->Error = pg_ErrorMessage($this->Link_ID);
! $this->Errno = ($this->Error == '') ? 0 : 1;
! }
$stat = is_array($this->Record);
***************
*** 242,246 ****
function transaction_abort()
{
! return pg_Exec($this->Link_ID,'rollback');
}
--- 258,262 ----
function transaction_abort()
{
! return @pg_Exec($this->Link_ID,'rollback');
}
***************
*** 394,400 ****
function halt($msg, $line = '', $file = '')
! {
if ($this->Halt_On_Error == 'no')
{
return;
}
--- 410,419 ----
function halt($msg, $line = '', $file = '')
! {
! /* private: error handling */
if ($this->Halt_On_Error == 'no')
{
+ $this->Error = @pg_ErrorMessage($this->Link_ID);
+ $this->Errno = 1;
return;
}
***************
*** 501,506 ****
$this->User = $adminname;
$this->Password = $adminpasswd;
}
!
if (! $this->Host)
{
--- 520,530 ----
$this->User = $adminname;
$this->Password = $adminpasswd;
+ $this->Database = 'template1';
}
!
! /*
! This doesn't work if the httpd server user doesn't have
execute permissions on the createdb program
! */
! /*
if (! $this->Host)
{
***************
*** 514,521 ****
if($outval != 0)
{
! /* either the rights r not available or the
postmaster is not running .... */
echo 'database creation failure <BR>';
echo 'please setup the postreSQL database
manually<BR>';
! }
$this->User = $currentUser;
--- 538,548 ----
if($outval != 0)
{
! // either the rights are not available or the
postmaster is not running ....
echo 'database creation failure <BR>';
echo 'please setup the postreSQL database
manually<BR>';
! }*/
!
! $this->query("CREATE DATABASE $currentDatabase");
! $this->query("grant all on $currentDatabase.* to
address@hidden identified by '$currentPassword'");
$this->User = $currentUser;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] phpgwapi/inc class.db_pgsql.inc.php, 1.30.2.1.2.4, 1.30.2.1.2.5,
Dave Hall <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] notes/inc class.bo.inc.php, 1.2.2.1.2.2, 1.2.2.1.2.3 class.so.inc.php, 1.2.4.3, 1.2.4.4 hook_deleteaccount.inc.php, 1.1, 1.1.4.1
- Next by Date:
[Phpgroupware-cvs] img index.old.php,NONE,1.1.2.1
- Previous by thread:
[Phpgroupware-cvs] notes/inc class.bo.inc.php, 1.2.2.1.2.2, 1.2.2.1.2.3 class.so.inc.php, 1.2.4.3, 1.2.4.4 hook_deleteaccount.inc.php, 1.1, 1.1.4.1
- Next by thread:
[Phpgroupware-cvs] img index.old.php,NONE,1.1.2.1
- Index(es):