From: <var...@us...> - 2014-07-17 14:14:40
|
Revision: 8974 http://sourceforge.net/p/phpwiki/code/8974 Author: vargenau Date: 2014-07-17 14:14:29 +0000 (Thu, 17 Jul 2014) Log Message: ----------- Add public/protected/private Modified Paths: -------------- trunk/lib/DbSession/ADODB.php trunk/lib/DbSession/PDO.php trunk/lib/DbSession/SQL.php trunk/lib/ErrorManager.php trunk/lib/FileFinder.php trunk/lib/HtmlElement.php trunk/lib/SemanticWeb.php trunk/lib/Template.php trunk/lib/TextSearchQuery.php trunk/lib/WikiCallback.php trunk/lib/WikiDB/adodb/adodb.inc.php trunk/lib/WikiDB/backend/ADODB.php trunk/lib/WikiDB/backend/PDO.php trunk/lib/WikiDB/backend/PearDB.php trunk/lib/WikiDB/backend/dbaBase.php trunk/lib/WikiDB/backend/dumb/AllRevisionsIter.php trunk/lib/WikiDB/backend/file.php trunk/lib/WikiDB/backend.php trunk/lib/WikiDB.php trunk/lib/WikiGroup.php trunk/lib/WikiPluginCached.php trunk/lib/WikiUser/LDAP.php trunk/lib/main.php trunk/lib/plugin/PopularNearby.php trunk/lib/plugin/Transclude.php trunk/lib/plugin/VisualWiki.php trunk/lib/upgrade.php trunk/lib/wikilens/RatingsDb.php Modified: trunk/lib/DbSession/ADODB.php =================================================================== --- trunk/lib/DbSession/ADODB.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/DbSession/ADODB.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -85,9 +85,8 @@ * @param string $session_name a name of the concrete file * @return boolean true just a variable to notify PHP that everything * is good. - * @access private */ - function open($save_path, $session_name) + private function open($save_path, $session_name) { //$this->log("_open($save_path, $session_name)"); return true; @@ -100,9 +99,8 @@ * * @return boolean true just a variable to notify PHP that everything * is good. - * @access private */ - function close() + private function close() { //$this->log("_close()"); return true; @@ -113,9 +111,8 @@ * * @param string $id an id of current session * @return string - * @access private */ - function read($id) + private function read($id) { //$this->log("_read($id)"); $dbh = $this->_connect(); @@ -152,9 +149,8 @@ * @param string $sess_data * @return boolean true if data saved successfully and false * otherwise. - * @access private */ - function write($id, $sess_data) + private function write($id, $sess_data) { if (defined("WIKI_XMLRPC") or defined("WIKI_SOAP")) return false; @@ -202,9 +198,8 @@ * * @param string $id * @return boolean true - * @access private */ - function destroy($id) + private function destroy($id) { $dbh = $this->_connect(); $table = $this->_table; @@ -221,9 +216,8 @@ * * @param int $maxlifetime session's time to live. * @return boolean true - * @access private */ - function gc($maxlifetime) + private function gc($maxlifetime) { $dbh = $this->_connect(); $table = $this->_table; Modified: trunk/lib/DbSession/PDO.php =================================================================== --- trunk/lib/DbSession/PDO.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/DbSession/PDO.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -63,9 +63,8 @@ * @param string $session_name a name of the concrete file * @return boolean true just a variable to notify PHP that everything * is good. - * @access private */ - function open($save_path, $session_name) + private function open($save_path, $session_name) { //$this->log("_open($save_path, $session_name)"); return true; @@ -78,9 +77,8 @@ * * @return boolean true just a variable to notify PHP that everything * is good. - * @access private */ - function close() + private function close() { //$this->log("_close()"); return true; @@ -91,9 +89,8 @@ * * @param string $id an id of current session * @return string - * @access private */ - function read($id) + private function read($id) { //$this->log("_read($id)"); $dbh = $this->_connect(); @@ -135,9 +132,8 @@ * @param string $sess_data * @return boolean true if data saved successfully and false * otherwise. - * @access private */ - function write($id, $sess_data) + private function write($id, $sess_data) { if (defined("WIKI_XMLRPC") or defined("WIKI_SOAP")) return false; @@ -199,9 +195,8 @@ * * @param string $id * @return boolean true - * @access private */ - function destroy($id) + private function destroy($id) { $table = $this->_table; $dbh = $this->_connect(); @@ -217,9 +212,8 @@ * * @param int $maxlifetime session's time to live. * @return boolean true - * @access private */ - function gc($maxlifetime) + private function gc($maxlifetime) { $table = $this->_table; $threshold = time() - $maxlifetime; Modified: trunk/lib/DbSession/SQL.php =================================================================== --- trunk/lib/DbSession/SQL.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/DbSession/SQL.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -70,9 +70,8 @@ * @param string $session_name a name of the concrete file * @return boolean true just a variable to notify PHP that everything * is good. - * @access private */ - function open($save_path, $session_name) + private function open($save_path, $session_name) { //$this->log("_open($save_path, $session_name)"); return true; @@ -85,9 +84,8 @@ * * @return boolean true just a variable to notify PHP that everything * is good. - * @access private */ - function close() + private function close() { //$this->log("_close()"); return true; @@ -98,9 +96,8 @@ * * @param string $id an id of current session * @return string - * @access private */ - function read($id) + private function read($id) { //$this->log("_read($id)"); $dbh = $this->_connect(); @@ -138,9 +135,8 @@ * @param string $sess_data * @return boolean true if data saved successfully and false * otherwise. - * @access private */ - function write($id, $sess_data) + private function write($id, $sess_data) { if (defined("WIKI_XMLRPC") or defined("WIKI_SOAP")) return false; @@ -189,9 +185,8 @@ * * @param string $id * @return boolean true - * @access private */ - function destroy($id) + private function destroy($id) { $dbh = $this->_connect(); $table = $this->_table; @@ -208,9 +203,8 @@ * * @param int $maxlifetime session's time to live. * @return boolean true - * @access private */ - function gc($maxlifetime) + private function gc($maxlifetime) { $dbh = $this->_connect(); $table = $this->_table; Modified: trunk/lib/ErrorManager.php =================================================================== --- trunk/lib/ErrorManager.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/ErrorManager.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -48,9 +48,8 @@ * Constructor. * * As this is a singleton class, you should never call this. - * @access private */ - function ErrorManager() + private function ErrorManager() { $this->_handlers = array(); $this->_fatal_handler = false; @@ -62,10 +61,9 @@ /** * Get mask indicating which errors are currently being postponed. - * @access public * @return int The current postponed error mask. */ - function getPostponedErrorMask() + public function getPostponedErrorMask() { return $this->_postpone_mask; } @@ -78,10 +76,9 @@ * When you set this mask, any queue errors which do not match the new * mask are reported. * - * @access public * @param $newmask int The new value for the mask. */ - function setPostponedErrorMask($newmask) + public function setPostponedErrorMask($newmask) { $this->_postpone_mask = $newmask; if (function_exists('PrintXML')) @@ -93,9 +90,8 @@ /** * Report any queued error messages. - * @access public */ - function flushPostponedErrors() + public function flushPostponedErrors() { if (function_exists('PrintXML')) PrintXML($this->_flush_errors()); @@ -106,9 +102,8 @@ /** * Get rid of all pending error messages in case of all non-html * - pdf or image - output. - * @access public */ - function destroyPostponedErrors() + public function destroyPostponedErrors() { $this->_postponed_errors = array(); } @@ -181,19 +176,17 @@ * handler. This allows the handler to * "adjust" the error message. * </dl> - * @access public * @param $handler WikiCallback Handler to call. */ - function pushErrorHandler($handler) + public function pushErrorHandler($handler) { array_unshift($this->_handlers, $handler); } /** * Pop an error handler off the handler stack. - * @access public */ - function popErrorHandler() + public function popErrorHandler() { return array_shift($this->_handlers); } @@ -205,10 +198,9 @@ * gets passed one argument: a PhpError object describing the * fatal error. * - * @access public * @param $handler WikiCallback Callback to call on fatal errors. */ - function setFatalHandler($handler) + public function setFatalHandler($handler) { $this->_fatal_handler = $handler; } @@ -219,10 +211,9 @@ * The error is passed through any registered error handlers, and * then either reported or postponed. * - * @access public * @param $error object A PhpError object. */ - function handleError($error) + public function handleError($error) { static $in_handler; @@ -317,10 +308,7 @@ $this->handleError(new PhpWikiError($errno, $msg, '?', '?')); } - /** - * @access private - */ - function _die($error) + private function _die($error) { global $WikiTheme; //echo "\n\n<html><body>"; @@ -333,10 +321,7 @@ } } - /** - * @access private - */ - function _flush_errors($keep_mask = 0) + private function _flush_errors($keep_mask = 0) { $errors = &$this->_postponed_errors; if (empty($errors)) return ''; Modified: trunk/lib/FileFinder.php =================================================================== --- trunk/lib/FileFinder.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/FileFinder.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -119,10 +119,9 @@ * Windows95: \ * Mac: : * - * @access private * @return string path_separator. */ - function _get_syspath_separator() + private function _get_syspath_separator() { if (!empty($this->_pathsep)) return $this->_pathsep; elseif (isWindowsNT()) return "/"; // we can safely use '/' @@ -141,10 +140,9 @@ * or use '\' for ours. * * @param string $path - * @access private * @return string path_separator. */ - function _use_path_separator($path) + private function _use_path_separator($path) { if (isWindows95()) { if (empty($path)) return "\\"; @@ -157,11 +155,10 @@ /** * Determine if path is absolute. * - * @access private * @param $path string Path. * @return bool True if path is absolute. */ - function _is_abs($path) + private function _is_abs($path) { if (substr($path, 0, 1) == '/') { return true; @@ -177,11 +174,10 @@ /** * Strip ending '/' or '\' from path. * - * @access private * @param $path string Path. * @return bool New path (destructive) */ - function _strip_last_pathchar(&$path) + private function _strip_last_pathchar(&$path) { if (substr($path, -1) == '/' or substr($path, -1) == "\\") $path = substr($path, 0, -1); @@ -191,11 +187,10 @@ /** * Report a "file not found" error. * - * @access private * @param $file string Name of missing file. * @return bool false. */ - function _not_found($file) + private function _not_found($file) { trigger_error(sprintf(_("%s: file not found"), $file), E_USER_ERROR); return false; @@ -204,12 +199,11 @@ /** * Search our path for a file. * - * @access private * @param $file string File to find. * @return string Directory which contains $file, or false. * [5x,44ms] */ - function _search_path($file) + private function _search_path($file) { foreach ($this->_path as $dir) { // ensure we use the same pathsep @@ -230,10 +224,9 @@ * Fixme: * On Mac it cannot be : because this is the seperator there! * - * @access private * @return string path_separator. */ - function _get_ini_separator() + private function _get_ini_separator() { return isWindows() ? ';' : ':'; // return preg_match('/^Windows/', php_uname()) @@ -242,10 +235,9 @@ /** * Get the value of PHP's include_path. * - * @access private * @return array Include path. */ - function _get_include_path() + private function _get_include_path() { if (defined("INCLUDE_PATH")) $path = INCLUDE_PATH; @@ -264,10 +256,9 @@ * The directory is appended only if it is not already listed in * the include_path. * - * @access private * @param $dir string Directory to add. */ - function _append_to_include_path($dir) + private function _append_to_include_path($dir) { $dir = $this->slashifyPath($dir); if (!in_array($dir, $this->_path)) { @@ -293,10 +284,9 @@ * * The directory is prepended, and removed from the tail if already existing. * - * @access private * @param $dir string Directory to add. */ - function _prepend_to_include_path($dir) + private function _prepend_to_include_path($dir) { $dir = $this->slashifyPath($dir); // remove duplicates @@ -326,10 +316,9 @@ /** * Try to figure out the appropriate value for $LANG. * - * @access private * @return string The value of $LANG. */ - function _get_lang() + private function _get_lang() { if (!empty($GLOBALS['LANG'])) return $GLOBALS['LANG']; Modified: trunk/lib/HtmlElement.php =================================================================== --- trunk/lib/HtmlElement.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/HtmlElement.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -44,10 +44,9 @@ } /** - * @access protected * This is used by the static factory methods is class HTML. */ - function _init2($args) + protected function _init2($args) { if ($args) { if (is_array($args[0])) Modified: trunk/lib/SemanticWeb.php =================================================================== --- trunk/lib/SemanticWeb.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/SemanticWeb.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -309,12 +309,11 @@ * This version unifies the attribute values from the database to a * numeric basevalue before comparison. (area:=963.6km^2 => 9.366e+08 m^2) * - * @access private * @param $value number A numerical value: integer, float or string. * @param $x string The variable name to be replaced in the query. * @return string */ - function _bind($value, $x) + private function _bind($value, $x) { $ori_value = $value; $value = preg_replace("/,/", "", $value); Modified: trunk/lib/Template.php =================================================================== --- trunk/lib/Template.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/Template.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -118,7 +118,6 @@ * Substitute HTML replacement text for tokens in template. * * Constructs a new WikiTemplate based upon the named template. - * @access public * @param string $varname Name of token to substitute for. * @param string $value Replacement HTML text. */ Modified: trunk/lib/TextSearchQuery.php =================================================================== --- trunk/lib/TextSearchQuery.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/TextSearchQuery.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -363,12 +363,11 @@ * So always when the placeholder is an array, the names of the target struct must match * and all vars be defined. Use the method can_match($struct) therefore. * - * @access public * @param $search_query string A numerical query with placeholders as variable. * @param $placeholders array or string All placeholders in the query must be defined * here, and will be replaced by the matcher. */ - function NumericSearchQuery($search_query, $placeholders) + public function NumericSearchQuery($search_query, $placeholders) { // added some basic security checks against user input $this->_query = $search_query; @@ -492,7 +491,6 @@ * Strip non-numeric chars from the variable (as the groupseperator) and replace * it in the symbolic query for evaluation. * - * @access private * @param $value number A numerical value: integer, float or string. * @param $x string The variable name to be replaced in the query. * @return string @@ -520,12 +518,11 @@ * With an array of placeholders we need a hash to check against, if all required names are given. * Purpose: Be silent about missing vars, just return false. `* - * @access public * @param string $variables string or hash of name => value The keys must satisfy all placeholders in the definition. * We want the full hash and not just the keys because a hash check is faster than the array of keys check. * @return boolean */ - function can_match(&$variables) + public function can_match(&$variables) { if (empty($this->_query)) return false; @@ -548,11 +545,10 @@ * With one placeholder we need just a number. * With an array of placeholders we need a hash. * - * @access public * @param $variable number or array of name => value The keys must satisfy all placeholders in the definition. * @return boolean */ - function match(&$variable) + public function match(&$variable) { $p =& $this->_placeholders; $this->workquery = $this->_query; Modified: trunk/lib/WikiCallback.php =================================================================== --- trunk/lib/WikiCallback.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/WikiCallback.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -24,9 +24,8 @@ * the first element should contain (a reference to) the object, the second * element should be a string containing the name of the method to be invoked. * @return object Returns the appropriate subclass of WikiCallback. - * @access public */ - function callback($pearCb) + public function callback($pearCb) { if (is_string($pearCb)) return new WikiFunctionCb($pearCb); @@ -43,9 +42,8 @@ * @param ? mixed This method takes a variable number of arguments (zero or more). * The callback function is called with the specified arguments. * @return mixed The return value of the callback. - * @access public */ - function call() + public function call() { return $this->call_array(func_get_args()); } @@ -56,9 +54,8 @@ * @param $args array Contains the arguments to be passed to the callback. * @return mixed The return value of the callback. * @see call_user_func_array. - * @access public */ - function call_array($args) + public function call_array($args) { trigger_error('pure virtual', E_USER_ERROR); } @@ -69,9 +66,8 @@ * @return string The name of the callback function. * (This value is suitable for passing as the callback parameter * to a number of different Pear functions and methods.) - * @access public */ - function toPearCb() + public function toPearCb() { trigger_error('pure virtual', E_USER_ERROR); } @@ -87,9 +83,8 @@ * Constructor * * @param $functionName string Name of global function to call. - * @access public */ - function WikiFunctionCb($functionName) + public function WikiFunctionCb($functionName) { $this->functionName = $functionName; } @@ -116,9 +111,8 @@ * * @param $object object Object on which to invoke method. * @param $methodName string Name of method to call. - * @access public */ - function WikiMethodCb(&$object, $methodName) + public function WikiMethodCb(&$object, $methodName) { $this->object = &$object; $this->methodName = $methodName; @@ -148,9 +142,8 @@ * @param $args string Argument declarations * @param $code string Function body * @see create_function(). - * @access public */ - function WikiAnonymousCb($args, $code) + public function WikiAnonymousCb($args, $code) { $this->function = create_function($args, $code); } Modified: trunk/lib/WikiDB/adodb/adodb.inc.php =================================================================== --- trunk/lib/WikiDB/adodb/adodb.inc.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/WikiDB/adodb/adodb.inc.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -2142,10 +2142,9 @@ * @param mixed $primkeyArr * @param array $extra Query extras: limit, offset... * @param mixed $relations Associative array: table's foreign name, "hasMany", "belongsTo" - * @access public * @return void */ - function GetActiveRecordsClass( + public function GetActiveRecordsClass( $class, $table,$whereOrderBy=false,$bindarr=false, $primkeyArr=false, $extra=array(), $relations=array()) Modified: trunk/lib/WikiDB/backend/ADODB.php =================================================================== --- trunk/lib/WikiDB/backend/ADODB.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/WikiDB/backend/ADODB.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -1207,10 +1207,8 @@ * * Calls can be nested. The tables won't be unlocked until * _unlock_database() is called as many times as _lock_database(). - * - * @access protected */ - function lock($tables, $write_lock = true) + protected function lock($tables, $write_lock = true) { $this->_dbh->StartTrans(); if ($this->_lock_count++ == 0) { @@ -1230,14 +1228,12 @@ /** * Release a write lock on the tables in the SQL database. * - * @access protected - * * @param $force boolean Unlock even if not every call to lock() has been matched * by a call to unlock(). * * @see _lock_database */ - function unlock($tables = false, $force = false) + protected function unlock($tables = false, $force = false) { if ($this->_lock_count == 0) { $this->_current_lock = false; Modified: trunk/lib/WikiDB/backend/PDO.php =================================================================== --- trunk/lib/WikiDB/backend/PDO.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/WikiDB/backend/PDO.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -1164,10 +1164,8 @@ * * Calls can be nested. The tables won't be unlocked until * _unlock_database() is called as many times as _lock_database(). - * - * @access protected */ - function lock($tables, $write_lock = true) + protected function lock($tables, $write_lock = true) { if ($this->_lock_count++ == 0) { $this->_current_lock = $tables; @@ -1191,14 +1189,12 @@ /** * Release a write lock on the tables in the SQL database. * - * @access protected - * * @param $force boolean Unlock even if not every call to lock() has been matched * by a call to unlock(). * * @see _lock_database */ - function unlock($tables = false, $force = false) + protected function unlock($tables = false, $force = false) { if ($this->_lock_count == 0) { $this->_current_lock = false; Modified: trunk/lib/WikiDB/backend/PearDB.php =================================================================== --- trunk/lib/WikiDB/backend/PearDB.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/WikiDB/backend/PearDB.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -1005,10 +1005,8 @@ * * Calls can be nested. The tables won't be unlocked until * _unlock_database() is called as many times as _lock_database(). - * - * @access protected */ - function lock($tables = false, $write_lock = true) + protected function lock($tables = false, $write_lock = true) { if ($this->_lock_count++ == 0) $this->_lock_tables($write_lock); @@ -1025,14 +1023,12 @@ /** * Release a write lock on the tables in the SQL database. * - * @access protected - * * @param $force boolean Unlock even if not every call to lock() has been matched * by a call to unlock(). * * @see _lock_database */ - function unlock($tables = false, $force = false) + protected function unlock($tables = false, $force = false) { if ($this->_lock_count == 0) return; @@ -1073,11 +1069,9 @@ /** * Callback for PEAR (DB) errors. * - * @access protected - * * @param A PEAR_error object. */ - function _pear_error_callback($error) + protected function _pear_error_callback($error) { if ($this->_is_false_error($error)) return; @@ -1095,10 +1089,9 @@ * return any data. (So when a "LOCK" command doesn't return any data, * DB reports it as an error, when in fact, it's not.) * - * @access private * @return bool True iff error is not really an error. */ - function _is_false_error($error) + private function _is_false_error($error) { if ($error->getCode() != DB_ERROR) return false; @@ -1148,9 +1141,8 @@ * errors and notices. This is an error callback (for use with * ErrorManager which will filter out those spurious messages.) * @see _is_false_error, ErrorManager - * @access private */ - function _pear_notice_filter($err) + private function _pear_notice_filter($err) { return ($err->isNotice() && preg_match('|DB[/\\\\]common.php$|', $err->errfile) Modified: trunk/lib/WikiDB/backend/dbaBase.php =================================================================== --- trunk/lib/WikiDB/backend/dbaBase.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/WikiDB/backend/dbaBase.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -398,12 +398,10 @@ } /** - * @access public - * * @return array of all linkrelations * Faster than the dumb WikiDB method. */ - function list_relations($also_attributes = false, + public function list_relations($also_attributes = false, $only_attributes = false, $sorted = true) { Modified: trunk/lib/WikiDB/backend/dumb/AllRevisionsIter.php =================================================================== --- trunk/lib/WikiDB/backend/dumb/AllRevisionsIter.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/WikiDB/backend/dumb/AllRevisionsIter.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -12,11 +12,10 @@ /** * Constructor. * - * @access protected * @param $backend object A WikiDB_backend. * @param $pagename string Page whose revisions to get. */ - function WikiDB_backend_dumb_AllRevisionsIter(&$backend, $pagename) + protected function WikiDB_backend_dumb_AllRevisionsIter(&$backend, $pagename) { $this->_backend = &$backend; $this->_pagename = $pagename; Modified: trunk/lib/WikiDB/backend/file.php =================================================================== --- trunk/lib/WikiDB/backend/file.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/WikiDB/backend/file.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -399,10 +399,8 @@ /** * Rename all files for this page - * - * @access protected Via WikiDB */ - function rename_page($pagename, $to) + protected function rename_page($pagename, $to) { $version = _getLatestVersion($pagename); foreach ($this->_dir_names as $type => $path) { @@ -581,8 +579,6 @@ * Pages should be returned in alphabetical order if that is * feasable. * - * @access protected - * * @param $include_defaulted boolean * If set, even pages with no content will be returned * --- but still only if they have at least one revision (not @@ -594,7 +590,7 @@ * * @return object A WikiDB_backend_iterator. */ - function get_all_pages($include_empty = false, $sortby = '', $limit = '', $exclude = '') + protected function get_all_pages($include_empty = false, $sortby = '', $limit = '', $exclude = '') { require_once 'lib/PageList.php'; $this->_loadLatestVersions(); Modified: trunk/lib/WikiDB/backend.php =================================================================== --- trunk/lib/WikiDB/backend.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/WikiDB/backend.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -329,8 +329,6 @@ * Pages should be returned in alphabetical order if that is * feasable. * - * @access protected - * * @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 @@ -345,7 +343,7 @@ * @param string $exclude * @return object A WikiDB_backend_iterator. */ - function get_all_pages($include_defaulted, $orderby = false, $limit = '', $exclude = '') + protected function get_all_pages($include_defaulted, $orderby = false, $limit = '', $exclude = '') { trigger_error("virtual", E_USER_ERROR); } @@ -356,8 +354,6 @@ * Pages should be returned in alphabetical order if that is * feasible. * - * @access protected - * * @param object $search object A TextSearchQuery object describing the parsed query string, * with efficient methods for SQL and PCRE match. * @@ -372,7 +368,7 @@ * * @see WikiDB::titleSearch */ - function text_search($search, $fulltext = false, $sortby = '', + protected function text_search($search, $fulltext = false, $sortby = '', $limit = '', $exclude = '') { // This method implements a simple linear search @@ -390,7 +386,6 @@ /** * - * @access protected * @param object $pages A TextSearchQuery object. * @param object $linkvalue A TextSearchQuery object for the link values * (linkto, relation or backlinks or attribute values). @@ -400,7 +395,7 @@ * @return object A WikiDB_backend_iterator. * @see WikiDB::linkSearch */ - function link_search($pages, $linkvalue, $linktype, $relation = false, $options = array()) + protected function link_search($pages, $linkvalue, $linktype, $relation = false, $options = array()) { include_once 'lib/WikiDB/backend/dumb/LinkSearchIter.php'; $pageiter = $this->text_search($pages); @@ -413,12 +408,11 @@ * Find the pages with the highest hit counts. The pages should * be returned in reverse order by hit count. * - * @access protected * @param int $limit No more than this many pages * @param string $sortby * @return object A WikiDB_backend_iterator. */ - function most_popular($limit, $sortby = '-hits') + protected function most_popular($limit, $sortby = '-hits') { // This is method fetches all pages, then // sorts them by hit count. @@ -434,13 +428,12 @@ /** * Find recent changes. * - * @access protected * @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 */ - function most_recent($params) + protected function most_recent($params) { // This method is very inefficient and searches through // all pages for the most recent changes. Modified: trunk/lib/WikiDB.php =================================================================== --- trunk/lib/WikiDB.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/WikiDB.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -47,8 +47,6 @@ * arguments to determine the proper subclass of WikiDB to * instantiate, and then it instantiates it. * - * @access public - * * @param hash $dbparams Database configuration parameters. * Some pertinent parameters are: * <dl> @@ -98,7 +96,7 @@ * * @return WikiDB A WikiDB object. **/ - function open($dbparams) + public function open($dbparams) { $dbtype = $dbparams{'dbtype'}; include_once("lib/WikiDB/$dbtype.php"); @@ -110,10 +108,9 @@ /** * Constructor. * - * @access private * @see open() */ - function WikiDB(&$backend, $dbparams) + private function WikiDB(&$backend, $dbparams) { $this->_backend =& $backend; // don't do the following with the auth_dsn! @@ -142,10 +139,8 @@ * Closing a WikiDB invalidates all <tt>WikiDB_Page</tt>s, * <tt>WikiDB_PageRevision</tt>s and <tt>WikiDB_PageIterator</tt>s * which have been obtained from it. - * - * @access public */ - function close() + public function close() { $this->_backend->close(); $this->_cache->close(); @@ -157,11 +152,10 @@ * A {@link WikiDB} consists of the (infinite) set of all possible pages, * therefore this method never fails. * - * @access public * @param string $pagename Which page to get. * @return WikiDB_Page The requested WikiDB_Page. */ - function getPage($pagename) + public function getPage($pagename) { static $error_displayed = false; $pagename = (string)$pagename; @@ -195,12 +189,11 @@ * however isWikiPage may be implemented in a more efficient * manner in certain back-ends. * - * @access public * @param string $pagename string Which page to check. * @return boolean True if the page actually exists with * non-default contents in the WikiDataBase. */ - function isWikiPage($pagename) + public function isWikiPage($pagename) { $page = $this->getPage($pagename); return ($page and $page->exists()); @@ -214,12 +207,11 @@ * * Note: purgePage() effectively destroys all revisions of the page from the WikiDB. * - * @access public * @param string $pagename Name of page to delete. * @see purgePage * @return mixed */ - function deletePage($pagename) + public function deletePage($pagename) { if (!empty($this->readonly)) { trigger_error("readonly database", E_USER_WARNING); @@ -252,11 +244,10 @@ /** * Completely remove the page from the WikiDB, without undo possibility. - * @access public * @param string $pagename Name of page to delete. * @see deletePage */ - function purgePage($pagename) + public function purgePage($pagename) { if (!empty($this->readonly)) { trigger_error("readonly database", E_USER_WARNING); @@ -272,8 +263,6 @@ * * Gets the set of all pages with non-default contents. * - * @access public - * * @param bool $include_empty Optional. Normally pages whose most * recent revision has empty content are considered to be * non-existant. Unless $include_defaulted is set to true, those @@ -287,7 +276,7 @@ * @return WikiDB_PageIterator A WikiDB_PageIterator which contains all pages * in the WikiDB which have non-default contents. */ - function getAllPages($include_empty = false, $sortby = '', $limit = '', $exclude = '') + public function getAllPages($include_empty = false, $sortby = '', $limit = '', $exclude = '') { $result = $this->_backend->get_all_pages($include_empty, $sortby, $limit, $exclude); @@ -299,15 +288,13 @@ } /** - * @access public - * * @param boolean $include_empty If true include also empty pages * @param string $exclude: comma-separated list of pagenames. * TBD: array of pagenames * @return integer * */ - function numPages($include_empty = false, $exclude = '') + public function numPages($include_empty = false, $exclude = '') { if (method_exists($this->_backend, 'numPages')) // FIXME: currently are all args ignored. @@ -331,7 +318,6 @@ * practical to do so. * TODO: Sort by ranking. Only postgresql with tsearch2 can do ranking so far. * - * @access public * @param TextSearchQuery $search A TextSearchQuery object * @param string $sortby Optional. "+-column,+-column2". * If false the result is faster in natural order. @@ -341,7 +327,7 @@ * @return WikiDB_PageIterator A WikiDB_PageIterator containing the matching pages. * @see TextSearchQuery */ - function titleSearch($search, $sortby = 'pagename', $limit = '', $exclude = '') + public function titleSearch($search, $sortby = 'pagename', $limit = '', $exclude = '') { $result = $this->_backend->text_search($search, false, $sortby, $limit, $exclude); $options = array('exclude' => $exclude, @@ -361,8 +347,6 @@ * practical to do so. * TODO: Sort by ranking. Only postgresql with tsearch2 can do ranking so far. * - * @access public - * * @param TextSearchQuery $search A TextSearchQuery object. * @param string $sortby Optional. "+-column,+-column2". * If false the result is faster in natural order. @@ -372,7 +356,7 @@ * @return WikiDB_PageIterator A WikiDB_PageIterator containing the matching pages. * @see TextSearchQuery */ - function fullSearch($search, $sortby = 'pagename', $limit = '', $exclude = '') + public function fullSearch($search, $sortby = 'pagename', $limit = '', $exclude = '') { $result = $this->_backend->text_search($search, true, $sortby, $limit, $exclude); return new WikiDB_PageIterator($this, $result, @@ -387,8 +371,6 @@ * * Pages are returned in reverse order by hit count. * - * @access public - * * @param int $limit The maximum number of pages to return. * Set $limit to zero to return all pages. If $limit < 0, pages will * be sorted in decreasing order of popularity. @@ -398,7 +380,7 @@ * @return WikiDB_PageIterator A WikiDB_PageIterator containing the matching * pages. */ - function mostPopular($limit = 20, $sortby = '-hits') + public function mostPopular($limit = 20, $sortby = '-hits') { $result = $this->_backend->most_popular($limit, $sortby); return new WikiDB_PageIterator($this, $result); @@ -409,8 +391,6 @@ * * Revisions are returned in reverse order by creation time. * - * @access public - * * @param array $params This hash is used to specify various optional * parameters: * <dl> @@ -433,15 +413,13 @@ * @return WikiDB_PageRevisionIterator A WikiDB_PageRevisionIterator * containing the matching revisions. */ - function mostRecent($params = array()) + public function mostRecent($params = array()) { $result = $this->_backend->most_recent($params); return new WikiDB_PageRevisionIterator($this, $result); } /** - * @access public - * * @param string $exclude_from * @param string $exclude * @param string $sortby Optional. "+-column,+-column2". @@ -451,7 +429,7 @@ * @return Iterator A generic iterator containing rows of * (duplicate) pagename, wantedfrom. */ - function wantedPages($exclude_from = '', $exclude = '', $sortby = '', $limit = '') + public function wantedPages($exclude_from = '', $exclude = '', $sortby = '', $limit = '') { return $this->_backend->wanted_pages($exclude_from, $exclude, $sortby, $limit); } @@ -460,8 +438,6 @@ * Generic interface to the link table. Esp. useful to search for rdf triples as in * SemanticSearch and ListRelations. * - * @access public - * * @param object $pages A TextSearchQuery object. * @param object $search A TextSearchQuery object. * @param string $linktype One of "linkto", "linkfrom", "relation", "attribute". @@ -482,7 +458,7 @@ * @return Iterator A generic iterator containing links to pages or values. * hash of "pagename", "linkname", "linkvalue. */ - function linkSearch($pages, $search, $linktype, $relation = false) + public function linkSearch($pages, $search, $linktype, $relation = false) { return $this->_backend->link_search($pages, $search, $linktype, $relation); } @@ -491,13 +467,12 @@ * Return a simple list of all defined relations (and attributes), mainly * for the SemanticSearch autocompletion. * - * @access public * @param bool $also_attributes * @param bool $only_attributes * @param bool $sorted * @return array of strings */ - function listRelations($also_attributes = false, $only_attributes = false, $sorted = true) + public function listRelations($also_attributes = false, $only_attributes = false, $sorted = true) { if (method_exists($this->_backend, "list_relations")) return $this->_backend->list_relations($also_attributes, $only_attributes, $sorted); @@ -525,13 +500,12 @@ /** * Call the appropriate backend method. * - * @access public * @param string $from Page to rename * @param string $to New name * @param boolean $updateWikiLinks If the text in all pages should be replaced. * @return boolean true or false */ - function renamePage($from, $to, $updateWikiLinks = false) + public function renamePage($from, $to, $updateWikiLinks = false) { if (!empty($this->readonly)) { trigger_error("readonly database", E_USER_WARNING); @@ -647,8 +621,6 @@ * NOTE: this is currently implemented in a hackish and * not very efficient manner. * - * @access public - * * @param string $key Which meta data to get. * Some reserved meta-data keys are: * <dl> @@ -658,7 +630,7 @@ * @return scalar The requested value, or false if the requested data * is not set. */ - function get($key) + public function get($key) { if (!$key || $key[0] == '%') return false; @@ -682,12 +654,11 @@ * not very efficient manner. * * @see get - * @access public * * @param string $key Meta-data key to set. * @param string $newval New value. */ - function set($key, $newval) + public function set($key, $newval) { if (!empty($this->readonly)) { trigger_error("readonly database", E_USER_WARNING); @@ -795,11 +766,9 @@ /** * Get the name of the wiki page. * - * @access public - * * @return string The page name. */ - function getName() + public function getName() { return $this->_pagename; } @@ -821,12 +790,10 @@ * Deletes the specified revision of the page. * It is a fatal error to attempt to delete the current revision. * - * @access public - * * @param integer $version Which revision to delete. (You can also * use a WikiDB_PageRevision object here.) */ - function deleteRevision($version) + public function deleteRevision($version) { if ($this->_wikidb->readonly) { trigger_error("readonly database", E_USER_WARNING); @@ -932,8 +899,6 @@ /** * Create a new revision of a {@link WikiDB_Page}. * - * @access public - * * @param int $version Version number for new revision. * To ensure proper serialization of edits, $version must be * exactly one higher than the current latest version. @@ -950,7 +915,7 @@ * @return WikiDB_PageRevision Returns the new WikiDB_PageRevision object. If * $version was incorrect, returns false */ - function createRevision($version, &$content, $metadata, $links) + public function createRevision($version, &$content, $metadata, $links) { if ($this->_wikidb->readonly) { trigger_error("readonly database", E_USER_WARNING); @@ -1107,11 +1072,10 @@ /** * Get the most recent revision of a page. * - * @access public * @param bool $need_content * @return WikiDB_PageRevision The current WikiDB_PageRevision object. */ - function getCurrentRevision($need_content = true) + public function getCurrentRevision($need_content = true) { $backend = &$this->_wikidb->_backend; $cache = &$this->_wikidb->_cache; @@ -1135,15 +1099,13 @@ /** * Get a specific revision of a WikiDB_Page. * - * @access public - * * @param int $version Which revision to get. * @param bool $need_content * @return WikiDB_PageRevision The requested WikiDB_PageRevision object, or * false if the requested revision does not exist in the {@link WikiDB}. * Note that version zero of any page always exists. */ - function getRevision($version, $need_content = true) + public function getRevision($version, $need_content = true) { $cache = &$this->_wikidb->_cache; $pagename = &$this->_pagename; @@ -1167,8 +1129,6 @@ * This method find the most recent revision before a specified * version. * - * @access public - * * @param bool|int $version Find most recent revision before this version. * You can also use a WikiDB_PageRevision object to specify the $version. * @@ -1179,7 +1139,7 @@ * unless $version is greater than zero, a revision (perhaps version zero, * the default revision) will always be found. */ - function getRevisionBefore($version = false, $need_content = true) + public function getRevisionBefore($version = false, $need_content = true) { $backend = &$this->_wikidb->_backend; $pagename = &$this->_pagename; @@ -1221,8 +1181,6 @@ * as 'linkrelation' key as pagename. See WikiDB_PageIterator::next * if (isset($next['linkrelation'])) * - * @access public - * * @param bool $reversed Which links to find: true for backlinks (default). * @param bool $include_empty * @param string $sortby @@ -1233,7 +1191,7 @@ * @return WikiDB_PageIterator A WikiDB_PageIterator containing * all matching pages. */ - function getLinks($reversed = true, $include_empty = false, $sortby = '', + public function getLinks($reversed = true, $include_empty = false, $sortby = '', $limit = '', $exclude = '', $want_relations = false) { $backend = &$this->_wikidb->_backend; @@ -1318,8 +1276,6 @@ /** * Access WikiDB_Page non version-specific meta-data. * - * @access public - * * @param string $key Which meta data to get. * Some reserved meta-data keys are: * <dl> @@ -1341,7 +1297,7 @@ * @return scalar The requested value, or false if the requested data * is not set. */ - function get($key) + public function get($key) { $cache = &$this->_wikidb->_cache; $backend = &$this->_wikidb->_backend; @@ -1381,12 +1337,11 @@ * Set page meta-data. * * @see get - * @access public * * @param string $key Meta-data key to set. * @param string $newval New value. */ - function set($key, $newval) + public function set($key, $newval) { $cache = &$this->_wikidb->_cache; $backend = &$this->_wikidb->_backend; @@ -1436,10 +1391,8 @@ * * Note that this method may be implemented in more efficient ways * in certain backends. - * - * @access public */ - function increaseHitCount() + public function increaseHitCount() { if ($this->_wikidb->readonly) { trigger_error("readonly database", E_USER_NOTICE); @@ -1458,11 +1411,9 @@ * * This is really only for debugging. * - * @access public - * * @return string Printable representation of the WikiDB_Page. */ - function asString() + public function asString() { ob_start(); printf("[%s:%s\n", get_class($this), $this->getName()); @@ -1474,13 +1425,12 @@ } /** - * @access private * @param int|object $version_or_pagerevision * Takes either the version number (and int) or a WikiDB_PageRevision * object. * @return integer The version number. */ - function _coerce_to_version($version_or_pagerevision) + private function _coerce_to_version($version_or_pagerevision) { if (method_exists($version_or_pagerevision, "getContent")) $version = $version_or_pagerevision->getVersion(); @@ -1578,11 +1528,9 @@ /** * Get the WikiDB_Page which this revision belongs to. * - * @access public - * * @return WikiDB_Page The WikiDB_Page which this revision belongs to. */ - function getPage() + public function getPage() { return new WikiDB_Page($this->_wikidb, $this->_pagename); } @@ -1590,11 +1538,9 @@ /** * Get the version number of this revision. * - * @access public - * * @return integer The version number of this revision. */ - function getVersion() + public function getVersion() { return $this->_version; } @@ -1609,11 +1555,9 @@ * Describe [ThisPage] here. * </pre> * - * @access public - * * @return boolean Returns true if the page has default content. */ - function hasDefaultContents() + public function hasDefaultContents() { $data = &$this->_data; if (!isset($data['%content'])) return true; @@ -1624,12 +1568,10 @@ /** * Get the content as an array of lines. * - * @access public - * * @return array An array of lines. * The lines should contain no trailing white space. */ - function getContent() + public function getContent() { return explode("\n", $this->getPackedContent()); } @@ -1637,11 +1579,9 @@ /** * Get the pagename of the revision. * - * @access public - * * @return string pagename. */ - function getPageName() + public function getPageName() { return $this->_pagename; } @@ -1654,11 +1594,9 @@ /** * Determine whether revision is the latest. * - * @access public - * * @return boolean True iff the revision is the latest (most recent) one. */ - function isCurrent() + public function isCurrent() { if (!isset($this->_iscurrent)) { $page = $this->getPage(); @@ -1736,12 +1674,10 @@ /** * Get the content as a string. * - * @access public - * * @return string The page content. * Lines are separated by new-lines. */ - function getPackedContent() + public function getPackedContent() { $data = &$this->_data; @@ -1815,9 +1751,6 @@ /** * Get meta-data for this revision. * - * - * @access public - * * @param string $key Which meta-data to access. * * Some reserved revision meta-data keys are: @@ -1854,7 +1787,7 @@ * @return string The requested value, or false if the requested value * is not defined. */ - function get($key) + public function get($key) { if (!$key || $key[0] == '%') return false; @@ -1882,11 +1815,9 @@ * * This is really only for debugging. * - * @access public - * * @return string Printable representation of the WikiDB_Page. */ - function asString() + public function asString() { ob_start(); printf("[%s:%d\n", get_class($this), $this->get('version')); @@ -1927,11 +1858,9 @@ /** * Get next WikiDB_Page in sequence. * - * @access public - * * @return WikiDB_Page The next WikiDB_Page in the sequence. */ - function next() + public function next() { if (!($next = $this->_iter->next())) { return false; @@ -1978,10 +1907,8 @@ * (I.e. if you iterate through all the pages in the sequence, * you do not need to call free() --- you only need to call it * if you stop before the end of the iterator is reached.) - * - * @access public */ - function free() + public function free() { // $this->_iter->free(); } @@ -2074,12 +2001,10 @@ /** * Get next WikiDB_PageRevision in sequence. * - * @access public - * * @return WikiDB_PageRevision * The next WikiDB_PageRevision in the sequence. */ - function next() + public function next() { if (!($next = $this->_revisions->next())) return false; @@ -2121,10 +2046,8 @@ * (I.e. if you iterate through all the revisions in the sequence, * you do not need to call free() --- you only need to call it * if you stop before the end of the iterator is reached.) - * - * @access public */ - function free() + public function free() { $this->_revisions->free(); } Modified: trunk/lib/WikiGroup.php =================================================================== --- trunk/lib/WikiGroup.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/WikiGroup.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -531,9 +531,8 @@ * @param object $group_page WikiDB_Page object for the group's page * @param bool $strict * @return boolean True if user is a member, else false. - * @access private */ - function _inGroupPage($group_page, $strict = false) + private function _inGroupPage($group_page, $strict = false) { $group_revision = $group_page->getCurrentRevision(); if ($group_revision->hasDefaultContents()) { Modified: trunk/lib/WikiPluginCached.php =================================================================== --- trunk/lib/WikiPluginCached.php 2014-07-17 12:51:09 UTC (rev 8973) +++ trunk/lib/WikiPluginCached.php 2014-07-17 14:14:29 UTC (rev 8974) @@ -69,12 +69,11 @@ * @param array $argarray all parameters (including those set to * default values) of the plugin call to be * prepared - * @access private * @return array(id,url) * * TODO: check if args is needed at all (on lost cache) */ - function genUrl($cache, $argarray) + private function genUrl($cache, $argarray) { global $request; //$cacheparams = $GLOBALS['CacheParams']; @@ -125,7 +124,6 @@ * Have a close look on the arguments and required return values, * however. </b> * - * @access protected * @param WikiDB $dbi database abstraction class * @param string $argstr plugin arguments in the call from PhpWiki * @param Request $request @@ -136,7 +134,7 @@ * @see #getImage * @see #getMap */ - function run($dbi, $argstr, &$request, $basepage) + protected function run($dbi, $argstr, &$request, $basepage) { $cache = $this->newCache(); //$cacheparams = $GLOBALS['CacheParams']; @@ -262,7 +260,6 @@ * Sets the type of the plugin to html, image or map * production * - * @access protected * @return int determines the plugin to produce either html, * an image or an image map; uses on of the * following predefined values @@ -273,7 +270,7 @@ * <li>PLUGIN_CACHED_MAP</li> * </ul> */ - function getPluginType() + protected function getPluginType() { return PLUGIN_CACHED_IMG_ONDEMAND; } @@ -284,7 +281,6 @@ * <code>getPluginType</code> is set to * PLUGIN_CACHED_IMG_INLINE or PLUGIN_CACHED_IMG_ONDEMAND. * - * @access protected pure virtual * @param WikiDB $dbi database abstraction class * @param array $argarray complete (!) arguments to produce * image. It is not necessary to call @@ -293,7 +289,7 @@ * @return mixed imagehandle image handle if successful * false if an error occured */ - function getImage($dbi, $argarray, $request) + protected function getImage($dbi, $argarray, $request) { trigger_error('WikiPluginCached::getImage: pure virtual function in file ' . __FILE__ . ' line ' . __LINE__, E_USER_ERROR); @@ -308,7 +304,6 @@ * sufficient, the expire time is ignored and removing * is determined by the last "touch" of the entry. * - * @access protected virtual * @param WikiDB $dbi database abstraction class * @param array $argarray complete (!) arguments. It is * not necessary to call @@ -317,7 +312,7 @@ * @return string format: '+seconds' * '0' never expires */ - function getExpire($dbi, $argarray, $request) + protected function getExpire($dbi, $argarray, $request) { return '0'; // persist forever } @@ -326,7 +321,6 @@ * Decides the image type of an image output. * Always used unless plugin type is PLUGIN_CACHED_HTML. * - * @access protected virtual * @param WikiDB $dbi database abstraction class * @param array $argarray complete (!) arguments. It is * not necessary to call @@ -334,7 +328,7 @@ * @param Request $request * @return string 'png', 'jpeg' or 'gif' */ - function getImageType(&$dbi, $argarray, &$request) + protected function getImageType(&$dbi, $argarray, &$request) { if (in_array($argarray['imgtype'], preg_split('/\s*:\s*/', PLUGIN_CACHED_IMGTYPES))) return $argarray['imgtype']; @@ -346,7 +340,6 @@ * Produces the alt text for an image. * <code> &l... [truncated message content] |