From: <ru...@us...> - 2009-07-14 07:32:42
|
Revision: 7031 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7031&view=rev Author: rurban Date: 2009-07-14 07:32:41 +0000 (Tue, 14 Jul 2009) Log Message: ----------- Postgresql not yet binary safe, still need to use BYTEA hack. Modified Paths: -------------- trunk/lib/WikiDB/backend/PearDB_pgsql.php Modified: trunk/lib/WikiDB/backend/PearDB_pgsql.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB_pgsql.php 2009-07-14 07:29:48 UTC (rev 7030) +++ trunk/lib/WikiDB/backend/PearDB_pgsql.php 2009-07-14 07:32:41 UTC (rev 7031) @@ -5,8 +5,8 @@ require_once('lib/WikiDB/backend/PearDB.php'); if (!defined("USE_BYTEA")) // see schemas/psql-initialize.sql - //define("USE_BYTEA", true); - define("USE_BYTEA", false); + define("USE_BYTEA", true); + //define("USE_BYTEA", false); /* Since 1.3.12 changed to use: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-07-25 12:22:21
|
Revision: 8998 http://sourceforge.net/p/phpwiki/code/8998 Author: vargenau Date: 2014-07-25 12:22:14 +0000 (Fri, 25 Jul 2014) Log Message: ----------- Use parent::__construct Modified Paths: -------------- trunk/lib/WikiDB/backend/PearDB_pgsql.php Modified: trunk/lib/WikiDB/backend/PearDB_pgsql.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB_pgsql.php 2014-07-25 10:59:59 UTC (rev 8997) +++ trunk/lib/WikiDB/backend/PearDB_pgsql.php 2014-07-25 12:22:14 UTC (rev 8998) @@ -32,7 +32,7 @@ global $ErrorManager; $ErrorManager->pushErrorHandler(new WikiMethodCb($this, '_pgsql_open_error')); - $this->WikiDB_backend_PearDB($dbparams); + parent::__construct($dbparams); $ErrorManager->popErrorHandler(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-02-25 15:05:33
|
Revision: 9559 http://sourceforge.net/p/phpwiki/code/9559 Author: vargenau Date: 2015-02-25 15:05:31 +0000 (Wed, 25 Feb 2015) Log Message: ----------- Remove useless error handling code Modified Paths: -------------- trunk/lib/WikiDB/backend/PearDB_pgsql.php Modified: trunk/lib/WikiDB/backend/PearDB_pgsql.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB_pgsql.php 2015-02-25 15:02:48 UTC (rev 9558) +++ trunk/lib/WikiDB/backend/PearDB_pgsql.php 2015-02-25 15:05:31 UTC (rev 9559) @@ -5,7 +5,6 @@ if (!defined("USE_BYTEA")) // see schemas/psql-initialize.sql define("USE_BYTEA", true); -//define("USE_BYTEA", false); /* Since 1.3.12 changed to use: @@ -17,34 +16,6 @@ class WikiDB_backend_PearDB_pgsql extends WikiDB_backend_PearDB { - function __construct($dbparams) - { - // The pgsql handler of (at least my version of) the PEAR::DB - // library generates three warnings when a database is opened: - // - // Undefined index: options - // Undefined index: tty - // Undefined index: port - // - // This stuff is all just to catch and ignore these warnings, - // so that they don't get reported to the user. (They are - // not consequential.) - - global $ErrorManager; - $ErrorManager->pushErrorHandler(new WikiMethodCb($this, '_pgsql_open_error')); - parent::__construct($dbparams); - $ErrorManager->popErrorHandler(); - } - - function _pgsql_open_error($error) - { - if (preg_match('/^Undefined\s+index:\s+(options|tty|port)/', - $error->errstr) - ) - return true; // Ignore error - return false; - } - /** * Pack tables. * NOTE: Only the table owner can do this. Either fix the schema or setup autovacuum. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2015-03-09 10:08:45
|
Revision: 9621 http://sourceforge.net/p/phpwiki/code/9621 Author: vargenau Date: 2015-03-09 10:08:43 +0000 (Mon, 09 Mar 2015) Log Message: ----------- Remove todo functions Modified Paths: -------------- trunk/lib/WikiDB/backend/PearDB_pgsql.php Modified: trunk/lib/WikiDB/backend/PearDB_pgsql.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB_pgsql.php 2015-03-09 10:05:59 UTC (rev 9620) +++ trunk/lib/WikiDB/backend/PearDB_pgsql.php 2015-03-09 10:08:43 UTC (rev 9621) @@ -82,71 +82,6 @@ } /* - * Create a new revision of a page. - */ - function _todo_set_versiondata($pagename, $version, $data) - { - $dbh = &$this->_dbh; - $version_tbl = $this->_table_names['version_tbl']; - - $minor_edit = (int)!empty($data['is_minor_edit']); - unset($data['is_minor_edit']); - - $mtime = (int)$data['mtime']; - unset($data['mtime']); - assert(!empty($mtime)); - - @$content = (string)$data['%content']; - unset($data['%content']); - unset($data['%pagedata']); - - $this->lock(); - $id = $this->_get_pageid($pagename, true); - $dbh->query(sprintf("DELETE FROM version WHERE id=%d AND version=%d", $id, $version)); - $dbh->query(sprintf("INSERT INTO version (id,version,mtime,minor_edit,content,versiondata)" . - " VALUES (%d, %d, %d, %d, '%s', '%s')", - $id, $version, $mtime, $minor_edit, - $this->_quote($content), - $this->_serialize($data))); - // TODO: This function does not work yet - $dbh->query(sprintf("SELECT update_recent (%d, %d)", $id, $version)); - $this->unlock(); - } - - /* - * Delete an old revision of a page. - */ - function _todo_delete_versiondata($pagename, $version) - { - $dbh = &$this->_dbh; - // TODO: This function was removed - $dbh->query(sprintf("SELECT delete_versiondata (%d, %d)", $id, $version)); - } - - /* - * Rename page in the database. - */ - function _todo_rename_page($pagename, $to) - { - $dbh = &$this->_dbh; - extract($this->_table_names); - - $this->lock(); - if (($id = $this->_get_pageid($pagename, false))) { - if ($new = $this->_get_pageid($to, false)) { - // Cludge Alert! - // This page does not exist (already verified before), but exists in the page table. - // So we delete this page in one step. - $dbh->query("SELECT prepare_rename_page($id, $new)"); - } - $dbh->query(sprintf("UPDATE $page_tbl SET pagename='%s' WHERE id=$id", - $dbh->escapeSimple($to))); - } - $this->unlock(); - return $id; - } - - /* * Lock all tables we might use. */ protected function _lock_tables($write_lock = true) @@ -227,7 +162,6 @@ $callback = new WikiMethodCb($searchobj, "_pagename_match_clause"); $search_clause = $search->makeSqlClauseObj($callback); } - $sql = "SELECT $fields FROM $table" . " WHERE $join_clause" . " AND ($search_clause)" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |