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. |