From 1082ff77a4beb10339795d574db68696051da44e Mon Sep 17 00:00:00 2001 From: rurban Date: Thu, 4 Jan 2007 16:41:14 +0000 Subject: [PATCH] Allow missing connection permissions on upgrade::_try_dbadmin_user. git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@5381 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- lib/WikiDB/ADODB.php | 3 ++- lib/WikiDB/SQL.php | 3 ++- lib/WikiDB/backend/ADODB_postgres7.php | 3 ++- lib/WikiDB/backend/PearDB_mysql.php | 8 ++++++-- lib/WikiDB/backend/PearDB_oci8.php | 10 +++++++--- lib/prepend.php | 8 ++++++-- 6 files changed, 25 insertions(+), 10 deletions(-) diff --git a/lib/WikiDB/ADODB.php b/lib/WikiDB/ADODB.php index ad022aeea..e754c3d3e 100644 --- a/lib/WikiDB/ADODB.php +++ b/lib/WikiDB/ADODB.php @@ -1,5 +1,5 @@ _dbh->_connectionID) return false; $this->WikiDB($backend, $dbparams); } diff --git a/lib/WikiDB/SQL.php b/lib/WikiDB/SQL.php index 22d7621fc..0bacea902 100644 --- a/lib/WikiDB/SQL.php +++ b/lib/WikiDB/SQL.php @@ -1,4 +1,4 @@ -_dbh)) return; $this->WikiDB($backend, $dbparams); } diff --git a/lib/WikiDB/backend/ADODB_postgres7.php b/lib/WikiDB/backend/ADODB_postgres7.php index da87857c5..cc0cb1afc 100644 --- a/lib/WikiDB/backend/ADODB_postgres7.php +++ b/lib/WikiDB/backend/ADODB_postgres7.php @@ -1,5 +1,5 @@ WikiDB_backend_ADODB($dbparams); + if (!$this->_dbh->_connectionID) return; $this->_serverinfo = $this->_dbh->ServerInfo(); if (!empty($this->_serverinfo['version'])) { diff --git a/lib/WikiDB/backend/PearDB_mysql.php b/lib/WikiDB/backend/PearDB_mysql.php index 3307c31d2..ff2942297 100644 --- a/lib/WikiDB/backend/PearDB_mysql.php +++ b/lib/WikiDB/backend/PearDB_mysql.php @@ -1,5 +1,5 @@ WikiDB_backend_PearDB($dbparams); + if (DB::isError($this->_dbh)) return; //$this->_serverinfo = $this->_dbh->ServerInfo(); $row = $this->_dbh->GetOne("SELECT version()"); if (!DB::isError($row) and !empty($row)) { @@ -114,7 +115,7 @@ extends WikiDB_backend_PearDB } /* ISNULL is mysql specific */ - function wanted_pages($exclude_from='', $exclude='', $sortby=false, $limit=false) { + function wanted_pages($exclude_from='', $exclude='', $sortby='', $limit='') { $dbh = &$this->_dbh; extract($this->_table_names); if ($orderby = $this->sortby($sortby, 'db', array('pagename','wantedfrom'))) @@ -225,6 +226,9 @@ extends WikiDB_backend_PearDB_search } // $Log: not supported by cvs2svn $ +// Revision 1.26 2006/12/22 17:49:05 rurban +// add Log +// // (c-file-style: "gnu") // Local Variables: diff --git a/lib/WikiDB/backend/PearDB_oci8.php b/lib/WikiDB/backend/PearDB_oci8.php index ab389b5d9..f88080250 100644 --- a/lib/WikiDB/backend/PearDB_oci8.php +++ b/lib/WikiDB/backend/PearDB_oci8.php @@ -1,5 +1,5 @@ WikiDB_backend_PearDB($dbparams); - + if (DB::isError($this->_dbh)) return; + // Empty strings are NULLS $this->_expressions['notempty'] = "IS NOT NULL"; $this->_expressions['iscontent'] = "DECODE(DBMS_LOB.GETLENGTH(content), NULL, 0, 0, 0, 1)"; @@ -91,6 +92,9 @@ extends WikiDB_backend_PearDB_search } // $Log: not supported by cvs2svn $ +// Revision 1.12 2006/12/22 00:27:37 rurban +// just add Log +// // (c-file-style: "gnu") @@ -101,4 +105,4 @@ extends WikiDB_backend_PearDB_search // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: -?> \ No newline at end of file +?> diff --git a/lib/prepend.php b/lib/prepend.php index 7f2baa9c1..479b3d732 100644 --- a/lib/prepend.php +++ b/lib/prepend.php @@ -9,10 +9,10 @@ function rcs_id ($id) { if (defined('DEBUG') and DEBUG) $GLOBALS['RCS_IDS'] .= "$id\n"; } -rcs_id('$Id: prepend.php,v 1.59 2006-12-23 11:51:23 rurban Exp $'); +rcs_id('$Id: prepend.php,v 1.60 2007-01-04 16:41:14 rurban Exp $'); // see lib/stdlib.php: phpwiki_version() -define('PHPWIKI_VERSION', '1.3.13pre-20061222'); +define('PHPWIKI_VERSION', '1.3.13'); /** * Returns true if current php version is at mimimum a.b.c @@ -48,6 +48,10 @@ if (empty($GLOBALS['HTTP_SERVER_VARS'])) { $GLOBALS['HTTP_REQUEST_VARS'] =& $_REQUEST; } unset($k); +// catch connection failures on upgrade +if (isset($GLOBALS['HTTP_GET_VARS']['action']) + and $GLOBALS['HTTP_GET_VARS']['action'] == 'upgrade') + define('ADODB_ERROR_HANDLER_TYPE', E_USER_WARNING); // If your php was compiled with --enable-trans-sid it tries to // add a PHPSESSID query argument to all URL strings when cookie -- 2.45.0