From: <var...@us...> - 2015-03-03 15:39:40
|
Revision: 9591 http://sourceforge.net/p/phpwiki/code/9591 Author: vargenau Date: 2015-03-03 15:39:31 +0000 (Tue, 03 Mar 2015) Log Message: ----------- fix prototype for _lock_tables and _unlock_tables; PHP Doc Modified Paths: -------------- trunk/lib/WikiDB/ADODB.php trunk/lib/WikiDB/PDO.php trunk/lib/WikiDB/SQL.php trunk/lib/WikiDB/backend/ADODB.php trunk/lib/WikiDB/backend/ADODB_mssql.php trunk/lib/WikiDB/backend/ADODB_mssqlnative.php trunk/lib/WikiDB/backend/ADODB_mysql.php trunk/lib/WikiDB/backend/ADODB_oci8po.php trunk/lib/WikiDB/backend/ADODB_postgres7.php trunk/lib/WikiDB/backend/PDO.php trunk/lib/WikiDB/backend/PDO_oci8.php trunk/lib/WikiDB/backend/PearDB.php trunk/lib/WikiDB/backend/PearDB_ffpgsql.php trunk/lib/WikiDB/backend/PearDB_mysql.php trunk/lib/WikiDB/backend/PearDB_oci8.php trunk/lib/WikiDB/backend/PearDB_pgsql.php trunk/lib/WikiDB/backend/PearDB_sqlite.php trunk/lib/WikiDB/backend/file.php trunk/lib/WikiDB/backend/flatfile.php trunk/lib/WikiDB/backend.php Modified: trunk/lib/WikiDB/ADODB.php =================================================================== --- trunk/lib/WikiDB/ADODB.php 2015-03-03 15:37:03 UTC (rev 9590) +++ trunk/lib/WikiDB/ADODB.php 2015-03-03 15:39:31 UTC (rev 9591) @@ -38,7 +38,7 @@ parent::__construct($backend, $dbparams); } - /** + /* * Determine whether page exists (in non-default form). * @see WikiDB::isWikiPage for the slow generic version */ Modified: trunk/lib/WikiDB/PDO.php =================================================================== --- trunk/lib/WikiDB/PDO.php 2015-03-03 15:37:03 UTC (rev 9590) +++ trunk/lib/WikiDB/PDO.php 2015-03-03 15:39:31 UTC (rev 9591) @@ -36,7 +36,7 @@ parent::__construct($backend, $dbparams); } - /** + /* * Determine whether page exists (in non-default form). * @see WikiDB::isWikiPage for the slow generic version */ Modified: trunk/lib/WikiDB/SQL.php =================================================================== --- trunk/lib/WikiDB/SQL.php 2015-03-03 15:37:03 UTC (rev 9590) +++ trunk/lib/WikiDB/SQL.php 2015-03-03 15:39:31 UTC (rev 9591) @@ -37,7 +37,7 @@ ); } - /** + /* * Determine whether page exists (in non-default form). * @see WikiDB::isWikiPage for the slow generic version */ Modified: trunk/lib/WikiDB/backend/ADODB.php =================================================================== --- trunk/lib/WikiDB/backend/ADODB.php 2015-03-03 15:37:03 UTC (rev 9590) +++ trunk/lib/WikiDB/backend/ADODB.php 2015-03-03 15:39:31 UTC (rev 9591) @@ -198,7 +198,7 @@ return; } - /** + /* * Read page information from database. */ function get_pagedata($pagename) @@ -367,7 +367,9 @@ /** * Get version data. * - * @param int $version Which version to get. + * @param string $pagename Name of the page + * @param int $version Which version to get + * @param bool $want_content Do we need content? * * @return array hash The version data, or false if specified version does not * exist. @@ -443,7 +445,7 @@ return $data; } - /** + /* * Create a new revision of a page. */ function set_versiondata($pagename, $version, $data) @@ -481,7 +483,7 @@ $this->unlock(array('page', 'recent', 'version', 'nonempty')); } - /** + /* * Delete an old revision of a page. */ function delete_versiondata($pagename, $version) @@ -501,7 +503,7 @@ $this->unlock(array('version')); } - /** + /* * Delete page from the database with backup possibility. * i.e save_page('') and DELETE nonempty id * @@ -557,9 +559,8 @@ } } - /** + /* * Delete page completely from the database. - * I'm not sure if this is what we want. Maybe just delete the revisions */ function purge_page($pagename) { @@ -760,7 +761,7 @@ return true; } - /** + /* * Find pages which link to or are linked from a page. * * Optimization: save request->_dbi->_iwpcache[] to avoid further iswikipage checks @@ -822,7 +823,7 @@ return new WikiDB_backend_ADODB_iter($this, $result, $fields); } - /** + /* * Find if a page links to another page */ function exists_link($pagename, $link, $reversed = false) @@ -906,7 +907,7 @@ return new WikiDB_backend_ADODB_iter($this, $result, $this->page_tbl_field_list); } - /** + /* * Title and fulltext search. */ public function text_search($search, $fulltext = false, @@ -970,7 +971,7 @@ return substr($s, 0, -1) . ")"; } - /** + /* * Find highest or lowest hit counts. */ public function most_popular($limit = 20, $sortby = '-hits') @@ -1006,7 +1007,7 @@ return new WikiDB_backend_ADODB_iter($this, $result, $this->page_tbl_field_list); } - /** + /* * Find recent changes. */ public function most_recent($params) @@ -1080,7 +1081,7 @@ array_merge($this->page_tbl_field_list, $this->version_tbl_field_list)); } - /** + /* * Find referenced empty pages. */ function wanted_pages($exclude_from = '', $exclude = '', $sortby = '', $limit = '') @@ -1122,7 +1123,7 @@ return new WikiDB_backend_ADODB_iter($this, $result, array('pagename', 'wantedfrom')); } - /** + /* * Rename page in the database. */ function rename_page($pagename, $to) @@ -1206,7 +1207,7 @@ $this->unlock(array('nonempty')); } - /** + /* * Grab a write lock on the tables in the SQL database. * * Calls can be nested. The tables won't be unlocked until @@ -1221,10 +1222,10 @@ } } - /** + /* * Overridden by non-transaction safe backends. */ - function _lock_tables($tables, $write_lock) + protected function _lock_tables($tables, $write_lock = true) { return $this->_current_lock; } @@ -1245,22 +1246,22 @@ return; } if (--$this->_lock_count <= 0 || $force) { - $this->_unlock_tables($tables, $force); + $this->_unlock_tables($tables); $this->_current_lock = false; $this->_lock_count = 0; } $this->_dbh->CompleteTrans(!$force); } - /** + /* * overridden by non-transaction safe backends */ - function _unlock_tables($tables, $write_lock = false) + protected function _unlock_tables($tables) { return; } - /** + /* * Serialize data */ function _serialize($data) @@ -1271,7 +1272,7 @@ return serialize($data); } - /** + /* * Unserialize data */ function _unserialize($data) Modified: trunk/lib/WikiDB/backend/ADODB_mssql.php =================================================================== --- trunk/lib/WikiDB/backend/ADODB_mssql.php 2015-03-03 15:37:03 UTC (rev 9590) +++ trunk/lib/WikiDB/backend/ADODB_mssql.php 2015-03-03 15:39:31 UTC (rev 9591) @@ -35,14 +35,14 @@ return true; } - /** + /* * Lock tables. * * We don't really need to lock exclusive, but I'll relax it when I fully * understand phpWiki locking ;-) * */ - function _lock_tables($tables, $write_lock = true) + protected function _lock_tables($tables, $write_lock = true) { if (!$tables) return; @@ -62,16 +62,16 @@ } } - /** + /* * Release the locks. */ - function _unlock_tables($tables) + protected function _unlock_tables($tables) { $dbh = &$this->_dbh; $dbh->Execute("COMMIT WORK"); } - // Search callabcks + // Search callbacks // Page name function _sql_match_clause($word) { @@ -89,7 +89,7 @@ . "OR CHARINDEX(content, '$word') > 0"; } - /** + /* * Serialize data */ function _serialize($data) @@ -100,7 +100,7 @@ return serialize(addslashes($data)); } - /** + /* * Unserialize data */ function _unserialize($data) Modified: trunk/lib/WikiDB/backend/ADODB_mssqlnative.php =================================================================== --- trunk/lib/WikiDB/backend/ADODB_mssqlnative.php 2015-03-03 15:37:03 UTC (rev 9590) +++ trunk/lib/WikiDB/backend/ADODB_mssqlnative.php 2015-03-03 15:39:31 UTC (rev 9591) @@ -53,7 +53,7 @@ . "OR CHARINDEX(content, '$word') > 0"; } - /** + /* * Serialize data */ function _serialize($data) @@ -64,7 +64,7 @@ return addslashes(serialize($data)); } - /** + /* * Unserialize data */ function _unserialize($data) Modified: trunk/lib/WikiDB/backend/ADODB_mysql.php =================================================================== --- trunk/lib/WikiDB/backend/ADODB_mysql.php 2015-03-03 15:37:03 UTC (rev 9590) +++ trunk/lib/WikiDB/backend/ADODB_mysql.php 2015-03-03 15:39:31 UTC (rev 9591) @@ -51,8 +51,8 @@ } } - /** - * Kill timed out processes. ( so far only called on about every 50-th save. ) + /* + * Kill timed out processes (so far only called on about every 50-th save). */ function _timeout() { @@ -70,7 +70,7 @@ } } - /** + /* * Pack tables. */ function optimize() @@ -83,7 +83,7 @@ return true; } - /** + /* * Lock tables. As fine-grained application lock, which locks only the * same transaction (conflicting updates and edits), and as full table * write lock. @@ -91,7 +91,7 @@ * New: which tables as params, * support nested locks via app locks */ - function _lock_tables($tables, $write_lock = true) + protected function _lock_tables($tables, $write_lock = true) { if (!$tables) return; if (DO_APP_LOCK) { @@ -113,11 +113,11 @@ } } - /** + /* * Release the locks. * Support nested locks */ - function _unlock_tables($tables) + protected function _unlock_tables($tables) { if (!$tables) { $this->_dbh->Execute("UNLOCK TABLES"); @@ -187,7 +187,7 @@ return $id; } - /** + /* * Create a new revision of a page. */ function set_versiondata($pagename, $version, $data) Modified: trunk/lib/WikiDB/backend/ADODB_oci8po.php =================================================================== --- trunk/lib/WikiDB/backend/ADODB_oci8po.php 2015-03-03 15:37:03 UTC (rev 9590) +++ trunk/lib/WikiDB/backend/ADODB_oci8po.php 2015-03-03 15:39:31 UTC (rev 9591) @@ -38,14 +38,14 @@ return true; } - /** + /* * Lock tables. * * We don't really need to lock exclusive, but I'll relax it when I fully * understand phpWiki locking ;-) * */ - function _lock_tables($tables, $write_lock = true) + protected function _lock_tables($tables, $write_lock = true) { if (!$tables) return; @@ -65,10 +65,10 @@ } } - /** + /* * Release the locks. */ - function _unlock_tables($tables) + protected function _unlock_tables($tables) { $dbh = &$this->_dbh; $dbh->Execute("COMMIT WORK"); @@ -97,7 +97,7 @@ } */ - /** + /* * Serialize data */ function _serialize($data) @@ -108,7 +108,7 @@ return $this->_dbh->BlobEncode(serialize($data)); } - /** + /* * Unserialize data */ function _unserialize($data) Modified: trunk/lib/WikiDB/backend/ADODB_postgres7.php =================================================================== --- trunk/lib/WikiDB/backend/ADODB_postgres7.php 2015-03-03 15:37:03 UTC (rev 9590) +++ trunk/lib/WikiDB/backend/ADODB_postgres7.php 2015-03-03 15:39:31 UTC (rev 9591) @@ -98,25 +98,25 @@ } } - /** + /* * Lock all tables we might use. * postgresql has proper transactions so we dont need table locks. */ - function _lock_tables($tables, $write_lock = true) + protected function _lock_tables($tables, $write_lock = true) { ; } - /** + /* * Unlock all tables. * postgresql has proper transactions so we dont need table locks. */ - function _unlock_tables($tables, $write_lock = false) + protected function _unlock_tables($tables) { ; } - /** + /* * Serialize data */ function _serialize($data) @@ -127,7 +127,7 @@ return $this->_quote(serialize($data)); } - /** + /* * Unserialize data */ function _unserialize($data) Modified: trunk/lib/WikiDB/backend/PDO.php =================================================================== --- trunk/lib/WikiDB/backend/PDO.php 2015-03-03 15:37:03 UTC (rev 9590) +++ trunk/lib/WikiDB/backend/PDO.php 2015-03-03 15:39:31 UTC (rev 9591) @@ -265,7 +265,7 @@ $sth->execute(); } - /** + /* * Read page information from database. */ function get_pagedata($pagename) @@ -448,7 +448,9 @@ /** * Get version data. * - * @param $version int Which version to get. + * @param string $pagename Name of the page + * @param int $version Which version to get + * @param bool $want_content Do we need content? * * @return array hash The version data, or false if specified version does not * exist. @@ -526,7 +528,7 @@ return $data; } - /** + /* * Create a new revision of a page. */ function set_versiondata($pagename, $version, $data) @@ -585,7 +587,7 @@ $this->unlock(array('page', 'recent', 'version', 'nonempty')); } - /** + /* * Delete an old revision of a page. */ function delete_versiondata($pagename, $version) @@ -605,7 +607,7 @@ $this->unlock(array('version')); } - /** + /* * Delete page from the database with backup possibility. * i.e save_page('') and DELETE nonempty id * @@ -671,9 +673,8 @@ } } - /** + /* * Delete page completely from the database. - * I'm not sure if this is what we want. Maybe just delete the revisions */ function purge_page($pagename) { @@ -761,7 +762,7 @@ return true; } - /** + /* * Find pages which link to or are linked from a page. * * Optimization: save request->_dbi->_iwpcache[] to avoid further iswikipage checks @@ -804,7 +805,7 @@ return new WikiDB_backend_PDO_iter($this, $result, $this->page_tbl_field_list); } - /** + /* * Find if a page links to another page */ function exists_link($pagename, $link, $reversed = false) @@ -881,7 +882,7 @@ return new WikiDB_backend_PDO_iter($this, $result, $this->page_tbl_field_list); } - /** + /* * Title and fulltext search. */ public function text_search($search, $fulltext = false, @@ -940,7 +941,7 @@ return substr($s, 0, -1) . ")"; } - /** + /* * Find highest or lowest hit counts. */ public function most_popular($limit = 20, $sortby = '-hits') @@ -976,7 +977,7 @@ return new WikiDB_backend_PDO_iter($this, $result, $this->page_tbl_field_list); } - /** + /* * Find recent changes. */ public function most_recent($params) @@ -1048,7 +1049,7 @@ array_merge($this->page_tbl_field_list, $this->version_tbl_field_list)); } - /** + /* * Find referenced empty pages. */ function wanted_pages($exclude_from = '', $exclude = '', $sortby = '', $limit = '') @@ -1090,7 +1091,7 @@ return new WikiDB_backend_PDO_iter($this, $result, array('pagename', 'wantedfrom')); } - /** + /* * Rename page in the database. */ function rename_page($pagename, $to) @@ -1179,7 +1180,7 @@ $this->unlock(array('nonempty')); } - /** + /* * Grab a write lock on the tables in the SQL database. * * Calls can be nested. The tables won't be unlocked until @@ -1194,10 +1195,10 @@ } } - /** + /* * Overridden by non-transaction safe backends. */ - function _lock_tables($tables, $write_lock) + protected function _lock_tables($tables, $write_lock = true) { $lock_type = $write_lock ? "WRITE" : "READ"; foreach ($this->_table_names as $key => $table) { @@ -1209,7 +1210,8 @@ /** * Release a write lock on the tables in the SQL database. * - * @param $force boolean Unlock even if not every call to lock() has been matched + * @param array $tables + * @param bool $force Unlock even if not every call to lock() has been matched * by a call to unlock(). * * @see _lock_database @@ -1222,21 +1224,21 @@ } if (--$this->_lock_count <= 0 || $force) { if (!$this->_hasTransactions) - $this->_unlock_tables($tables); + $this->_unlock_tables(); $this->_current_lock = false; $this->_lock_count = 0; } } - /** + /* * overridden by non-transaction safe backends */ - function _unlock_tables($tables) + protected function _unlock_tables() { $this->_dbh->query("UNLOCK TABLES"); } - /** + /* * Serialize data */ function _serialize($data) @@ -1247,7 +1249,7 @@ return serialize($data); } - /** + /* * Unserialize data */ function _unserialize($data) Modified: trunk/lib/WikiDB/backend/PDO_oci8.php =================================================================== --- trunk/lib/WikiDB/backend/PDO_oci8.php 2015-03-03 15:37:03 UTC (rev 9590) +++ trunk/lib/WikiDB/backend/PDO_oci8.php 2015-03-03 15:39:31 UTC (rev 9591) @@ -36,10 +36,10 @@ return true; } - /** + /* * Lock all tables we might use. */ - function _lock_tables($write_lock = true) + protected function _lock_tables($tables, $write_lock = true) { $dbh = &$this->_dbh; Modified: trunk/lib/WikiDB/backend/PearDB.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB.php 2015-03-03 15:37:03 UTC (rev 9590) +++ trunk/lib/WikiDB/backend/PearDB.php 2015-03-03 15:39:31 UTC (rev 9591) @@ -173,7 +173,7 @@ $dbh->escapeSimple($pagename))); } - /** + /* * Read page information from database. */ function get_pagedata($pagename) @@ -339,7 +339,9 @@ /** * Get version data. * - * @param $version int Which version to get. + * @param string $pagename Name of the page + * @param int $version Which version to get + * @param bool $want_content Do we need content? * * @return array hash The version data, or false if specified version does not * exist. @@ -408,7 +410,7 @@ return $data; } - /** + /* * Create a new revision of a page. */ function set_versiondata($pagename, $version, $data) @@ -446,7 +448,7 @@ $this->unlock(); } - /** + /* * Delete an old revision of a page. */ function delete_versiondata($pagename, $version) @@ -466,7 +468,7 @@ $this->unlock(); } - /** + /* * Delete page from the database with backup possibility. * i.e save_page('') and DELETE nonempty id * Can be undone and is seen in RecentChanges. @@ -489,9 +491,8 @@ } */ - /** + /* * Delete page completely from the database. - * I'm not sure if this is what we want. Maybe just delete the revisions */ function purge_page($pagename) { @@ -576,7 +577,7 @@ $this->unlock(); } - /** + /* * Find pages which link to or are linked from a page. * * TESTME relations: get_links is responsible to add the relation to the pagehash @@ -625,7 +626,7 @@ return new WikiDB_backend_PearDB_iter($this, $result); } - /** + /* * Find if a page links to another page */ function exists_link($pagename, $link, $reversed = false) @@ -706,7 +707,7 @@ return new WikiDB_backend_PearDB_iter($this, $result, $options); } - /** + /* * Text search (title or full text) * Todo: exclude */ @@ -794,7 +795,7 @@ return "pagename LIKE '%$word%' OR content LIKE '%$word%'"; } - /** + /* * Find highest or lowest hit counts. */ public function most_popular($limit = 20, $sortby = '-hits') @@ -832,7 +833,7 @@ return new WikiDB_backend_PearDB_iter($this, $result); } - /** + /* * Find recent changes. */ public function most_recent($params) @@ -905,7 +906,7 @@ return new WikiDB_backend_PearDB_iter($this, $result); } - /** + /* * Find referenced empty pages. */ function wanted_pages($exclude_from = '', $exclude = '', $sortby = '', $limit = '') @@ -947,7 +948,7 @@ return substr($s, 0, -1) . ")"; } - /** + /* * Rename page in the database. */ function rename_page($pagename, $to) @@ -1019,7 +1020,7 @@ $this->unlock(); } - /** + /* * Grab a write lock on the tables in the SQL database. * * Calls can be nested. The tables won't be unlocked until @@ -1031,10 +1032,10 @@ $this->_lock_tables($write_lock); } - /** + /* * Actually lock the required tables. */ - function _lock_tables($write_lock) + protected function _lock_tables($write_lock = true) { trigger_error("virtual", E_USER_ERROR); } @@ -1042,6 +1043,7 @@ /** * Release a write lock on the tables in the SQL database. * + * @param array $tables * @param bool $force Unlock even if not every call to lock() has been matched * by a call to unlock(). * @@ -1061,12 +1063,12 @@ /** * Actually unlock the required tables. */ - function _unlock_tables($write_lock) + protected function _unlock_tables() { trigger_error("virtual", E_USER_ERROR); } - /** + /* * Serialize data */ function _serialize($data) @@ -1077,7 +1079,7 @@ return serialize($data); } - /** + /* * Unserialize data */ function _unserialize($data) @@ -1088,7 +1090,7 @@ /** * Callback for PEAR (DB) errors. * - * @param A PEAR_error object. + * @param $error PEAR_error object. */ public function _pear_error_callback($error) { @@ -1100,7 +1102,7 @@ trigger_error($this->_pear_error_message($error), E_USER_ERROR); } - /** + /* * Detect false errors messages from PEAR DB. * * The version of PEAR DB which ships with PHP 4.0.6 has a bug in that @@ -1153,7 +1155,7 @@ return str_replace($this->_dsn, $safe_dsn, $message); } - /** + /* * Filter PHP errors notices from PEAR DB code. * * The PEAR DB code which ships with PHP 4.0.6 produces spurious Modified: trunk/lib/WikiDB/backend/PearDB_ffpgsql.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB_ffpgsql.php 2015-03-03 15:37:03 UTC (rev 9590) +++ trunk/lib/WikiDB/backend/PearDB_ffpgsql.php 2015-03-03 15:39:31 UTC (rev 9591) @@ -604,7 +604,7 @@ return true; } - /** + /* * Text search (title or full text) */ public function text_search($search, $fulltext = false, @@ -709,7 +709,7 @@ } } - /** + /* * use tsearch2. See schemas/psql-tsearch2.sql and /usr/share/postgresql/contrib/tsearch2.sql * TODO: don't parse the words into nodes. rather replace "[ +]" with & and "-" with "!" and " or " with "|" * tsearch2 query language: @@ "word | word", "word & word", ! word Modified: trunk/lib/WikiDB/backend/PearDB_mysql.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB_mysql.php 2015-03-03 15:37:03 UTC (rev 9590) +++ trunk/lib/WikiDB/backend/PearDB_mysql.php 2015-03-03 15:39:31 UTC (rev 9591) @@ -50,7 +50,7 @@ } } - /** + /* * Create a new revision of a page. */ function set_versiondata($pagename, $version, $data) @@ -169,10 +169,10 @@ return true; } - /** + /* * Lock tables. */ - function _lock_tables($write_lock = true) + protected function _lock_tables($write_lock = true) { $lock_type = $write_lock ? "WRITE" : "READ"; foreach ($this->_table_names as $table) { @@ -181,10 +181,10 @@ $this->_dbh->query("LOCK TABLES " . join(",", $tables)); } - /** + /* * Release all locks. */ - function _unlock_tables() + protected function _unlock_tables() { $this->_dbh->query("UNLOCK TABLES"); } Modified: trunk/lib/WikiDB/backend/PearDB_oci8.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB_oci8.php 2015-03-03 15:37:03 UTC (rev 9590) +++ trunk/lib/WikiDB/backend/PearDB_oci8.php 2015-03-03 15:39:31 UTC (rev 9591) @@ -41,10 +41,10 @@ return true; } - /** + /* * Lock all tables we might use. */ - function _lock_tables($write_lock = true) + protected function _lock_tables($write_lock = true) { $dbh = &$this->_dbh; Modified: trunk/lib/WikiDB/backend/PearDB_pgsql.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB_pgsql.php 2015-03-03 15:37:03 UTC (rev 9590) +++ trunk/lib/WikiDB/backend/PearDB_pgsql.php 2015-03-03 15:39:31 UTC (rev 9591) @@ -81,7 +81,7 @@ array($this->_quote($data), $pagename)); } - /** + /* * Create a new revision of a page. */ function _todo_set_versiondata($pagename, $version, $data) @@ -113,7 +113,7 @@ $this->unlock(); } - /** + /* * Delete an old revision of a page. */ function _todo_delete_versiondata($pagename, $version) @@ -123,7 +123,7 @@ $dbh->query(sprintf("SELECT delete_versiondata (%d, %d)", $id, $version)); } - /** + /* * Rename page in the database. */ function _todo_rename_page($pagename, $to) @@ -146,23 +146,23 @@ return $id; } - /** + /* * Lock all tables we might use. */ - function _lock_tables($write_lock = true) + protected function _lock_tables($write_lock = true) { $this->_dbh->query("BEGIN"); } - /** + /* * Unlock all tables. */ - function _unlock_tables() + protected function _unlock_tables() { $this->_dbh->query("COMMIT"); } - /** + /* * Serialize data */ function _serialize($data) @@ -173,7 +173,7 @@ return $this->_quote(serialize($data)); } - /** + /* * Unserialize data */ function _unserialize($data) @@ -187,7 +187,7 @@ return unserialize($this->_unquote($data)); } - /** + /* * Text search (title or full text) */ public function text_search($search, $fulltext = false, @@ -280,21 +280,20 @@ default | 39 | 124 */ - /** + /* * use tsearch2. See schemas/psql-tsearch2.sql and /usr/share/postgresql/contrib/tsearch2.sql * TODO: don't parse the words into nodes. rather replace "[ +]" with & and "-" with "!" and " or " with "|" * tsearch2 query language: @@ "word | word", "word & word", ! word * ~* '.*something that does not exist.*' + * + * phrase search for "history lesson": + * + * SELECT id FROM tab WHERE ts_idx_col @@ to_tsquery('history&lesson') + * AND text_col ~* '.*history\\s+lesson.*'; + * + * The full-text index will still be used, and the regex will be used to + * prune the results afterwards. */ - /* - phrase search for "history lesson": - - SELECT id FROM tab WHERE ts_idx_col @@ to_tsquery('history&lesson') - AND text_col ~* '.*history\\s+lesson.*'; - - The full-text index will still be used, and the regex will be used to - prune the results afterwards. - */ function _fulltext_match_clause($node) { $word = strtolower($node->word); Modified: trunk/lib/WikiDB/backend/PearDB_sqlite.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB_sqlite.php 2015-03-03 15:37:03 UTC (rev 9590) +++ trunk/lib/WikiDB/backend/PearDB_sqlite.php 2015-03-03 15:39:31 UTC (rev 9591) @@ -22,7 +22,7 @@ class WikiDB_backend_PearDB_sqlite extends WikiDB_backend_PearDB { - /** + /* * Pack tables. */ function optimize() @@ -31,23 +31,23 @@ // NOP } - /** + /* * Lock tables. */ - function _lock_tables($write_lock = true) + protected function _lock_tables($write_lock = true) { // NOP - SQLite does all locking automatically } - /** + /* * Release all locks. */ - function _unlock_tables() + protected function _unlock_tables() { // NOP } - /** + /* * Serialize data */ function _serialize($data) @@ -58,7 +58,7 @@ return base64_encode(serialize($data)); } - /** + /* * Unserialize data */ function _unserialize($data) Modified: trunk/lib/WikiDB/backend/file.php =================================================================== --- trunk/lib/WikiDB/backend/file.php 2015-03-03 15:37:03 UTC (rev 9590) +++ trunk/lib/WikiDB/backend/file.php 2015-03-03 15:39:31 UTC (rev 9591) @@ -311,8 +311,7 @@ * * @param string $pagename Page name. * @param array $newdata hash New meta-data. - */ - /** + * * This will create a new page if page being requested does not * exist. */ @@ -397,7 +396,7 @@ return $vd; } - /** + /* * Rename all files for this page */ public function rename_page($pagename, $to) @@ -414,7 +413,7 @@ return true; } - /** + /* * See ADODB for a better delete_page(), which can be undone and is seen in RecentChanges. */ function delete_page($pagename) @@ -532,8 +531,13 @@ /** * Find pages which link to or are linked from a page. * - * @param $pagename string Page name. - * @param $reversed boolean True to get backlinks. + * @param string $pagename Page name. + * @param bool $reversed True to get backlinks. + * @param bool $include_empty True to get empty pages + * @param string $sortby + * @param string $limit + * @param string $exclude Pages to exclude. + * @param bool $want_relations True to get relations. * * FIXME: array or iterator? * @return object A WikiDB_backend_iterator. @@ -579,7 +583,7 @@ * Pages should be returned in alphabetical order if that is * feasable. * - * @param $include_defaulted boolean + * @param bool $include_empty * If set, even pages with no content will be returned * --- but still only if they have at least one revision (not * counting the default revision 0) entered in the database. @@ -588,6 +592,10 @@ * are not returned as these pages are considered to be * non-existing. * + * @param string $sortby + * @param string $limit + * @param string $exclude + * * @return object A WikiDB_backend_iterator. */ public function get_all_pages($include_empty = false, $sortby = '', $limit = '', $exclude = '') @@ -622,28 +630,28 @@ return count($this->_latest_versions); } - /** + /* * Lock backend database. */ function lock($tables = array(), $write_lock = true) { } - /** + /* * Unlock backend database. */ function unlock($tables = array(), $force = false) { } - /** + /* * Close database. */ function close() { } - /** + /* * Synchronize with filesystem. * * This should flush all unwritten data to the filesystem. @@ -652,7 +660,7 @@ { } - /** + /* * Optimize the database. */ function optimize() Modified: trunk/lib/WikiDB/backend/flatfile.php =================================================================== --- trunk/lib/WikiDB/backend/flatfile.php 2015-03-03 15:37:03 UTC (rev 9590) +++ trunk/lib/WikiDB/backend/flatfile.php 2015-03-03 15:39:31 UTC (rev 9591) @@ -97,7 +97,7 @@ return array(); // no values found } - /** Store latest version as full page_data flatfile, + /* Store latest version as full page_data flatfile, * earlier versions as file backend ver_data. * _cached_html will not be stored. * If the given ($pagename,$version) is already in the database, Modified: trunk/lib/WikiDB/backend.php =================================================================== --- trunk/lib/WikiDB/backend.php 2015-03-03 15:37:03 UTC (rev 9590) +++ trunk/lib/WikiDB/backend.php 2015-03-03 15:39:31 UTC (rev 9591) @@ -547,7 +547,7 @@ return array($words, $exclude); } - /** + /* * Split the given limit parameter into offset,limit. (offset is optional. default: 0) * Duplicate the PageList function here to avoid loading the whole PageList.php * Usage: @@ -571,7 +571,7 @@ } } - /** + /* * Handle sortby requests for the DB iterator and table header links. * Prefix the column with + or - like "+pagename","-mtime", ... * supported actions: 'flip_order' "mtime" => "+mtime" => "-mtime" ... This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |