From 3d4ea7c485055b27c2a25f249d8cc9221a76bb9f Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Thu, 11 May 2006 19:46:58 +0000 Subject: [PATCH] public / private / static stuff when loading Special:Recentchanges --- includes/ChangesList.php | 19 +++++++++++++------ includes/Feed.php | 11 ++++++----- includes/RecentChange.php | 36 +++++++++++++++++++++--------------- includes/Title.php | 4 ++-- 4 files changed, 42 insertions(+), 28 deletions(-) diff --git a/includes/ChangesList.php b/includes/ChangesList.php index 59c410fe98..f8c8585403 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -14,12 +14,19 @@ require_once("RecentChange.php"); */ class RCCacheEntry extends RecentChange { - var $secureName, $link; - var $curlink , $difflink, $lastlink , $usertalklink , $versionlink ; - var $userlink, $timestamp, $watched; - - function newFromParent( $rc ) - { + private + $curlink, + $difflink, + $lastlink, + $link, + $secureName, + $timestamp, + $userlink, + $usertalklink, + $versionlink, + $watched ; + + function newFromParent( $rc ) { $rc2 = new RCCacheEntry; $rc2->mAttribs = $rc->mAttribs; $rc2->mExtra = $rc->mExtra; diff --git a/includes/Feed.php b/includes/Feed.php index 7663e8208f..fb32445fc1 100644 --- a/includes/Feed.php +++ b/includes/Feed.php @@ -35,11 +35,12 @@ class FeedItem { * @var string * @private */ - var $Title = 'Wiki'; - var $Description = ''; - var $Url = ''; - var $Date = ''; - var $Author = ''; + private + $Author = '', + $Date = '', + $Description = '', + $Title = 'Wiki', + $Url = '' ; /**#@-*/ /**#@+ diff --git a/includes/RecentChange.php b/includes/RecentChange.php index 659e688455..26d72abdbb 100644 --- a/includes/RecentChange.php +++ b/includes/RecentChange.php @@ -39,23 +39,29 @@ * @todo document functions and variables * @package MediaWiki */ -class RecentChange -{ - var $mAttribs = array(), $mExtra = array(); - var $mTitle = false, $mMovedToTitle = false; - var $numberofWatchingusers = 0 ; # Dummy to prevent error message in SpecialRecentchangeslinked +class RecentChange { + + private + $mExtra = array(), + $mMovedToTitle = false, + $mTitle = false; + + /** @todo FIXME should those really be public ? */ + public + $mAttribs = array(); + + public + $numberofWatchingusers = 0 ; # Dummy to prevent error message in SpecialRecentchangeslinked # Factory methods - /* static */ function newFromRow( $row ) - { + static function newFromRow( $row ) { $rc = new RecentChange; $rc->loadFromRow( $row ); return $rc; } - /* static */ function newFromCurRow( $row, $rc_this_oldid = 0 ) - { + static function newFromCurRow( $row, $rc_this_oldid = 0 ) { $rc = new RecentChange; $rc->loadFromCurRow( $row, $rc_this_oldid ); $rc->notificationtimestamp = false; @@ -196,7 +202,7 @@ class RecentChange } # Makes an entry in the database corresponding to an edit - /*static*/ function notifyEdit( $timestamp, &$title, $minor, &$user, $comment, + static function notifyEdit( $timestamp, &$title, $minor, &$user, $comment, $oldId, $lastTimestamp, $bot = "default", $ip = '', $oldSize = 0, $newSize = 0, $newId = 0) { @@ -245,7 +251,7 @@ class RecentChange # Makes an entry in the database corresponding to page creation # Note: the title object must be loaded with the new id using resetArticleID() - /*static*/ function notifyNew( $timestamp, &$title, $minor, &$user, $comment, $bot = "default", + static function notifyNew( $timestamp, &$title, $minor, &$user, $comment, $bot = "default", $ip='', $size = 0, $newId = 0 ) { if ( !$ip ) { @@ -291,7 +297,7 @@ class RecentChange } # Makes an entry in the database corresponding to a rename - /*static*/ function notifyMove( $timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='', $overRedir = false ) + static function notifyMove( $timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='', $overRedir = false ) { if ( !$ip ) { $ip = wfGetIP(); @@ -330,17 +336,17 @@ class RecentChange $rc->save(); } - /* static */ function notifyMoveToNew( $timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='' ) { + static function notifyMoveToNew( $timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='' ) { RecentChange::notifyMove( $timestamp, $oldTitle, $newTitle, $user, $comment, $ip, false ); } - /* static */ function notifyMoveOverRedirect( $timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='' ) { + static function notifyMoveOverRedirect( $timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='' ) { RecentChange::notifyMove( $timestamp, $oldTitle, $newTitle, $user, $comment, $ip, true ); } # A log entry is different to an edit in that previous revisions are # not kept - /*static*/ function notifyLog( $timestamp, &$title, &$user, $comment, $ip='', + static function notifyLog( $timestamp, &$title, &$user, $comment, $ip='', $type, $action, $target, $logComment, $params ) { if ( !$ip ) { diff --git a/includes/Title.php b/includes/Title.php index ed841c59f2..1875059e66 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -239,7 +239,7 @@ class Title { * @static * @access public */ - function makeTitleSafe( $ns, $title ) { + public static function makeTitleSafe( $ns, $title ) { $t = new Title(); $t->mDbkeyform = Title::makeName( $ns, $title ); if( $t->secureAndSplit() ) { @@ -360,7 +360,7 @@ class Title { * @param string $title the DB key form the title * @return string the prefixed form of the title */ - /* static */ function makeName( $ns, $title ) { + public static function makeName( $ns, $title ) { global $wgContLang; $n = $wgContLang->getNsText( $ns ); -- 2.20.1