From: <var...@us...> - 2010-12-09 09:55:14
|
Revision: 7754 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7754&view=rev Author: vargenau Date: 2010-12-09 09:55:08 +0000 (Thu, 09 Dec 2010) Log Message: ----------- Add header Modified Paths: -------------- trunk/lib/WikiDB/backend.php Modified: trunk/lib/WikiDB/backend.php =================================================================== --- trunk/lib/WikiDB/backend.php 2010-12-09 09:39:02 UTC (rev 7753) +++ trunk/lib/WikiDB/backend.php 2010-12-09 09:55:08 UTC (rev 7754) @@ -1,5 +1,24 @@ -<?php // -*-php-*- -// rcs_id('$Id$'); +<?php +// $Id$ +/* + * Copyright 2004-2010 Reini Urban + * + * This file is part of PhpWiki. + * + * PhpWiki is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * PhpWiki is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with PhpWiki; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ /* Pagedata @@ -183,7 +202,7 @@ } /** - * Delete page (and all it's revisions) from the database. + * Delete page (and all its revisions) from the database. * */ function purge_page($pagename) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2011-05-19 19:14:40
|
Revision: 8080 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8080&view=rev Author: vargenau Date: 2011-05-19 19:14:34 +0000 (Thu, 19 May 2011) Log Message: ----------- New FSF address Modified Paths: -------------- trunk/lib/WikiDB/backend.php Modified: trunk/lib/WikiDB/backend.php =================================================================== --- trunk/lib/WikiDB/backend.php 2011-05-18 18:19:24 UTC (rev 8079) +++ trunk/lib/WikiDB/backend.php 2011-05-19 19:14:34 UTC (rev 8080) @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License along * with PhpWiki; if not, write to the Free Software Foundation, Inc., - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-07-17 12:26:07
|
Revision: 8972 http://sourceforge.net/p/phpwiki/code/8972 Author: vargenau Date: 2014-07-17 12:26:03 +0000 (Thu, 17 Jul 2014) Log Message: ----------- Update PHP Doc Modified Paths: -------------- trunk/lib/WikiDB/backend.php Modified: trunk/lib/WikiDB/backend.php =================================================================== --- trunk/lib/WikiDB/backend.php 2014-07-17 09:33:21 UTC (rev 8971) +++ trunk/lib/WikiDB/backend.php 2014-07-17 12:26:03 UTC (rev 8972) @@ -292,12 +292,18 @@ /** * 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 + * @param string $sortby + * @param string $limit + * @param string $exclude + * @param bool $want_relations * * FIXME: array or iterator? * @return object A WikiDB_backend_iterator. */ + function get_links($pagename, $reversed, $include_empty = false, $sortby = '', $limit = '', $exclude = '') { @@ -325,7 +331,7 @@ * * @access protected * - * @param $include_defaulted boolean + * @param bool $include_defaulted * 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. @@ -334,6 +340,9 @@ * are not returned as these pages are considered to be * non-existing. * + * @param bool $orderby + * @param string $limit + * @param string $exclude * @return object A WikiDB_backend_iterator. */ function get_all_pages($include_defaulted, $orderby = false, $limit = '', $exclude = '') @@ -345,16 +354,20 @@ * Title or full text search. * * Pages should be returned in alphabetical order if that is - * feasable. + * feasible. * * @access protected * - * @param $search object A TextSearchQuery object describing the parsed query string, + * @param object $search object A TextSearchQuery object describing the parsed query string, * with efficient methods for SQL and PCRE match. * - * @param $fullsearch boolean If true, a full text search is performed, + * @param bool $fulltext If true, a full text search is performed, * otherwise a title search is performed. * + * @param string $sortby + * @param string $limit + * @param string $exclude + * * @return object A WikiDB_backend_iterator. * * @see WikiDB::titleSearch @@ -378,12 +391,12 @@ /** * * @access protected - * @param $pages object A TextSearchQuery object. - * @param $linkvalue object A TextSearchQuery object for the linkvalues + * @param object $pages A TextSearchQuery object. + * @param object $linkvalue A TextSearchQuery object for the link values * (linkto, relation or backlinks or attribute values). - * @param $linktype string One of the 4 linktypes. - * @param $relation object A TextSearchQuery object or false. - * @param $options array Currently ignored. hash of sortby, limit, exclude. + * @param string $linktype One of the 4 link types. + * @param object|bool $relation A TextSearchQuery object or false. + * @param array $options Currently ignored. hash of sortby, limit, exclude. * @return object A WikiDB_backend_iterator. * @see WikiDB::linkSearch */ @@ -401,7 +414,8 @@ * be returned in reverse order by hit count. * * @access protected - * @param integer $limit No more than this many pages + * @param int $limit No more than this many pages + * @param string $sortby * @return object A WikiDB_backend_iterator. */ function most_popular($limit, $sortby = '-hits') @@ -421,7 +435,7 @@ * Find recent changes. * * @access protected - * @param $params hash See WikiDB::mostRecent for a description + * @param object $params hash See WikiDB::mostRecent for a description * of parameters which can be included in this hash. * @return object A WikiDB_backend_iterator. * @see WikiDB::mostRecent @@ -505,6 +519,7 @@ * trigger_error("Message goes here.", E_USER_WARNING); * </pre> * + * @param bool $args * @return boolean True iff database is in a consistent state. */ function check($args = false) @@ -518,6 +533,7 @@ * This should put the database into a consistent state. * (I.e. rebuild indexes, etc...) * + * @param bool $args * @return boolean True iff successful. */ function rebuild($args = false) @@ -671,7 +687,6 @@ function write_accesslog(&$entry) { - global $request; if (!$this->isSQL()) return; $dbh = &$this->_dbh; $log_tbl = $entry->_accesslog->logtable; @@ -865,6 +880,7 @@ { // force word-style %word% for fulltext search $dbh = &$this->_dbh; + $word = strtolower($node->word); $word = '%' . $dbh->escapeSimple($word) . '%'; // eliminate stoplist words if ($this->isStoplisted($node)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-07-25 16:03:10
|
Revision: 9008 http://sourceforge.net/p/phpwiki/code/9008 Author: vargenau Date: 2014-07-25 16:03:00 +0000 (Fri, 25 Jul 2014) Log Message: ----------- function link_search is public Modified Paths: -------------- trunk/lib/WikiDB/backend.php Modified: trunk/lib/WikiDB/backend.php =================================================================== --- trunk/lib/WikiDB/backend.php 2014-07-25 14:49:17 UTC (rev 9007) +++ trunk/lib/WikiDB/backend.php 2014-07-25 16:03:00 UTC (rev 9008) @@ -395,7 +395,7 @@ * @return object A WikiDB_backend_iterator. * @see WikiDB::linkSearch */ - protected function link_search($pages, $linkvalue, $linktype, $relation = false, $options = array()) + public function link_search($pages, $linkvalue, $linktype, $relation = false, $options = array()) { include_once 'lib/WikiDB/backend/dumb/LinkSearchIter.php'; $pageiter = $this->text_search($pages); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-07-30 15:03:35
|
Revision: 9030 http://sourceforge.net/p/phpwiki/code/9030 Author: vargenau Date: 2014-07-30 15:03:28 +0000 (Wed, 30 Jul 2014) Log Message: ----------- Update PHP Doc Modified Paths: -------------- trunk/lib/WikiDB/backend.php Modified: trunk/lib/WikiDB/backend.php =================================================================== --- trunk/lib/WikiDB/backend.php 2014-07-29 09:09:42 UTC (rev 9029) +++ trunk/lib/WikiDB/backend.php 2014-07-30 15:03:28 UTC (rev 9030) @@ -298,7 +298,6 @@ * @param string $sortby * @param string $limit * @param string $exclude - * @param bool $want_relations * * FIXME: array or iterator? * @return object A WikiDB_backend_iterator. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-07 14:16:59
|
Revision: 9214 http://sourceforge.net/p/phpwiki/code/9214 Author: vargenau Date: 2014-10-07 14:16:56 +0000 (Tue, 07 Oct 2014) Log Message: ----------- Type compatibility Modified Paths: -------------- trunk/lib/WikiDB/backend.php Modified: trunk/lib/WikiDB/backend.php =================================================================== --- trunk/lib/WikiDB/backend.php 2014-10-07 13:23:09 UTC (rev 9213) +++ trunk/lib/WikiDB/backend.php 2014-10-07 14:16:56 UTC (rev 9214) @@ -194,7 +194,7 @@ $this->lock(); // critical section: $version = $this->get_latest_version($pagename); $this->set_versiondata($pagename, $version + 1, $vdata); - $this->set_links($pagename, false); // links are purged. + $this->set_links($pagename, array()); // links are purged. // SQL needs to invalidate the non_empty id if (!WIKIDB_NOCACHE_MARKUP) { // need the hits, perms and LOCKED, otherwise you can reset the perm This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-10-07 14:47:03
|
Revision: 9216 http://sourceforge.net/p/phpwiki/code/9216 Author: vargenau Date: 2014-10-07 14:46:59 +0000 (Tue, 07 Oct 2014) Log Message: ----------- class WikiDB_backend is abstract Modified Paths: -------------- trunk/lib/WikiDB/backend.php Modified: trunk/lib/WikiDB/backend.php =================================================================== --- trunk/lib/WikiDB/backend.php 2014-10-07 14:19:17 UTC (rev 9215) +++ trunk/lib/WikiDB/backend.php 2014-10-07 14:46:59 UTC (rev 9216) @@ -69,7 +69,7 @@ * @access protected * @see WikiDB */ -class WikiDB_backend +abstract class WikiDB_backend { /** * Get page meta-data from database. @@ -86,10 +86,7 @@ * don't think we need this...) * </dl> */ - function get_pagedata($pagename) - { - trigger_error("virtual", E_USER_ERROR); - } + abstract function get_pagedata($pagename); /** * Update the page meta-data. @@ -114,10 +111,7 @@ * @param $pagename string Page name. * @param $newdata hash New meta-data. */ - function update_pagedata($pagename, $newdata) - { - trigger_error("virtual", E_USER_ERROR); - } + abstract function update_pagedata($pagename, $newdata); /** * Get the current version number for a page. @@ -126,10 +120,7 @@ * @return int The latest version number for the page. Returns zero if * no versions of a page exist. */ - function get_latest_version($pagename) - { - trigger_error("virtual", E_USER_ERROR); - } + abstract function get_latest_version($pagename); /** * Get preceding version number. @@ -139,10 +130,7 @@ * @return int The version number of the version in the database which * immediately preceeds $version. */ - function get_previous_version($pagename, $version) - { - trigger_error("virtual", E_USER_ERROR); - } + abstract function get_previous_version($pagename, $version); /** * Get revision meta-data and content. @@ -169,10 +157,7 @@ * For description of other version meta-data see WikiDB_PageRevision::get(). * @see WikiDB_PageRevision::get */ - function get_versiondata($pagename, $version, $want_content = false) - { - trigger_error("virtual", E_USER_ERROR); - } + abstract function get_versiondata($pagename, $version, $want_content = false); /** * Delete page from the database with backup possibility. @@ -210,10 +195,7 @@ * Delete page (and all its revisions) from the database. * */ - function purge_page($pagename) - { - trigger_error("virtual", E_USER_ERROR); - } + abstract function purge_page($pagename); /** * Delete an old revision of a page. @@ -227,10 +209,7 @@ * @param $pagename string Page name. * @param $version integer Version to delete. */ - function delete_versiondata($pagename, $version) - { - trigger_error("virtual", E_USER_ERROR); - } + abstract function delete_versiondata($pagename, $version); /** * Create a new page revision. @@ -244,10 +223,7 @@ * * @see get_versiondata */ - function set_versiondata($pagename, $version, $data) - { - trigger_error("virtual", E_USER_ERROR); - } + abstract function set_versiondata($pagename, $version, $data); /** * Update page version meta-data. @@ -284,10 +260,7 @@ * * @param $links array List of page(names) which page links to. */ - function set_links($pagename, $links) - { - trigger_error("virtual", E_USER_ERROR); - } + abstract function set_links($pagename, $links); /** * Find pages which link to or are linked from a page. @@ -342,10 +315,7 @@ * @param string $exclude * @return object A WikiDB_backend_iterator. */ - protected function get_all_pages($include_defaulted, $orderby = false, $limit = '', $exclude = '') - { - trigger_error("virtual", E_USER_ERROR); - } + abstract protected function get_all_pages($include_defaulted, $orderby = false, $limit = '', $exclude = ''); /** * Title or full text search. @@ -713,7 +683,7 @@ * FIXME: This might be two separate classes: page_iter and version_iter. * For the versions we have WikiDB_backend_dumb_AllRevisionsIter. */ -class WikiDB_backend_iterator +abstract class WikiDB_backend_iterator { /** * Get the next record in the iterator set. @@ -734,10 +704,7 @@ * * If this is a link iterator, the 'pagename' is mandatory, 'linkrelation' is optional. */ - function next() - { - trigger_error("virtual", E_USER_ERROR); - } + abstract function next(); function count() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-11-28 09:51:17
|
Revision: 9386 http://sourceforge.net/p/phpwiki/code/9386 Author: vargenau Date: 2014-11-28 09:51:10 +0000 (Fri, 28 Nov 2014) Log Message: ----------- function get_links is abstract Modified Paths: -------------- trunk/lib/WikiDB/backend.php Modified: trunk/lib/WikiDB/backend.php =================================================================== --- trunk/lib/WikiDB/backend.php 2014-11-27 15:32:22 UTC (rev 9385) +++ trunk/lib/WikiDB/backend.php 2014-11-28 09:51:10 UTC (rev 9386) @@ -71,11 +71,14 @@ */ abstract class WikiDB_backend { + public $_sortby; + public $_dbh; + /** * Get page meta-data from database. * - * @param $pagename string Page name. - * @return hash + * @param string $pagename Page name. + * @return array hash * Returns a hash containing the page meta-data. * Returns an empty array if there is no meta-data for the requested page. * Keys which might be present in the hash are: @@ -108,15 +111,15 @@ * $backend->update_pagedata($pagename, array('locked' => false)); * </pre> * - * @param $pagename string Page name. - * @param $newdata hash New meta-data. + * @param string $pagename Page name. + * @param array $newdata hash New meta-data. */ abstract function update_pagedata($pagename, $newdata); /** * Get the current version number for a page. * - * @param $pagename string Page name. + * @param string $pagename Page name. * @return int The latest version number for the page. Returns zero if * no versions of a page exist. */ @@ -125,26 +128,26 @@ /** * Get preceding version number. * - * @param $pagename string Page name. - * @param $version int Find version before this one. + * @param string $pagename Page name. + * @param int $version Find version before this one. * @return int The version number of the version in the database which - * immediately preceeds $version. + * immediately precedes $version. */ abstract function get_previous_version($pagename, $version); /** * Get revision meta-data and content. * - * @param $pagename string Page name. - * @param $version integer Which version to get. - * @param $want_content boolean + * @param string $pagename Page name. + * @param int $version Which version to get. + * @param bool $want_content * Indicates the caller really wants the page content. If this * flag is not set, the backend is free to skip fetching of the * page content (as that may be expensive). If the backend omits * the content, the backend might still want to set the value of * '%content' to the empty string if it knows there's no content. * - * @return hash The version data, or false if specified version does not + * @return array|bool hash The version data, or false if specified version does not * exist. * * Some keys which might be present in the $versiondata hash are: @@ -164,14 +167,19 @@ * This should remove all links (from the named page) from * the link database. * - * @param $pagename string Page name. + * @param string $pagename Page name. * i.e save_page('') and DELETE nonempty id * Can be undone and is seen in RecentChanges. */ function delete_page($pagename) { + /** + * @var WikiRequest $request + */ + global $request; + $mtime = time(); - $user =& $GLOBALS['request']->_user; + $user =& $request->_user; $vdata = array('author' => $user->getId(), 'author_id' => $user->getAuthenticatedId(), 'mtime' => $mtime); @@ -194,6 +202,7 @@ /** * Delete page (and all its revisions) from the database. * + * @param string $pagename Page name. */ abstract function purge_page($pagename); @@ -206,8 +215,8 @@ * In fact, to be safe, backends should probably allow the deletion of * the most recent version. * - * @param $pagename string Page name. - * @param $version integer Version to delete. + * @param string $pagename Page name. + * @param int $version int Version to delete. */ abstract function delete_versiondata($pagename, $version); @@ -217,9 +226,9 @@ * If the given ($pagename,$version) is already in the database, * this method completely overwrites any stored data for that version. * - * @param $pagename string Page name. - * @param $version int New revisions content. - * @param $data hash New revision metadata. + * @param string $pagename string Page name. + * @param int $version New revisions content. + * @param array $data hash New revision metadata. * * @see get_versiondata */ @@ -230,11 +239,11 @@ * * If the given ($pagename,$version) is already in the database, * this method only changes those meta-data values whose keys are - * explicity listed in $newdata. + * explicitly listed in $newdata. * - * @param $pagename string Page name. - * @param $version int New revisions content. - * @param $newdata hash New revision metadata. + * @param string $pagename Page name. + * @param int $version New revisions content. + * @param array $newdata hash New revision metadata. * @see set_versiondata, get_versiondata */ function update_versiondata($pagename, $version, $newdata) @@ -256,9 +265,9 @@ /** * Set links for page. * - * @param $pagename string Page name. + * @param string $pagename Page name. * - * @param $links array List of page(names) which page links to. + * @param array $links List of page(names) which page links to. */ abstract function set_links($pagename, $links); @@ -276,17 +285,14 @@ * @return object A WikiDB_backend_iterator. */ - function get_links($pagename, $reversed, $include_empty = false, - $sortby = '', $limit = '', $exclude = '') - { - //FIXME: implement simple (but slow) link finder. - die("FIXME get_links"); - } + // FIXME: implement simple (but slow) link finder. + abstract function get_links($pagename, $reversed, $include_empty = false, + $sortby = '', $limit = '', $exclude = ''); /** * Get all revisions of a page. * - * @param $pagename string The page name. + * @param string $pagename The page name. * @return object A WikiDB_backend_iterator. */ function get_all_revisions($pagename) @@ -299,7 +305,7 @@ * Get all pages in the database. * * Pages should be returned in alphabetical order if that is - * feasable. + * feasible. * * @param bool $include_defaulted * If set, even pages with no content will be returned @@ -315,7 +321,7 @@ * @param string $exclude * @return object A WikiDB_backend_iterator. */ - abstract protected function get_all_pages($include_defaulted, $orderby = false, $limit = '', $exclude = ''); + abstract public function get_all_pages($include_defaulted, $orderby = false, $limit = '', $exclude = ''); /** * Title or full text search. @@ -426,7 +432,7 @@ * * Calls may be nested. * - * @param $write_lock boolean Unless this is set to false, a write lock + * @param bool $write_lock Unless this is set to false, a write lock * is acquired, otherwise a read lock. If the backend doesn't support * read locking, then it should make a write lock no matter which type * of lock was requested. @@ -440,7 +446,7 @@ /** * Unlock backend database. * - * @param $force boolean Normally, the database is not unlocked until + * @param bool $force Normally, the database is not unlocked until * unlock() is called as many times as lock() has been. If $force is * set to true, the the database is unconditionally unlocked. */ @@ -448,7 +454,6 @@ { } - /** * Close database. */ @@ -482,7 +487,7 @@ * </pre> * * @param bool $args - * @return boolean True iff database is in a consistent state. + * @return bool True iff database is in a consistent state. */ function check($args = false) { @@ -496,11 +501,15 @@ * (I.e. rebuild indexes, etc...) * * @param bool $args - * @return boolean True iff successful. + * @return bool True iff successful. */ function rebuild($args = false) { + /** + * @var WikiRequest $request + */ global $request; + $dbh = $request->getDbh(); $iter = $dbh->getAllPages(false); while ($page = $iter->next()) { @@ -573,7 +582,13 @@ */ function sortby($column, $action, $sortable_columns = false) { - if (empty($column)) return ''; + /** + * @var WikiRequest $request + */ + global $request; + + if (empty($column)) + return ''; //support multiple comma-delimited sortby args: "+hits,+pagename" if (strstr($column, ',')) { $result = array(); @@ -605,8 +620,8 @@ return $order . $column; } elseif ($action == 'check') { return (!empty($this->_sortby[$column]) or - ($GLOBALS['request']->getArg('sortby') and - strstr($GLOBALS['request']->getArg('sortby'), $column))); + ($request->getArg('sortby') and + strstr($request->getArg('sortby'), $column))); } elseif ($action == 'db') { // native sort possible? if (!empty($this) and !$sortable_columns) @@ -685,6 +700,8 @@ */ abstract class WikiDB_backend_iterator { + public $_options; + /** * Get the next record in the iterator set. * @@ -811,11 +828,6 @@ } return false; } - - function getStoplisted($word) - { - return $this->stoplisted; - } } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-12-04 16:30:14
|
Revision: 9420 http://sourceforge.net/p/phpwiki/code/9420 Author: vargenau Date: 2014-12-04 16:29:59 +0000 (Thu, 04 Dec 2014) Log Message: ----------- Type compatibility Modified Paths: -------------- trunk/lib/WikiDB/backend.php Modified: trunk/lib/WikiDB/backend.php =================================================================== --- trunk/lib/WikiDB/backend.php 2014-12-04 16:19:33 UTC (rev 9419) +++ trunk/lib/WikiDB/backend.php 2014-12-04 16:29:59 UTC (rev 9420) @@ -403,7 +403,7 @@ /** * Find recent changes. * - * @param object $params hash See WikiDB::mostRecent for a description + * @param array $params hash See WikiDB::mostRecent for a description * of parameters which can be included in this hash. * @return object A WikiDB_backend_iterator. * @see WikiDB::mostRecent This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-01-07 09:25:31
|
Revision: 9755 http://sourceforge.net/p/phpwiki/code/9755 Author: vargenau Date: 2016-01-07 09:25:29 +0000 (Thu, 07 Jan 2016) Log Message: ----------- Use __construct Modified Paths: -------------- trunk/lib/WikiDB/backend.php Modified: trunk/lib/WikiDB/backend.php =================================================================== --- trunk/lib/WikiDB/backend.php 2016-01-07 09:21:44 UTC (rev 9754) +++ trunk/lib/WikiDB/backend.php 2016-01-07 09:25:29 UTC (rev 9755) @@ -776,7 +776,7 @@ */ class WikiDB_backend_search { - function WikiDB_backend_search($search, &$dbh) + function __construct($search, &$dbh) { $this->_dbh = $dbh; $this->_case_exact = $search->_case_exact; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-01-03 09:46:31
|
Revision: 10220 http://sourceforge.net/p/phpwiki/code/10220 Author: vargenau Date: 2021-01-03 09:46:24 +0000 (Sun, 03 Jan 2021) Log Message: ----------- Revert r10209 for lib/WikiDB/backend.php (userless test $limit > 2147483647) Modified Paths: -------------- trunk/lib/WikiDB/backend.php Modified: trunk/lib/WikiDB/backend.php =================================================================== --- trunk/lib/WikiDB/backend.php 2021-01-02 20:28:05 UTC (rev 10219) +++ trunk/lib/WikiDB/backend.php 2021-01-03 09:46:24 UTC (rev 10220) @@ -566,7 +566,7 @@ } return array($from, $limit); } else { - if (!empty($limit) && (!is_numeric($limit) || $limit > 2147483647)) { + if (!empty($limit) && !is_numeric($limit)) { trigger_error(_("Illegal “limit” argument: must be an integer or two integers separated by comma")); return array(0, 0); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2021-09-16 15:48:26
|
Revision: 10556 http://sourceforge.net/p/phpwiki/code/10556 Author: vargenau Date: 2021-09-16 15:48:25 +0000 (Thu, 16 Sep 2021) Log Message: ----------- Reorder functions in lib/WikiDB/backend.php Modified Paths: -------------- trunk/lib/WikiDB/backend.php Modified: trunk/lib/WikiDB/backend.php =================================================================== --- trunk/lib/WikiDB/backend.php 2021-09-16 15:23:40 UTC (rev 10555) +++ trunk/lib/WikiDB/backend.php 2021-09-16 15:48:25 UTC (rev 10556) @@ -68,7 +68,6 @@ * this is an abstract base class. It is expected that most efficient * backends will override nearly all the methods in this class. * - * @access protected * @see WikiDB */ @@ -165,46 +164,6 @@ abstract function get_versiondata($pagename, $version, $want_content = false); /** - * Rename page in the database. - * - * @param string $pagename Current page name - * @param string $to Future page name - */ - abstract function rename_page($pagename, $to); - - /** - * Delete page from the database with backup possibility. - * This should remove all links (from the named page) from - * the link database. - * - * @param string $pagename Page name. - * i.e save_page('') and DELETE nonempty id - * Can be undone and is seen in RecentChanges. - */ - abstract function delete_page($pagename); - - /** - * Delete page (and all its revisions) from the database. - * - * @param string $pagename Page name. - */ - abstract function purge_page($pagename); - - /** - * Delete an old revision of a page. - * - * Note that one is never allowed to delete the most recent version, - * but that this requirement is enforced by WikiDB not by the backend. - * - * In fact, to be safe, backends should probably allow the deletion of - * the most recent version. - * - * @param string $pagename Page name. - * @param int $version int Version to delete. - */ - abstract function delete_versiondata($pagename, $version); - - /** * Create a new page revision. * * If the given ($pagename,$version) is already in the database, @@ -230,7 +189,7 @@ * @param array $newdata hash New revision metadata. * @see set_versiondata, get_versiondata */ - function update_versiondata($pagename, $version, $newdata) + public function update_versiondata($pagename, $version, $newdata) { $data = $this->get_versiondata($pagename, $version, true); if (!$data) { @@ -247,14 +206,46 @@ } /** - * Set links for page. + * Delete an old revision of a page. * - * @param string $pagename Page name - * @param array $links List of page(names) which page links to. + * Note that one is never allowed to delete the most recent version, + * but that this requirement is enforced by WikiDB not by the backend. + * + * In fact, to be safe, backends should probably allow the deletion of + * the most recent version. + * + * @param string $pagename Page name. + * @param int $version int Version to delete. */ - abstract function set_links($pagename, $links); + abstract function delete_versiondata($pagename, $version); /** + * Rename page in the database. + * + * @param string $pagename Current page name + * @param string $to Future page name + */ + abstract function rename_page($pagename, $to); + + /** + * Delete page from the database with backup possibility. + * This should remove all links (from the named page) from + * the link database. + * + * @param string $pagename Page name. + * i.e save_page('') and DELETE nonempty id + * Can be undone and is seen in RecentChanges. + */ + abstract function delete_page($pagename); + + /** + * Delete page (and all its revisions) from the database. + * + * @param string $pagename Page name. + */ + abstract function purge_page($pagename); + + /** * Find pages which link to or are linked from a page. * * @param string $pagename Page name @@ -268,19 +259,25 @@ * FIXME: array or iterator? * @return object A WikiDB_backend_iterator. */ - - // FIXME: implement simple (but slow) link finder. abstract function get_links($pagename, $reversed = true, $include_empty = false, $sortby = '', $limit = '', $exclude = '', $want_relations = false); /** + * Set links for page. + * + * @param string $pagename Page name + * @param array $links List of page(names) which page links to. + */ + abstract function set_links($pagename, $links); + + /** * Get all revisions of a page. * * @param string $pagename The page name. * @return object A WikiDB_backend_iterator. */ - function get_all_revisions($pagename) + public function get_all_revisions($pagename) { include_once 'lib/WikiDB/backend/dumb/AllRevisionsIter.php'; return new WikiDB_backend_dumb_AllRevisionsIter($this, $pagename); @@ -406,7 +403,7 @@ return new WikiDB_backend_dumb_MostRecentIter($this, $pages, $params); } - function wanted_pages($exclude_from = '', $exclude = '', $sortby = '', $limit = '') + public function wanted_pages($exclude_from = '', $exclude = '', $sortby = '', $limit = '') { include_once 'lib/WikiDB/backend/dumb/WantedPagesIter.php'; $allpages = $this->get_all_pages(true, false, false, $exclude_from); @@ -448,7 +445,7 @@ * * This should flush all unwritten data to the filesystem. */ - function sync() + public function sync() { } @@ -457,7 +454,7 @@ * * @return bool */ - function optimize() + public function optimize() { return true; } @@ -474,7 +471,7 @@ * @param bool $args * @return bool True iff database is in a consistent state. */ - function check($args = false) + public function check($args = false) { return true; } @@ -489,7 +486,7 @@ * @param bool $args * @return bool True iff successful. */ - function rebuild($args = false) + public function rebuild($args = false) { /** * @var WikiRequest $request This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2023-07-18 14:36:38
|
Revision: 11062 http://sourceforge.net/p/phpwiki/code/11062 Author: vargenau Date: 2023-07-18 14:36:37 +0000 (Tue, 18 Jul 2023) Log Message: ----------- function get_all_pages exclude argument is not always a string, might be an array Modified Paths: -------------- trunk/lib/WikiDB/backend.php Modified: trunk/lib/WikiDB/backend.php =================================================================== --- trunk/lib/WikiDB/backend.php 2023-07-18 14:34:38 UTC (rev 11061) +++ trunk/lib/WikiDB/backend.php 2023-07-18 14:36:37 UTC (rev 11062) @@ -314,7 +314,7 @@ bool $include_empty = false, string $sortby = '', string $limit = '', - string $exclude = '' + $exclude = '' ); /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |