From 26cc539cac66d6fc6287c553a1958c17c152bddf Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 9 Jan 2006 21:09:33 +0000 Subject: [PATCH] * Skip loading of RecentChange.php except where needed Moved constants to Define.php; removed unneeded includes until use of RecentChange:: in Article, Log, CheckUser --- RELEASE-NOTES | 2 ++ includes/Article.php | 3 +++ includes/Defines.php | 12 ++++++++++++ includes/LogPage.php | 1 + includes/RecentChange.php | 10 ---------- includes/Setup.php | 1 - includes/Skin.php | 2 -- 7 files changed, 18 insertions(+), 13 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index c5d378f605..610a6bc41c 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -449,6 +449,8 @@ fully support the editing toolbar, but was found to be too confusing. * Maintenance script to delete unused user accounts * (bug 912) Search box easier to reach in text browsers (lynx, links) * $wgParserCacheExpireTime added +* Skip loading of RecentChange.php except where needed + === Caveats === diff --git a/includes/Article.php b/includes/Article.php index 39c551acdb..c34d2d9806 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1193,6 +1193,7 @@ class Article { Article::onArticleCreate( $this->mTitle ); if(!$suppressRC) { + require_once( 'RecentChange.php' ); RecentChange::notifyNew( $now, $this->mTitle, $isminor, $wgUser, $summary, 'default', '', strlen( $text ), $revisionId ); } @@ -1400,6 +1401,7 @@ class Article { $dbw->rollback(); } else { # Update recentchanges and purge cache and whatnot + require_once( 'RecentChange.php' ); $bot = (int)($wgUser->isBot() || $forceBot); RecentChange::notifyEdit( $now, $this->mTitle, $isminor, $wgUser, $summary, $lastRevision, $this->getTimestamp(), $bot, '', $oldsize, $newsize, @@ -1521,6 +1523,7 @@ class Article { if ( !is_null ( $rcid ) ) { if( wfRunHooks( 'MarkPatrolled', array( &$rcid, &$wgUser, $wgOnlySysopsCanPatrol ) ) ) { + require_once( 'RecentChange.php' ); RecentChange::markPatrolled( $rcid ); wfRunHooks( 'MarkPatrolledComplete', array( &$rcid, &$wgUser, $wgOnlySysopsCanPatrol ) ); $wgOut->setPagetitle( wfMsg( 'markedaspatrolled' ) ); diff --git a/includes/Defines.php b/includes/Defines.php index 68c00e012e..4ae86965a2 100644 --- a/includes/Defines.php +++ b/includes/Defines.php @@ -153,4 +153,16 @@ define( 'MW_DATE_YMD', '3' ); define( 'MW_DATE_ISO', 'ISO 8601' ); /**#@-*/ +/**#@+ + * RecentChange type identifiers + * This may be obsolete; log items are now used for moves? + */ +define( 'RC_EDIT', 0); +define( 'RC_NEW', 1); +define( 'RC_MOVE', 2); +define( 'RC_LOG', 3); +define( 'RC_MOVE_OVER_REDIRECT', 4); +/**#@-*/ + + ?> diff --git a/includes/LogPage.php b/includes/LogPage.php index 01695e0c56..19cc2900b5 100644 --- a/includes/LogPage.php +++ b/includes/LogPage.php @@ -83,6 +83,7 @@ class LogPage { $rcComment .= ': ' . $this->comment; } + require_once( 'RecentChange.php' ); RecentChange::notifyLog( $now, $titleObj, $wgUser, $rcComment ); } return true; diff --git a/includes/RecentChange.php b/includes/RecentChange.php index 9f926976aa..cad79c778c 100644 --- a/includes/RecentChange.php +++ b/includes/RecentChange.php @@ -4,16 +4,6 @@ * @package MediaWiki */ -/** - * Various globals - */ -define( 'RC_EDIT', 0); -define( 'RC_NEW', 1); -define( 'RC_MOVE', 2); -define( 'RC_LOG', 3); -define( 'RC_MOVE_OVER_REDIRECT', 4); - - /** * Utility class for creating new RC entries * mAttribs: diff --git a/includes/Setup.php b/includes/Setup.php index ce94c3e061..12bc6f6283 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -47,7 +47,6 @@ wfProfileIn( $fname.'-includes' ); require_once( 'GlobalFunctions.php' ); require_once( 'Hooks.php' ); require_once( 'Namespace.php' ); -require_once( 'RecentChange.php' ); require_once( 'User.php' ); require_once( 'Skin.php' ); require_once( 'OutputPage.php' ); diff --git a/includes/Skin.php b/includes/Skin.php index c811fbeaf5..124bc5958a 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -29,8 +29,6 @@ while (false !== ($file = $skinDir->read())) { $skinDir->close(); unset($matches); -require_once( 'RecentChange.php' ); - /** * The main skin class that provide methods and properties for all other skins * including PHPTal skins. -- 2.20.1