From bc14eb8045cb02dead76a1c4203c45ab6e31cb36 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Thu, 11 May 2006 19:10:41 +0000 Subject: [PATCH] Replacing var keyword with private / public as we now require PHP5. --- includes/Article.php | 46 ++++++++++---------- includes/Block.php | 21 ++++++++-- includes/CacheManager.php | 4 +- includes/Database.php | 22 +++++----- includes/Exif.php | 18 ++++---- includes/HistoryBlob.php | 20 ++++++--- includes/Image.php | 4 +- includes/JobQueue.php | 3 +- includes/LinkBatch.php | 3 +- includes/LinkCache.php | 11 ++--- includes/LinksUpdate.php | 3 +- includes/LoadBalancer.php | 22 +++++++--- includes/LogPage.php | 4 +- includes/MagicWord.php | 16 +++++-- includes/MessageCache.php | 17 +++++--- includes/OutputPage.php | 42 +++++++++++-------- includes/Parser.php | 76 +++++++++++++++++++++------------- includes/SearchUpdate.php | 8 +++- includes/SiteConfiguration.php | 8 ++-- includes/SiteStatsUpdate.php | 2 +- includes/Skin.php | 10 +++-- includes/SpecialPage.php | 15 ++++--- includes/SquidUpdate.php | 3 +- includes/Title.php | 44 ++++++++++++++------ includes/User.php | 40 +++++++++--------- includes/WatchedItem.php | 4 +- includes/WebRequest.php | 5 ++- includes/Wiki.php | 4 +- languages/Language.php | 4 +- languages/Messages.php | 2 + 30 files changed, 297 insertions(+), 184 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 945f5c5da0..4d479f1c41 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -26,30 +26,32 @@ class Article { /**@{{ * @private */ - var $mComment; //!< - var $mContent; //!< - var $mContentLoaded; //!< - var $mCounter; //!< - var $mFileCache; //!< - var $mForUpdate; //!< - var $mGoodAdjustment; //!< - var $mId; //!< - var $mLatest; //!< - var $mMinorEdit; //!< - var $mOldId; //!< - var $mRedirectedFrom; //!< - var $mRedirectUrl; //!< - var $mRevIdFetched; //!< - var $mRevision; //!< - var $mTable; //!< - var $mTimestamp; //!< - var $mTitle; //!< - var $mTotalAdjustment; //!< - var $mTouched; //!< - var $mUser; //!< - var $mUserText; //!< + private $mComment; //!< + private $mContent; //!< + private $mContentLoaded; //!< + private $mCounter; //!< + private $mFileCache; //!< + private $mForUpdate; //!< + private $mGoodAdjustment; //!< + private $mId; //!< + private $mLatest; //!< + private $mMinorEdit; //!< + private $mOldId; //!< + private $mRedirectedFrom; //!< + private $mRedirectUrl; //!< + private $mRevIdFetched; //!< + private $mRevision; //!< + private $mTable; //!< + private $mTimestamp; //!< + private $mTotalAdjustment; //!< + private $mUser; //!< + private $mUserText; //!< /**@}}*/ + public $mTitle; //!< + public $mTouched; //!< + + /** * Constructor and clear the article * @param $title Reference to a Title object. diff --git a/includes/Block.php b/includes/Block.php index 42969b606c..0a5f044374 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -24,9 +24,24 @@ define ( 'EB_RANGE_ONLY', 4 ); */ class Block { - /* public*/ var $mAddress, $mUser, $mBy, $mReason, $mTimestamp, $mAuto, $mId, $mExpiry, - $mRangeStart, $mRangeEnd; - /* private */ var $mNetworkBits, $mIntegerAddr, $mForUpdate, $mFromMaster, $mByName; + public + $mAddress, + $mAuto, + $mBy, + $mExpiry, + $mId, + $mRangeEnd, + $mRangeStart, + $mReason, + $mTimestamp, + $mUser ; + + private + $mByName, + $mForUpdate, + $mFromMaster, + $mIntegerAddr, + $mNetworkBits ; function Block( $address = '', $user = '', $by = 0, $reason = '', $timestamp = '' , $auto = 0, $expiry = '' ) diff --git a/includes/CacheManager.php b/includes/CacheManager.php index 0d116f72ad..98a16ae5f7 100644 --- a/includes/CacheManager.php +++ b/includes/CacheManager.php @@ -24,7 +24,9 @@ require_once( 'Title.php' ); * @package MediaWiki */ class CacheManager { - var $mTitle, $mFileCache; + private + $mTitle, + $mFileCache; function CacheManager( &$title ) { $this->mTitle =& $title; diff --git a/includes/Database.php b/includes/Database.php index 8376f06fd3..4ec968690c 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -25,7 +25,7 @@ define( 'DEADLOCK_DELAY_MIN', 500000 ); define( 'DEADLOCK_DELAY_MAX', 1500000 ); class DBObject { - var $mData; + private $mData; function DBObject($data) { $this->mData = $data; @@ -52,17 +52,17 @@ class Database { /**#@+ * @private */ - var $mLastQuery = ''; + private $mLastQuery = ''; - var $mServer, $mUser, $mPassword, $mConn = null, $mDBname; - var $mOut, $mOpened = false; + private $mServer, $mUser, $mPassword, $mConn = null, $mDBname; + private $mOut, $mOpened = false; - var $mFailFunction; - var $mTablePrefix; - var $mFlags; - var $mTrxLevel = 0; - var $mErrorCount = 0; - var $mLBInfo = array(); + private $mFailFunction; + private $mTablePrefix; + private $mFlags; + private $mTrxLevel = 0; + private $mErrorCount = 0; + private $mLBInfo = array(); /**#@-*/ #------------------------------------------------------------------------------ @@ -1795,7 +1795,7 @@ class DatabaseMysql extends Database { * @package MediaWiki */ class ResultWrapper { - var $db, $result; + private $db, $result; /** * @todo document diff --git a/includes/Exif.php b/includes/Exif.php index 100968824d..d51a5f2ca9 100644 --- a/includes/Exif.php +++ b/includes/Exif.php @@ -55,29 +55,29 @@ class Exif { * is the value, in the case of more than one possible value type they are * seperated by commas. */ - var $mExifTags; + private $mExifTags; /** * A one dimentional array of all Exif tags */ - var $mFlatExifTags; + private $mFlatExifTags; /** * The raw Exif data returned by exif_read_data() */ - var $mRawExifData; + private $mRawExifData; /** * A Filtered version of $mRawExifData that has been pruned of invalid * tags and tags that contain content they shouldn't contain according * to the Exif specification */ - var $mFilteredExifData; + private $mFilteredExifData; /** * Filtered and formatted Exif data, see FormatExif::getFormattedData() */ - var $mFormattedExifData; + private $mFormattedExifData; //@} @@ -89,17 +89,17 @@ class Exif { /** * The file being processed */ - var $file; + private $file; /** * The basename of the file being processed */ - var $basename; + private $basename; /** * The private log to log to */ - var $log = 'exif'; + private $log = 'exif'; //@} @@ -605,7 +605,7 @@ class FormatExif { * @var array * @private */ - var $mExif; + private $mExif; /** * Constructor diff --git a/includes/HistoryBlob.php b/includes/HistoryBlob.php index 4dee4da5d1..daa444caa3 100644 --- a/includes/HistoryBlob.php +++ b/includes/HistoryBlob.php @@ -52,10 +52,14 @@ class HistoryBlob * The real object * @package MediaWiki */ -class ConcatenatedGzipHistoryBlob extends HistoryBlob -{ - /* private */ var $mVersion = 0, $mCompressed = false, $mItems = array(), $mDefaultHash = ''; - /* private */ var $mFast = 0, $mSize = 0; +class ConcatenatedGzipHistoryBlob extends HistoryBlob { + private + $mCompressed = false, + $mDefaultHash = '', + $mFast = 0, + $mItems = array(), + $mSize = 0, + $mVersion = 0 ; function ConcatenatedGzipHistoryBlob() { if ( !function_exists( 'gzdeflate' ) ) { @@ -182,7 +186,10 @@ $wgBlobCache = array(); * @package MediaWiki */ class HistoryBlobStub { - var $mOldId, $mHash, $mRef; + private + $mHash, + $mOldId, + $mRef; /** @todo document */ function HistoryBlobStub( $hash = '', $oldid = 0 ) { @@ -278,7 +285,8 @@ class HistoryBlobStub { * @package MediaWiki */ class HistoryBlobCurStub { - var $mCurId; + private + $mCurId; /** @todo document */ function HistoryBlobCurStub( $curid = 0 ) { diff --git a/includes/Image.php b/includes/Image.php index 4547a8c480..2fcce3b009 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -32,7 +32,8 @@ class Image /**#@+ * @private */ - var $name, # name of the image (constructor) + private + $name, # name of the image (constructor) $imagePath, # Path of the image (loadFromXxx) $url, # Image URL (accessor) $title, # Title object for this image (constructor) @@ -51,7 +52,6 @@ class Image $dataLoaded, # Whether or not all this has been loaded from the database (loadFromXxx) $lastError; # Error string associated with a thumbnail display error - /**#@-*/ /** diff --git a/includes/JobQueue.php b/includes/JobQueue.php index d589d8c019..ebb5d74043 100644 --- a/includes/JobQueue.php +++ b/includes/JobQueue.php @@ -5,7 +5,8 @@ if ( !defined( 'MEDIAWIKI' ) ) { } class Job { - var $command, + private + $command, $title, $params, $id, diff --git a/includes/LinkBatch.php b/includes/LinkBatch.php index e0f0f6fd10..e385edea4e 100644 --- a/includes/LinkBatch.php +++ b/includes/LinkBatch.php @@ -10,8 +10,9 @@ class LinkBatch { /** * 2-d array, first index namespace, second index dbkey, value arbitrary + * @todo FIXME should it really be public ? */ - var $data = array(); + public $data = array(); function LinkBatch( $arr = array() ) { foreach( $arr as $item ) { diff --git a/includes/LinkCache.php b/includes/LinkCache.php index 451b3f0c0a..355f1575d2 100644 --- a/includes/LinkCache.php +++ b/includes/LinkCache.php @@ -12,11 +12,12 @@ class LinkCache { // Increment $mClassVer whenever old serialized versions of this class // becomes incompatible with the new version. - /* private */ var $mClassVer = 3; - - /* private */ var $mPageLinks; - /* private */ var $mGoodLinks, $mBadLinks; - /* private */ var $mForUpdate; + private + $mBadLinks, + $mClassVer = 3, + $mForUpdate, + $mGoodLinks, + $mPageLinks ; /** * Get an instance of this class diff --git a/includes/LinksUpdate.php b/includes/LinksUpdate.php index bd09502e79..9375de622d 100644 --- a/includes/LinksUpdate.php +++ b/includes/LinksUpdate.php @@ -13,7 +13,8 @@ class LinksUpdate { /**@{{ * @private */ - var $mId, //!< Page ID of the article linked from + private + $mId, //!< Page ID of the article linked from $mTitle, //!< Title object of the article linked from $mLinks, //!< Map of title strings to IDs for the links in the document $mImages, //!< DB keys of the images used, in the array key only diff --git a/includes/LoadBalancer.php b/includes/LoadBalancer.php index 465f3b9985..83c02991ec 100644 --- a/includes/LoadBalancer.php +++ b/includes/LoadBalancer.php @@ -32,11 +32,23 @@ define( 'AVG_STATUS_POLL', 2000 ); * @package MediaWiki */ class LoadBalancer { - /* private */ var $mServers, $mConnections, $mLoads, $mGroupLoads; - /* private */ var $mFailFunction, $mErrorConnection; - /* private */ var $mForce, $mReadIndex, $mLastIndex, $mAllowLagged; - /* private */ var $mWaitForFile, $mWaitForPos, $mWaitTimeout; - /* private */ var $mLaggedSlaveMode, $mLastError = 'Unknown error'; + + private + $mAllowLagged, + $mConnections, + $mErrorConnection, + $mFailFunction, + $mForce, + $mGroupLoads, + $mLaggedSlaveMode, + $mLastError = 'Unknown error', + $mLastIndex, + $mLoads, + $mReadIndex, + $mServers, + $mWaitForFile, + $mWaitForPos, + $mWaitTimeout ; function LoadBalancer() { diff --git a/includes/LogPage.php b/includes/LogPage.php index 5741e0cee7..e01ec0b765 100644 --- a/includes/LogPage.php +++ b/includes/LogPage.php @@ -33,9 +33,9 @@ */ class LogPage { /* @access private */ - var $type, $action, $comment, $params, $target; + private $type, $action, $comment, $params, $target; /* @acess public */ - var $updateRecentChanges; + public $updateRecentChanges; /** * Constructor diff --git a/includes/MagicWord.php b/includes/MagicWord.php index 1dfadfea22..5a42a7a49d 100644 --- a/includes/MagicWord.php +++ b/includes/MagicWord.php @@ -152,11 +152,21 @@ class MagicWord { /**#@+ * @access private */ - var $mId, $mSynonyms, $mCaseSensitive, $mRegex; - var $mRegexStart, $mBaseRegex, $mVariableRegex; - var $mModified; + private + $mBaseRegex, + $mModified, + $mRegex, + $mRegexStart, + $mVariableRegex ; /**#@-*/ + /** @todo FIXME should they really be public ? */ + public + $mCaseSensitive, + $mId, + $mSynonyms ; + + function MagicWord($id = 0, $syn = '', $cs = false) { $this->mId = $id; $this->mSynonyms = (array)$syn; diff --git a/includes/MessageCache.php b/includes/MessageCache.php index ea7ae52e09..df66cddd4f 100644 --- a/includes/MessageCache.php +++ b/includes/MessageCache.php @@ -22,11 +22,18 @@ define( 'MSG_WAIT_TIMEOUT', 10); * @package MediaWiki */ class MessageCache { - var $mCache, $mUseCache, $mDisable, $mExpiry; - var $mMemcKey, $mKeys, $mParserOptions, $mParser; - var $mExtensionMessages = array(); - var $mInitialised = false; - var $mDeferred = true; + private + $mCache, + $mDeferred = true, + $mDisable, + $mExpiry, + $mExtensionMessages = array(), + $mInitialised = false, + $mKeys, + $mMemcKey, + $mParser, + $mParserOptions, + $mUseCache ; function initialise( &$memCached, $useDB, $expiry, $memcPrefix) { $fname = 'MessageCache::initialise'; diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 4b3710d522..cb918ac254 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -13,24 +13,30 @@ if ( $wgUseTeX ) * @package MediaWiki */ class OutputPage { - var $mHeaders, $mMetatags, $mKeywords; - var $mLinktags, $mPagetitle, $mBodytext, $mDebugtext; - var $mHTMLtitle, $mRobotpolicy, $mIsarticle, $mPrintable; - var $mSubtitle, $mRedirect, $mStatusCode; - var $mLastModified, $mETag, $mCategoryLinks; - var $mScripts, $mLinkColours, $mPageLinkTitle; - - var $mSuppressQuickbar; - var $mOnloadHandler; - var $mDoNothing; - var $mContainsOldMagic, $mContainsNewMagic; - var $mIsArticleRelated; - var $mParserOptions; - var $mShowFeedLinks = false; - var $mEnableClientCache = true; - var $mArticleBodyOnly = false; - - var $mNewSectionLink = false; + private $mHeaders, $mMetatags, $mKeywords; + private $mLinktags, $mPagetitle; + private $mHTMLtitle, $mRobotpolicy, $mIsarticle, $mPrintable; + private $mSubtitle, $mRedirect, $mStatusCode; + private $mLastModified, $mETag ; + private $mScripts, $mLinkColours; + private $mSuppressQuickbar; + private $mOnloadHandler; + private $mDoNothing; + private $mContainsOldMagic, $mContainsNewMagic; + private $mIsArticleRelated; + private $mParserOptions; + private $mShowFeedLinks = false; + private $mEnableClientCache = true; + private $mArticleBodyOnly = false; + private $mNewSectionLink = false; + + /** @todo FIXME shouldn't those be private ? */ + public + $mPageLinkTitle, + $mCategoryLinks, + $mDebugtext, + $mBodytext + ; /** * Constructor diff --git a/includes/Parser.php b/includes/Parser.php index 8976971ae9..e07b2363f1 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -93,20 +93,33 @@ class Parser * @private */ # Persistent: - var $mTagHooks, $mFunctionHooks; + private $mTagHooks, $mFunctionHooks; # Cleared with clearState(): - var $mOutput, $mAutonumber, $mDTopen, $mStripState = array(); - var $mVariables, $mIncludeCount, $mArgStack, $mLastSection, $mInPre; - var $mInterwikiLinkHolders, $mLinkHolders, $mUniqPrefix; - var $mTemplates, // cache of already loaded templates, avoids + private + $mArgStack, + $mAutonumber, + $mDTopen, + $mIncludeCount, + $mInPre, + $mInterwikiLinkHolders, + $mLastSection, + $mLinkHolders, + $mOutput, + $mStripState = array(), + $mUniqPrefix, + $mVariables ; + + private + $mTemplates, // cache of already loaded templates, avoids // multiple SQL queries for the same string $mTemplatePath; // stores an unsorted hash of all the templates already loaded // in this path. Used for loop detection. # Temporary # These are variables reset at least once per parse regardless of $clearState - var $mOptions, // ParserOptions object + private + $mOptions, // ParserOptions object $mTitle, // Title context, used for self-link rendering and similar things $mOutputType, // Output type, one of the OT_xxx constants $mRevisionId; // ID to display in {{REVISIONID}} tags @@ -4077,20 +4090,24 @@ class Parser */ class ParserOutput { - var $mText, # The output text - $mLanguageLinks, # List of the full text of language links, in the order they appear - $mCategories, # Map of category names to sort keys - $mContainsOldMagic, # Boolean variable indicating if the input contained variables like {{CURRENTDAY}} + private $mCacheTime, # Time when this object was generated, or -1 for uncacheable. Used in ParserCache. - $mVersion, # Compatibility check - $mTitleText, # title text of the chosen language variant - $mLinks, # 2-D map of NS/DBK to ID for the links in the document. ID=zero for broken. - $mTemplates, # 2-D map of NS/DBK to ID for the template references. ID=zero for broken. - $mImages, # DB keys of the images used, in the array key only + $mCategories, # Map of category names to sort keys $mExternalLinks, # External link URLs, in the key only - $mHTMLtitle, # Display HTML title + $mImages, # DB keys of the images used, in the array key only + $mLanguageLinks, # List of the full text of language links, in the order they appear + $mLinks, # 2-D map of NS/DBK to ID for the links in the document. ID=zero for broken. + $mNewSection, # Show a new section link? $mSubtitle, # Additional subtitle - $mNewSection; # Show a new section link? + $mTemplates, # 2-D map of NS/DBK to ID for the template references. ID=zero for broken. + $mText, # The output text + $mTitleText, # title text of the chosen language variant + $mVersion ; # Compatibility check + + /** @todo FIXME should those be public ? */ + public + $mContainsOldMagic, # Boolean variable indicating if the input contained variables like {{CURRENTDAY}} + $mHTMLtitle ; # Display HTML title function ParserOutput( $text = '', $languageLinks = array(), $categoryLinks = array(), $containsOldMagic = false, $titletext = '' ) @@ -4187,18 +4204,19 @@ class ParserOutput class ParserOptions { # All variables are private - var $mUseTeX; # Use texvc to expand tags - var $mUseDynamicDates; # Use DateFormatter to format dates - var $mInterwikiMagic; # Interlanguage links are removed and returned in an array - var $mAllowExternalImages; # Allow external images inline - var $mAllowExternalImagesFrom; # If not, any exception? - var $mSkin; # Reference to the preferred skin - var $mDateFormat; # Date format index - var $mEditSection; # Create "edit section" links - var $mNumberHeadings; # Automatically number headings - var $mAllowSpecialInclusion; # Allow inclusion of special pages - var $mTidy; # Ask for tidy cleanup - var $mInterfaceMessage; # Which lang to call for PLURAL and GRAMMAR + private + $mAllowExternalImages, # Allow external images inline + $mAllowExternalImagesFrom, # If not, any exception? + $mAllowSpecialInclusion, # Allow inclusion of special pages + $mDateFormat, # Date format index + $mEditSection, # Create "edit section" links + $mInterfaceMessage, # Which lang to call for PLURAL and GRAMMAR + $mInterwikiMagic, # Interlanguage links are removed and returned in an array + $mNumberHeadings, # Automatically number headings + $mSkin, # Reference to the preferred skin + $mTidy, # Ask for tidy cleanup + $mUseDynamicDates, # Use DateFormatter to format dates + $mUseTeX ; # Use texvc to expand tags function getUseTeX() { return $this->mUseTeX; } function getUseDynamicDates() { return $this->mUseDynamicDates; } diff --git a/includes/SearchUpdate.php b/includes/SearchUpdate.php index 1f222b3952..135d9f04bd 100644 --- a/includes/SearchUpdate.php +++ b/includes/SearchUpdate.php @@ -10,8 +10,12 @@ */ class SearchUpdate { - /* private */ var $mId = 0, $mNamespace, $mTitle, $mText; - /* private */ var $mTitleWords; + private + $mId = 0, + $mNamespace, + $mTitle, + $mText, + $mTitleWords; function SearchUpdate( $id, $title, $text = false ) { $nt = Title::newFromText( $title ); diff --git a/includes/SiteConfiguration.php b/includes/SiteConfiguration.php index 8fd5d6b6bd..293de95295 100644 --- a/includes/SiteConfiguration.php +++ b/includes/SiteConfiguration.php @@ -15,10 +15,10 @@ define('SITE_CONFIGURATION', 1); /** @package MediaWiki */ class SiteConfiguration { - var $suffixes = array(); - var $wikis = array(); - var $settings = array(); - var $localVHosts = array(); + private $suffixes = array(); + private $wikis = array(); + private $settings = array(); + private $localVHosts = array(); /** */ function get( $setting, $wiki, $suffix, $params = array() ) { diff --git a/includes/SiteStatsUpdate.php b/includes/SiteStatsUpdate.php index 1b6d3804e3..112ab2cdf9 100644 --- a/includes/SiteStatsUpdate.php +++ b/includes/SiteStatsUpdate.php @@ -11,7 +11,7 @@ */ class SiteStatsUpdate { - var $mViews, $mEdits, $mGood, $mPages, $mUsers; + private $mViews, $mEdits, $mGood, $mPages, $mUsers; function SiteStatsUpdate( $views, $edits, $good, $pages = 0, $users = 0 ) { $this->mViews = $views; diff --git a/includes/Skin.php b/includes/Skin.php index d1be56eb47..eeffd3eed3 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -39,10 +39,12 @@ class Skin extends Linker { /**#@+ * @private */ - var $lastdate, $lastline; - var $rc_cache ; # Cache for Enhanced Recent Changes - var $rcCacheIndex ; # Recent Changes Cache Counter for visibility toggle - var $rcMoveIndex; + private + $lastdate, + $lastline, + $rc_cache, # Cache for Enhanced Recent Changes + $rcCacheIndex, # Recent Changes Cache Counter for visibility toggle + $rcMoveIndex; /**#@-*/ /** Constructor, call parent constructor */ diff --git a/includes/SpecialPage.php b/includes/SpecialPage.php index bf6c74582e..b061598e6d 100644 --- a/includes/SpecialPage.php +++ b/includes/SpecialPage.php @@ -109,33 +109,32 @@ class SpecialPage * The name of the class, used in the URL. * Also used for the default

heading, @see getDescription() */ - var $mName; + private $mName; /** * Minimum user level required to access this page, or "" for anyone. * Also used to categorise the pages in Special:Specialpages */ - var $mRestriction; + private $mRestriction; /** * Listed in Special:Specialpages? */ - var $mListed; + private $mListed; /** * Function name called by the default execute() */ - var $mFunction; + private $mFunction; /** * File which needs to be included before the function above can be called */ - var $mFile; + private $mFile; /** * Whether or not this special page is being included from an article */ - var $mIncluding; + private $mIncluding; /** * Whether the special page can be included in an article */ - var $mIncludable; - + private $mIncludable; /**#@-*/ diff --git a/includes/SquidUpdate.php b/includes/SquidUpdate.php index dba47c563d..680b0f418c 100644 --- a/includes/SquidUpdate.php +++ b/includes/SquidUpdate.php @@ -9,7 +9,8 @@ * @package MediaWiki */ class SquidUpdate { - var $urlArr, $mMaxTitles; + public $urlArr; // FIXME : is it really public ? + private $mMaxTitles; function SquidUpdate( $urlArr = Array(), $maxTitles = false ) { global $wgMaxSquidPurgeTitles; diff --git a/includes/Title.php b/includes/Title.php index 3197b46ec4..c23e0bfd10 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -37,23 +37,24 @@ class Title { * @access private */ - var $mTextform; # Text form (spaces not underscores) of the main part - var $mUrlform; # URL-encoded form of the main part - var $mDbkeyform; # Main part with underscores - var $mNamespace; # Namespace index, i.e. one of the NS_xxxx constants - var $mInterwiki; # Interwiki prefix (or null string) - var $mFragment; # Title fragment (i.e. the bit after the #) - var $mArticleID; # Article ID, fetched from the link cache on demand - var $mLatestID; # ID of most recent revision - var $mRestrictions; # Array of groups allowed to edit this article + private $mTextform; # Text form (spaces not underscores) of the main part + private $mUrlform; # URL-encoded form of the main part + private $mDbkeyform; # Main part with underscores + private $mNamespace; # Namespace index, i.e. one of the NS_xxxx constants + private $mInterwiki; # Interwiki prefix (or null string) + private $mFragment; # Title fragment (i.e. the bit after the #) + private $mLatestID; # ID of most recent revision + private $mRestrictions; # Array of groups allowed to edit this article # Only null or "sysop" are supported - var $mRestrictionsLoaded; # Boolean for initialisation on demand - var $mPrefixedText; # Text form including namespace/interwiki, initialised on demand - var $mDefaultNamespace; # Namespace index when there is no namespace + private $mPrefixedText; # Text form including namespace/interwiki, initialised on demand + private $mDefaultNamespace; # Namespace index when there is no namespace # Zero except in {{transclusion}} tags - var $mWatched; # Is $wgUser watching this page? NULL if unfilled, accessed through userIsWatching() + private $mWatched; # Is $wgUser watching this page? NULL if unfilled, accessed through userIsWatching() /**#@-*/ + /** @todo FIXME should those be public ? */ + public $mArticleID; # Article ID, fetched from the link cache on demand + public $mRestrictionsLoaded; # Boolean for initialisation on demand /** * Constructor @@ -1242,6 +1243,23 @@ class Title { return (int)$n; } + /** + * Used to grab from the logging facility the date at wich the + * article got deleted. For special pages and article that never + * got deleted, return 0. + * @return date when the title got deleted + */ + function getDeletedDate() { + $fname = 'Title::getLastDelete'; + if( $this->getNamespace() < 0 or !$this->isDeleted() ) { + $n = 0; + } else { + $dbr =& wfGetDB( DB_SLAVE ); + $n = $dbr->selectField( 'logging', 'MAX(log_timestamp)', array( 'log_namespace' => $this->getNamespace(), + 'log_title' => $this->getDBkey() ), $fname ); + } + return $n; + } /** * Get the article ID for this Title from the link cache, * adding it if necessary diff --git a/includes/User.php b/includes/User.php index cb6a6de588..5d6e2e8944 100644 --- a/includes/User.php +++ b/includes/User.php @@ -27,26 +27,26 @@ class User { /**@{{ * @private */ - var $mBlockedby; //!< - var $mBlockreason; //!< - var $mDataLoaded; //!< - var $mEmail; //!< - var $mEmailAuthenticated; //!< - var $mGroups; //!< - var $mHash; //!< - var $mId; //!< - var $mName; //!< - var $mNewpassword; //!< - var $mNewtalk; //!< - var $mOptions; //!< - var $mPassword; //!< - var $mRealName; //!< - var $mRegistration; //!< - var $mRights; //!< - var $mSkin; //!< - var $mToken; //!< - var $mTouched; //!< - var $mVersion; //!< serialized version + private $mBlockedby; //!< + private $mBlockreason; //!< + private $mDataLoaded; //!< + private $mEmail; //!< + private $mEmailAuthenticated; //!< + private $mGroups; //!< + private $mHash; //!< + private $mId; //!< + private $mName; //!< + private $mNewpassword; //!< + private $mNewtalk; //!< + private $mOptions; //!< + private $mPassword; //!< + private $mRealName; //!< + private $mRegistration; //!< + private $mRights; //!< + private $mSkin; //!< + private $mToken; //!< + private $mTouched; //!< + private $mVersion; //!< serialized version /**@}} */ /** Constructor using User:loadDefaults() */ diff --git a/includes/WatchedItem.php b/includes/WatchedItem.php index 3885bb985a..2697a197a5 100644 --- a/includes/WatchedItem.php +++ b/includes/WatchedItem.php @@ -9,7 +9,9 @@ * @package MediaWiki */ class WatchedItem { - var $mTitle, $mUser; + private + $mTitle, + $mUser; /** * Create a WatchedItem object with the given user and title diff --git a/includes/WebRequest.php b/includes/WebRequest.php index 736e215fdd..f4b029461b 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -445,8 +445,9 @@ class WebRequest { * @package MediaWiki */ class FauxRequest extends WebRequest { - var $data = null; - var $wasPosted = false; + private + $data = null, + $wasPosted = false ; function FauxRequest( $data, $wasPosted = false ) { if( is_array( $data ) ) { diff --git a/includes/Wiki.php b/includes/Wiki.php index be3a8b41c7..0938bd7071 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -5,8 +5,8 @@ class MediaWiki { - var $GET; /* Stores the $_GET variables at time of creation, can be changed */ - var $params = array(); + public $GET; /* Stores the $_GET variables at time of creation, can be changed */ + public $params = array(); /** * Constructor diff --git a/languages/Language.php b/languages/Language.php index 17b5d12fc0..9f70456e45 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -290,7 +290,7 @@ if (!$wgCachedMessageArrays) { /* a fake language converter */ class fakeConverter { - var $mLang; + private $mLang; function fakeConverter($langobj) {$this->mLang = $langobj;} function convert($t, $i) {return $t;} function parserConvert($t, $p) {return $t;} @@ -309,7 +309,7 @@ class fakeConverter { #-------------------------------------------------------------------------- class Language { - var $mConverter; + private $mConverter; function Language() { # Copies any missing values in the specified arrays from En to the current language diff --git a/languages/Messages.php b/languages/Messages.php index fa4908baa2..1f259380c9 100644 --- a/languages/Messages.php +++ b/languages/Messages.php @@ -503,6 +503,8 @@ If you are here by mistake, just click your browser's '''back''' button.", 'anontalkpagetext' => "----''This is the discussion page for an anonymous user who has not created an account yet or who does not use it. We therefore have to use the numerical [[IP address]] to identify him/her. Such an IP address can be shared by several users. If you are an anonymous user and feel that irrelevant comments have been directed at you, please [[Special:Userlogin|create an account or log in]] to avoid future confusion with other anonymous users.''", 'noarticletext' => 'There is currently no text in this page, you can [[{{ns:special}}:Search/{{PAGENAME}}|search for this page title]] in other pages or [{{fullurl:{{NAMESPACE}}:{{PAGENAME}}|action=edit}} edit this page].', 'noarticletextanon' => '{{int:noarticletext}}', +'noarticletextdeleted' => 'There is currently no text in this page, you can [[{{ns:special}}:Search/{{PAGENAME}}|search for this page title]] in other pages or [{{fullurl:{{NAMESPACE}}:{{PAGENAME}}|action=edit}} edit this page].', +'noarticletextdeletedanon' => '{{int:noarticletext}}', 'clearyourcache' => "'''Note:''' After saving, you may have to bypass your browser's cache to see the changes. '''Mozilla / Firefox / Safari:''' hold down ''Shift'' while clicking ''Reload'', or press ''Ctrl-Shift-R'' (''Cmd-Shift-R'' on Apple Mac); '''IE:''' hold ''Ctrl'' while clicking ''Refresh'', or press ''Ctrl-F5''; '''Konqueror:''': simply click the ''Reload'' button, or press ''F5''; '''Opera''' users may need to completely clear their cache in ''Tools→Preferences''.", 'usercssjsyoucanpreview' => 'Tip: Use the \'Show preview\' button to test your new CSS/JS before saving.', 'usercsspreview' => '\'\'\'Remember that you are only previewing your user CSS, it has not yet been saved!\'\'\'', -- 2.20.1