* Skip loading of RecentChange.php except where needed
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 9 Jan 2006 21:09:33 +0000 (21:09 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 9 Jan 2006 21:09:33 +0000 (21:09 +0000)
Moved constants to Define.php; removed unneeded includes until use of RecentChange:: in Article, Log, CheckUser

RELEASE-NOTES
includes/Article.php
includes/Defines.php
includes/LogPage.php
includes/RecentChange.php
includes/Setup.php
includes/Skin.php

index c5d378f..610a6bc 100644 (file)
@@ -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 ===
 
index 39c551a..c34d2d9 100644 (file)
@@ -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' ) );
index 68c00e0..4ae8696 100644 (file)
@@ -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);
+/**#@-*/
+
+
 ?>
index 01695e0..19cc290 100644 (file)
@@ -83,6 +83,7 @@ class LogPage {
                                        $rcComment .= ': ' . $this->comment;
                        }
 
+                       require_once( 'RecentChange.php' );
                        RecentChange::notifyLog( $now, $titleObj, $wgUser, $rcComment );
                }
                return true;
index 9f92697..cad79c7 100644 (file)
@@ -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:
index ce94c3e..12bc6f6 100644 (file)
@@ -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' );
index c811fbe..124bc59 100644 (file)
@@ -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.