Revert to r14512; domas introduced massive breakage with incomplete experimental...
authorBrion Vibber <brion@users.mediawiki.org>
Thu, 1 Jun 2006 08:19:02 +0000 (08:19 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Thu, 1 Jun 2006 08:19:02 +0000 (08:19 +0000)
57 files changed:
includes/AjaxDispatcher.php
includes/AjaxFunctions.php
includes/Article.php
includes/AutoLoader.php [deleted file]
includes/Block.php
includes/CacheManager.php
includes/CategoryPage.php
includes/ChangesList.php
includes/Credits.php
includes/Database.php
includes/DatabaseOracle.php
includes/DatabasePostgreSQL.php
includes/DifferenceEngine.php
includes/EditPage.php
includes/Export.php
includes/ExternalStoreDB.php
includes/GlobalFunctions.php
includes/HistoryBlob.php
includes/HttpFunctions.php
includes/Image.php
includes/ImagePage.php
includes/LinksUpdate.php
includes/LoadBalancer.php
includes/LogPage.php
includes/Math.php
includes/MessageCache.php
includes/ObjectCache.php
includes/OutputPage.php
includes/PageHistory.php
includes/Parser.php
includes/ParserXML.php
includes/Profiling.php
includes/ProxyTools.php
includes/QueryPage.php
includes/RawPage.php
includes/RecentChange.php
includes/Revision.php
includes/SearchEngine.php
includes/SearchMySQL.php
includes/SearchMySQL4.php
includes/SearchTsearch2.php
includes/SearchUpdate.php
includes/Setup.php
includes/Skin.php
includes/SkinTemplate.php
includes/SpecialBlockme.php
includes/SpecialPage.php
includes/SpecialPreferences.php
includes/SpecialRecentchanges.php
includes/SpecialUpload.php
includes/SpecialUserlogin.php
includes/SpecialVersion.php
includes/Title.php
includes/UpdateClasses.php
includes/User.php
includes/WebRequest.php
includes/Wiki.php

index f5af30b..ae0d3e3 100644 (file)
@@ -1,5 +1,18 @@
 <?php
 
+//$wgRequestTime = microtime();
+
+// unset( $IP );
+// @ini_set( 'allow_url_fopen', 0 ); # For security...
+
+# Valid web server entry point, enable includes.
+# Please don't move this line to includes/Defines.php. This line essentially defines
+# a valid entry point. If you put it in includes/Defines.php, then any script that includes
+# it becomes an entry point, thereby defeating its purpose.
+// define( 'MEDIAWIKI', true );
+// require_once( './includes/Defines.php' );
+// require_once( './LocalSettings.php' );
+// require_once( 'includes/Setup.php' );
 require_once( 'AjaxFunctions.php' );
 
 if ( ! $wgUseAjax ) {
index 94388b0..3580a29 100644 (file)
@@ -3,6 +3,8 @@
 if( !defined( 'MEDIAWIKI' ) )
         die( -1 );
 
+require_once('WebRequest.php');
+
 /**
  * Function converts an Javascript escaped string back into a string with
  * specified charset (default is UTF-8).
index 0c6046f..d4a3cde 100644 (file)
@@ -4,6 +4,12 @@
  * @package MediaWiki
  */
 
+/**
+ * Need the CacheManager to be loaded
+ */
+require_once( 'CacheManager.php' );
+require_once( 'Revision.php' );
+
 $wgArticleCurContentFields = false;
 $wgArticleOldContentFields = false;
 
@@ -756,6 +762,7 @@ class Article {
                # diff page instead of the article.
 
                if ( !is_null( $diff ) ) {
+                       require_once( 'DifferenceEngine.php' );
                        $wgOut->setPageTitle( $this->mTitle->getPrefixedText() );
 
                        $de = new DifferenceEngine( $this->mTitle, $oldid, $diff, $rcid );
@@ -1226,6 +1233,7 @@ class Article {
 
                Article::onArticleCreate( $this->mTitle );
                if(!$suppressRC) {
+                       require_once( 'RecentChange.php' );
                        $rcid = RecentChange::notifyNew( $now, $this->mTitle, $isminor, $wgUser, $summary, 'default',
                          '', strlen( $text ), $revisionId );
                        # Mark as patrolled if the user can and has the option set
@@ -1432,6 +1440,7 @@ class Article {
                                $dbw->rollback();
                        } else {
                                # Update recentchanges and purge cache and whatnot
+                               require_once( 'RecentChange.php' );
                                $bot = (int)($wgUser->isBot() || $forceBot);
                                $rcid = RecentChange::notifyEdit( $now, $this->mTitle, $isminor, $wgUser, $summary,
                                        $lastRevision, $this->getTimestamp(), $bot, '', $oldsize, $newsize,
@@ -1555,6 +1564,7 @@ class Article {
                $rcid = $wgRequest->getVal( 'rcid' );
                if ( !is_null ( $rcid ) ) {
                        if( wfRunHooks( 'MarkPatrolled', array( &$rcid, &$wgUser, false ) ) ) {
+                               require_once( 'RecentChange.php' );
                                RecentChange::markPatrolled( $rcid );
                                wfRunHooks( 'MarkPatrolledComplete', array( &$rcid, &$wgUser, false ) );
                                $wgOut->setPagetitle( wfMsg( 'markedaspatrolled' ) );
@@ -1669,6 +1679,7 @@ class Article {
         * action=protect handler
         */
        function protect() {
+               require_once 'ProtectionForm.php';
                $form = new ProtectionForm( $this );
                $form->show();
        }
diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php
deleted file mode 100644 (file)
index 62ef4a2..0000000
+++ /dev/null
@@ -1,223 +0,0 @@
-<?php
-
-/* This defines autoloading handler for whole MediaWiki framework */
-function __autoload($class_name) {
-       $classes = array(
-               'AjaxDispatcher' => 'AjaxDispatcher.php',
-               'AjaxCachePolicy' => 'AjaxFunctions.php',
-               'Article' => 'Article.php',
-               'AuthPlugin' => 'AuthPlugin.php',
-               'BagOStuff' => 'BagOStuff.php',
-               'HashBagOStuff' => 'BagOStuff.php',
-               'SqlBagOStuff' => 'BagOStuff.php',
-               'MediaWikiBagOStuff' => 'BagOStuff.php',
-               'TurckBagOStuff' => 'BagOStuff.php',
-               'APCBagOStuff' => 'BagOStuff.php',
-               'eAccelBagOStuff' => 'BagOStuff.php',
-               'Block' => 'Block.php',
-               'CacheManager' => 'CacheManager.php',
-               'CategoryPage' => 'CategoryPage.php',
-               'Categoryfinder' => 'Categoryfinder.php',
-               'RCCacheEntry' => 'ChangesList.php',
-               'ChangesList' => 'ChangesList.php',
-               'OldChangesList' => 'ChangesList.php',
-               'EnhancedChangesList' => 'ChangesList.php',
-               'DBObject' => 'Database.php',
-               'Database' => 'Database.php',
-               'DatabaseMysql' => 'Database.php',
-               'ResultWrapper' => 'Database.php',
-               'OracleBlob' => 'DatabaseOracle.php',
-               'DatabaseOracle' => 'DatabaseOracle.php',
-               'DatabasePgsql' => 'DatabasePostgreSQL.php',
-               'DatabasePostgreSQL' => 'DatabasePostgreSQL.php',
-               'DateFormatter' => 'DateFormatter.php',
-               'DifferenceEngine' => 'DifferenceEngine.php',
-               '_DiffOp' => 'DifferenceEngine.php',
-               '_DiffOp_Copy' => 'DifferenceEngine.php',
-               '_DiffOp_Delete' => 'DifferenceEngine.php',
-               '_DiffOp_Add' => 'DifferenceEngine.php',
-               '_DiffOp_Change' => 'DifferenceEngine.php',
-               '_DiffEngine' => 'DifferenceEngine.php',
-               'Diff' => 'DifferenceEngine.php',
-               'MappedDiff' => 'DifferenceEngine.php',
-               'DiffFormatter' => 'DifferenceEngine.php',
-               '_HWLDF_WordAccumulator' => 'DifferenceEngine.php',
-               'WordLevelDiff' => 'DifferenceEngine.php',
-               'TableDiffFormatter' => 'DifferenceEngine.php',
-               'EditPage' => 'EditPage.php',
-               'Exif' => 'Exif.php',
-               'FormatExif' => 'Exif.php',
-               'WikiExporter' => 'Export.php',
-               'XmlDumpWriter' => 'Export.php',
-               'DumpOutput' => 'Export.php',
-               'DumpFileOutput' => 'Export.php',
-               'DumpPipeOutput' => 'Export.php',
-               'DumpGZipOutput' => 'Export.php',
-               'DumpBZip2Output' => 'Export.php',
-               'Dump7ZipOutput' => 'Export.php',
-               'DumpFilter' => 'Export.php',
-               'DumpNotalkFilter' => 'Export.php',
-               'DumpNamespaceFilter' => 'Export.php',
-               'DumpLatestFilter' => 'Export.php',
-               'DumpMultiWriter' => 'Export.php',
-               'ExternalEdit' => 'ExternalEdit.php',
-               'ExternalStore' => 'ExternalStore.php',
-               'ExternalStoreDB' => 'ExternalStoreDB.php',
-               'ExternalStoreHttp' => 'ExternalStoreHttp.php',
-               'FakeTitle' => 'FakeTitle.php',
-               'FeedItem' => 'Feed.php',
-               'ChannelFeed' => 'Feed.php',
-               'RSSFeed' => 'Feed.php',
-               'AtomFeed' => 'Feed.php',
-               'ReplacerCallback' => 'GlobalFunctions.php',
-               'Group' => 'Group.php',
-               'HTMLForm' => 'HTMLForm.php',
-               'HistoryBlob' => 'HistoryBlob.php',
-               'ConcatenatedGzipHistoryBlob' => 'HistoryBlob.php',
-               'HistoryBlobStub' => 'HistoryBlob.php',
-               'HistoryBlobCurStub' => 'HistoryBlob.php',
-               'Image' => 'Image.php',
-               'ThumbnailImage' => 'Image.php',
-               'ImageGallery' => 'ImageGallery.php',
-               'ImagePage' => 'ImagePage.php',
-               'ImageHistoryList' => 'ImagePage.php',
-               'ImageRemote' => 'ImageRemote.php',
-               'Job' => 'JobQueue.php',
-               'Licenses' => 'Licenses.php',
-               'License' => 'Licenses.php',
-               'LinkBatch' => 'LinkBatch.php',
-               'LinkCache' => 'LinkCache.php',
-               'LinkFilter' => 'LinkFilter.php',
-               'Linker' => 'Linker.php',
-               'LinksUpdate' => 'LinksUpdate.php',
-               'LoadBalancer' => 'LoadBalancer.php',
-               'LogPage' => 'LogPage.php',
-               'MacBinary' => 'MacBinary.php',
-               'MagicWord' => 'MagicWord.php',
-               'MathRenderer' => 'Math.php',
-               'MessageCache' => 'MessageCache.php',
-               'MimeMagic' => 'MimeMagic.php',
-               'Namespace' => 'Namespace.php',
-               'FakeMemCachedClient' => 'ObjectCache.php',
-               'ObjectCacheManager' => 'ObjectCache.php',
-               'MemCachedClientforWiki' => 'ObjectCache.php',
-               'OutputPage' => 'OutputPage.php',
-               'PageHistory' => 'PageHistory.php',
-               'Parser' => 'Parser.php',
-               'ParserOutput' => 'Parser.php',
-               'ParserOptions' => 'Parser.php',
-               'ParserCache' => 'ParserCache.php',
-               'element' => 'ParserXML.php',
-               'xml2php' => 'ParserXML.php',
-               'ParserXML' => 'ParserXML.php',
-               'ProfilerSimple' => 'ProfilerSimple.php',
-               'ProfilerSimpleUDP' => 'ProfilerSimpleUDP.php',
-               'Profiler' => 'Profiling.php',
-               'ProxyTools' => 'ProxyTools.php',
-               'ProtectionForm' => 'ProtectionForm.php',
-               'QueryPage' => 'QueryPage.php',
-               'PageQueryPage' => 'QueryPage.php',
-               'RawPage' => 'RawPage.php',
-               'RecentChange' => 'RecentChange.php',
-               'Revision' => 'Revision.php',
-               'Sanitizer' => 'Sanitizer.php',
-               'SearchEngine' => 'SearchEngine.php',
-               'SearchResultSet' => 'SearchEngine.php',
-               'SearchResult' => 'SearchEngine.php',
-               'SearchEngineDummy' => 'SearchEngine.php',
-               'SearchMySQL' => 'SearchMySQL.php',
-               'MySQLSearchResultSet' => 'SearchMySQL.php',
-               'SearchMySQL4' => 'SearchMySQL4.php',
-               'SearchTsearch2' => 'SearchTsearch2.php',
-               'SearchUpdate' => 'SearchUpdate.php',
-               'SearchUpdateMyISAM' => 'SearchUpdate.php',
-               'SiteConfiguration' => 'SiteConfiguration.php',
-               'SiteStatsUpdate' => 'SiteStatsUpdate.php',
-               'Skin' => 'Skin.php',
-               'MediaWiki_I18N' => 'SkinTemplate.php',
-               'SkinTemplate' => 'SkinTemplate.php',
-               'QuickTemplate' => 'SkinTemplate.php',
-               'SpecialAllpages' => 'SpecialAllpages.php',
-               'AncientPagesPage' => 'SpecialAncientpages.php',
-               'IPBlockForm' => 'SpecialBlockip.php',
-               'BookSourceList' => 'SpecialBooksources.php',
-               'BrokenRedirectsPage' => 'SpecialBrokenRedirects.php',
-               'CategoriesPage' => 'SpecialCategories.php',
-               'EmailConfirmation' => 'SpecialConfirmemail.php',
-               'contribs_finder' => 'SpecialContributions.php',
-               'DeadendPagesPage' => 'SpecialDeadendpages.php',
-               'DisambiguationsPage' => 'SpecialDisambiguations.php',
-               'DoubleRedirectsPage' => 'SpecialDoubleRedirects.php',
-               'EmailUserForm' => 'SpecialEmailuser.php',
-               'GroupsForm' => 'SpecialGroups.php',
-               'WikiRevision' => 'SpecialImport.php',
-               'WikiImporter' => 'SpecialImport.php',
-               'ImportStringSource' => 'SpecialImport.php',
-               'ImportStreamSource' => 'SpecialImport.php',
-               'IPUnblockForm' => 'SpecialIpblocklist.php',
-               'ListredirectsPage' => 'SpecialListredirects.php',
-               'ListUsersPage' => 'SpecialListusers.php',
-               'DBLockForm' => 'SpecialLockdb.php',
-               'LogReader' => 'SpecialLog.php',
-               'LogViewer' => 'SpecialLog.php',
-               'LonelyPagesPage' => 'SpecialLonelypages.php',
-               'LongPagesPage' => 'SpecialLongpages.php',
-               'MIMEsearchPage' => 'SpecialMIMEsearch.php',
-               'MostcategoriesPage' => 'SpecialMostcategories.php',
-               'MostimagesPage' => 'SpecialMostimages.php',
-               'MostlinkedPage' => 'SpecialMostlinked.php',
-               'MostlinkedCategoriesPage' => 'SpecialMostlinkedcategories.php',
-               'MostrevisionsPage' => 'SpecialMostrevisions.php',
-               'MovePageForm' => 'SpecialMovepage.php',
-               'NewPagesPage' => 'SpecialNewpages.php',
-               'SpecialPage' => 'SpecialPage.php',
-               'UnlistedSpecialPage' => 'SpecialPage.php',
-               'IncludableSpecialPage' => 'SpecialPage.php',
-               'PopularPagesPage' => 'SpecialPopularpages.php',
-               'PreferencesForm' => 'SpecialPreferences.php',
-               'SpecialPrefixindex' => 'SpecialPrefixindex.php',
-               'RevisionDeleteForm' => 'SpecialRevisiondelete.php',
-               'RevisionDeleter' => 'SpecialRevisiondelete.php',
-               'SpecialSearch' => 'SpecialSearch.php',
-               'ShortPagesPage' => 'SpecialShortpages.php',
-               'UncategorizedCategoriesPage' => 'SpecialUncategorizedcategories.php',
-               'UncategorizedPagesPage' => 'SpecialUncategorizedpages.php',
-               'PageArchive' => 'SpecialUndelete.php',
-               'UndeleteForm' => 'SpecialUndelete.php',
-               'DBUnlockForm' => 'SpecialUnlockdb.php',
-               'UnusedCategoriesPage' => 'SpecialUnusedcategories.php',
-               'UnusedimagesPage' => 'SpecialUnusedimages.php',
-               'UnusedtemplatesPage' => 'SpecialUnusedtemplates.php',
-               'UnwatchedpagesPage' => 'SpecialUnwatchedpages.php',
-               'UploadForm' => 'SpecialUpload.php',
-               'UploadFormMogile' => 'SpecialUploadMogile.php',
-               'LoginForm' => 'SpecialUserlogin.php',
-               'UserrightsForm' => 'SpecialUserrights.php',
-               'SpecialVersion' => 'SpecialVersion.php',
-               'WantedCategoriesPage' => 'SpecialWantedcategories.php',
-               'WantedPagesPage' => 'SpecialWantedpages.php',
-               'WhatLinksHerePage' => 'SpecialWhatlinkshere.php',
-               'SquidUpdate' => 'SquidUpdate.php',
-               'Title' => 'Title.php',
-               'User' => 'User.php',
-               'MailAddress' => 'UserMailer.php',
-               'EmailNotification' => 'UserMailer.php',
-               'WatchedItem' => 'WatchedItem.php',
-               'WebRequest' => 'WebRequest.php',
-               'FauxRequest' => 'WebRequest.php',
-               'MediaWiki' => 'Wiki.php',
-               'WikiError' => 'WikiError.php',
-               'WikiErrorMsg' => 'WikiError.php',
-               'WikiXmlError' => 'WikiError.php',
-               'ZhClient' => 'ZhClient.php',
-               'memcached' => 'memcached-client.php',
-               'UtfNormal' => 'normal/UtfNormal.php'
-       );
-       if (array_key_exists($class_name, $classes)) {
-               require($classes[$class_name]);
-       } else {
-               return false;
-       }
-}
-
-?>
\ No newline at end of file
index c2f8ea3..42969b6 100644 (file)
@@ -169,7 +169,7 @@ class Block
        {
                $fname = 'Block::loadRange';
 
-               $iaddr = ProxyTools::IP2Hex( $address );
+               $iaddr = wfIP2Hex( $address );
                if ( $iaddr === false ) {
                        # Invalid address
                        return false;
@@ -207,7 +207,7 @@ class Block
         * Determine if a given integer IPv4 address is in a given CIDR network
         */
        function isAddressInRange( $addr, $range ) {
-               list( $network, $bits ) = ProxyTools::parseCIDR( $range );
+               list( $network, $bits ) = wfParseCIDR( $range );
                if ( $network !== false && $addr >> ( 32 - $bits ) == $network >> ( 32 - $bits ) ) {
                        return true;
                } else {
@@ -241,7 +241,7 @@ class Block
                $this->mRangeStart = '';
                $this->mRangeEnd = '';
                if ( $this->mUser == 0 ) {
-                       list( $network, $bits ) = ProxyTools::parseCIDR( $this->mAddress );
+                       list( $network, $bits ) = wfParseCIDR( $this->mAddress );
                        if ( $network !== false ) {
                                $this->mRangeStart = sprintf( '%08X', $network );
                                $this->mRangeEnd = sprintf( '%08X', $network + (1 << (32 - $bits)) - 1 );
@@ -431,7 +431,7 @@ class Block
                $parts = explode( '/', $range );
                if ( count( $parts ) == 2 ) {
                        $shift = 32 - $parts[1];
-                       $ipint = ProxyTools::IP2Unsigned( $parts[0] );
+                       $ipint = wfIP2Unsigned( $parts[0] );
                        $ipint = $ipint >> $shift << $shift;
                        $newip = long2ip( $ipint );
                        $range = "$newip/{$parts[1]}";
index b9e307f..0d116f7 100644 (file)
@@ -5,6 +5,11 @@
  * @subpackage Cache
  */
 
+/**
+ * We need the title class
+ */
+require_once( 'Title.php' );
+
 /**
  * Handles talking to the file cache, putting stuff in and taking it back out.
  * Mostly called from Article.php, also from DatabaseFunctions.php for the
index 6d85e37..d574dda 100644 (file)
@@ -10,6 +10,9 @@ if( !defined( 'MEDIAWIKI' ) )
        die( -1 );
 
 global $wgCategoryMagicGallery;
+if( $wgCategoryMagicGallery )
+       /** */
+       require_once('ImageGallery.php');
 
 /**
  * @package MediaWiki
index a34b496..59c410f 100644 (file)
@@ -7,6 +7,7 @@
  * - recent changes
  */
 
+require_once("RecentChange.php");
 /**
  * @todo document
  * @package MediaWiki
index 6721687..ff33de7 100644 (file)
 /**
  * This is largely cadged from PageHistory::history
  */
-class Credits {
-       function showCreditsPage($article) {
-               global $wgOut;
+function showCreditsPage($article) {
+       global $wgOut;
 
-               $fname = 'Credits::showCreditsPage';
+       $fname = 'showCreditsPage';
 
-               wfProfileIn( $fname );
+       wfProfileIn( $fname );
        
-               $wgOut->setPageTitle( $article->mTitle->getPrefixedText() );
-               $wgOut->setSubtitle( wfMsg( 'creditspage' ) );
-               $wgOut->setArticleFlag( false );
-               $wgOut->setArticleRelated( true );
-               $wgOut->setRobotpolicy( 'noindex,nofollow' );
-
-               if( $article->mTitle->getArticleID() == 0 ) {
-                       $s = wfMsg( 'nocredits' );
-               } else {
-                       $s = Credits::getCredits($article, -1);
-               }
+       $wgOut->setPageTitle( $article->mTitle->getPrefixedText() );
+       $wgOut->setSubtitle( wfMsg( 'creditspage' ) );
+       $wgOut->setArticleFlag( false );
+       $wgOut->setArticleRelated( true );
+       $wgOut->setRobotpolicy( 'noindex,nofollow' );
+
+       if( $article->mTitle->getArticleID() == 0 ) {
+               $s = wfMsg( 'nocredits' );
+       } else {
+               $s = getCredits($article, -1);
+       }
 
-               $wgOut->addHTML( $s );
+       $wgOut->addHTML( $s );
 
-               wfProfileOut( $fname );
-       }
+       wfProfileOut( $fname );
+}
 
-       function getCredits($article, $cnt, $showIfMax=true) {
-               $fname = 'Credits::getCredits';
-               wfProfileIn( $fname );
-               $s = '';
+function getCredits($article, $cnt, $showIfMax=true) {
+       $fname = 'getCredits';
+       wfProfileIn( $fname );
+       $s = '';
 
-               if (isset($cnt) && $cnt != 0) {
-                       $s = Credits::getAuthorCredits($article);
-                       if ($cnt > 1 || $cnt < 0) {
-                               $s .= ' ' . Credits::getContributorCredits($article, $cnt - 1, $showIfMax);
-                       }
+       if (isset($cnt) && $cnt != 0) {
+               $s = getAuthorCredits($article);
+               if ($cnt > 1 || $cnt < 0) {
+                       $s .= ' ' . getContributorCredits($article, $cnt - 1, $showIfMax);
                }
-
-               wfProfileOut( $fname );
-               return $s;
        }
 
-       /**
-        *
-        */
-       function getAuthorCredits($article) {
-               global $wgLang, $wgAllowRealName;
+       wfProfileOut( $fname );
+       return $s;
+}
 
-               $last_author = $article->getUser();
+/**
+ *
+ */
+function getAuthorCredits($article) {
+       global $wgLang, $wgAllowRealName;
 
-               if ($last_author == 0) {
-                       $author_credit = wfMsg('anonymous');
-               } else {
-                       if($wgAllowRealName) { $real_name = User::whoIsReal($last_author); }
-                       $user_name = User::whoIs($last_author);
+       $last_author = $article->getUser();
 
-                       if (!empty($real_name)) {
-                               $author_credit = Credits::creditLink($user_name, $real_name);
-                       } else {
-                               $author_credit = wfMsg('siteuser', Credits::creditLink($user_name));
-                       }
-               }
+       if ($last_author == 0) {
+               $author_credit = wfMsg('anonymous');
+       } else {
+               if($wgAllowRealName) { $real_name = User::whoIsReal($last_author); }
+               $user_name = User::whoIs($last_author);
 
-               $timestamp = $article->getTimestamp();
-               if ($timestamp) {
-                       $d = $wgLang->timeanddate($article->getTimestamp(), true);
+               if (!empty($real_name)) {
+                       $author_credit = creditLink($user_name, $real_name);
                } else {
-                       $d = '';
+                       $author_credit = wfMsg('siteuser', creditLink($user_name));
                }
-               return wfMsg('lastmodifiedby', $d, $author_credit);
        }
 
-       /**
-        *
-        */
-       function getContributorCredits($article, $cnt, $showIfMax) {
+       $timestamp = $article->getTimestamp();
+       if ($timestamp) {
+               $d = $wgLang->timeanddate($article->getTimestamp(), true);
+       } else {
+               $d = '';
+       }
+       return wfMsg('lastmodifiedby', $d, $author_credit);
+}
 
-               global $wgLang, $wgAllowRealName;
+/**
+ *
+ */
+function getContributorCredits($article, $cnt, $showIfMax) {
 
-               $contributors = $article->getContributors();
+       global $wgLang, $wgAllowRealName;
 
-               $others_link = '';
+       $contributors = $article->getContributors();
 
-               # Hmm... too many to fit!
+       $others_link = '';
 
-               if ($cnt > 0 && count($contributors) > $cnt) {
-                       $others_link = Credits::creditOthersLink($article);
-                       if (!$showIfMax) {
-                               return wfMsg('othercontribs', $others_link);
-                       } else {
-                               $contributors = array_slice($contributors, 0, $cnt);
-                       }
+       # Hmm... too many to fit!
+
+       if ($cnt > 0 && count($contributors) > $cnt) {
+               $others_link = creditOthersLink($article);
+               if (!$showIfMax) {
+                       return wfMsg('othercontribs', $others_link);
+               } else {
+                       $contributors = array_slice($contributors, 0, $cnt);
                }
+       }
 
-               $real_names = array();
-               $user_names = array();
+       $real_names = array();
+       $user_names = array();
 
-               $anon = '';
+       $anon = '';
 
-               # Sift for real versus user names
+       # Sift for real versus user names
 
-               foreach ($contributors as $user_parts) {
-                       if ($user_parts[0] != 0) {
-                               if ($wgAllowRealName && !empty($user_parts[2])) {
-                                       $real_names[] = Credits::creditLink($user_parts[1], $user_parts[2]);
-                               } else {
-                                       $user_names[] = Credits::creditLink($user_parts[1]);
-                               }
+       foreach ($contributors as $user_parts) {
+               if ($user_parts[0] != 0) {
+                       if ($wgAllowRealName && !empty($user_parts[2])) {
+                               $real_names[] = creditLink($user_parts[1], $user_parts[2]);
                        } else {
-                               $anon = wfMsg('anonymous');
+                               $user_names[] = creditLink($user_parts[1]);
                        }
+               } else {
+                       $anon = wfMsg('anonymous');
                }
+       }
 
-               # Two strings: real names, and user names
+       # Two strings: real names, and user names
 
-               $real = $wgLang->listToText($real_names);
-               $user = $wgLang->listToText($user_names);
+       $real = $wgLang->listToText($real_names);
+       $user = $wgLang->listToText($user_names);
 
-               # "ThisSite user(s) A, B and C"
+       # "ThisSite user(s) A, B and C"
 
-               if (!empty($user)) {
-                       $user = wfMsg('siteusers', $user);
-               }
+       if (!empty($user)) {
+               $user = wfMsg('siteusers', $user);
+       }
 
-               # This is the big list, all mooshed together. We sift for blank strings
+       # This is the big list, all mooshed together. We sift for blank strings
 
-               $fulllist = array();
+       $fulllist = array();
 
-               foreach (array($real, $user, $anon, $others_link) as $s) {
-                       if (!empty($s)) {
-                               array_push($fulllist, $s);
-                       }
+       foreach (array($real, $user, $anon, $others_link) as $s) {
+               if (!empty($s)) {
+                       array_push($fulllist, $s);
                }
+       }
 
-               # Make the list into text...
+       # Make the list into text...
 
-               $creds = $wgLang->listToText($fulllist);
+       $creds = $wgLang->listToText($fulllist);
 
-               # "Based on work by ..."
+       # "Based on work by ..."
 
-               return (empty($creds)) ? '' : wfMsg('othercontribs', $creds);
-       }
+       return (empty($creds)) ? '' : wfMsg('othercontribs', $creds);
+}
 
-       /**
       *
       */
-       function creditLink($user_name, $link_text = '') {
-               global $wgUser, $wgContLang;
-               $skin = $wgUser->getSkin();
-               return $skin->makeLink($wgContLang->getNsText(NS_USER) . ':' . $user_name,
-                                      htmlspecialchars( (empty($link_text)) ? $user_name : $link_text ));
-       }
+/**
+ *
+ */
+function creditLink($user_name, $link_text = '') {
+       global $wgUser, $wgContLang;
+       $skin = $wgUser->getSkin();
+       return $skin->makeLink($wgContLang->getNsText(NS_USER) . ':' . $user_name,
+                              htmlspecialchars( (empty($link_text)) ? $user_name : $link_text ));
+}
 
-       /**
-        *
-        */
-       function creditOthersLink($article) {
-               global $wgUser;
-               $skin = $wgUser->getSkin();
-               return $skin->makeKnownLink($article->mTitle->getPrefixedText(), wfMsg('others'), 'action=credits');
-       }
+/**
+ *
+ */
+function creditOthersLink($article) {
+       global $wgUser;
+       $skin = $wgUser->getSkin();
+       return $skin->makeKnownLink($article->mTitle->getPrefixedText(), wfMsg('others'), 'action=credits');
 }
+
 ?>
index 904e2bd..2bdf610 100644 (file)
@@ -5,6 +5,11 @@
  * @package MediaWiki
  */
 
+/**
+ * Depends on the CacheManager
+ */
+require_once( 'CacheManager.php' );
+
 /** See Database::makeList() */
 define( 'LIST_COMMA', 0 );
 define( 'LIST_AND', 1 );
index 396b1c1..226bb4d 100644 (file)
@@ -6,6 +6,11 @@
  * @package MediaWiki
  */
 
+/**
+ * Depends on database
+ */
+require_once( 'Database.php' );
+
 class OracleBlob extends DBObject {
        function isLOB() {
                return true;
index 442ec35..130a247 100644 (file)
  * @package MediaWiki
  */
 
+/**
+ * Depends on database
+ */
+require_once( 'Database.php' );
+
 /**
  *
  * @package MediaWiki
index 900d503..58fdc76 100644 (file)
@@ -5,6 +5,9 @@
  * @subpackage DifferenceEngine
  */
 
+/** */
+require_once( 'Revision.php' );
+
 define( 'MAX_DIFF_LINE', 10000 );
 define( 'MAX_DIFF_XREF_LENGTH', 10000 );
 
index 28b4084..341427b 100644 (file)
@@ -725,7 +725,7 @@ class EditPage {
                $this->summary = '';
                if ( !$this->mArticle->exists() && $this->mArticle->mTitle->getNamespace() == NS_MEDIAWIKI )
                        $this->textbox1 = wfMsgWeirdKey ( $this->mArticle->mTitle->getText() ) ;
-               ProxyTools::proxyCheck();
+               wfProxyCheck();
        }
 
        /**
@@ -1118,6 +1118,7 @@ END
                $wgOut->addHTML( "<input type=\"hidden\" name=\"wpAutoSummary\" value=\"$autosumm\" />\n" );
 
                if ( $this->isConflict ) {
+                       require_once( "DifferenceEngine.php" );
                        $wgOut->addWikiText( '==' . wfMsg( "yourdiff" ) . '==' );
 
                        $de = new DifferenceEngine( $this->mTitle );
@@ -1617,6 +1618,7 @@ END
         * @return string HTML
         */
        function getDiff() {
+               require_once( 'DifferenceEngine.php' );
                $oldtext = $this->mArticle->fetchContent();
                $newtext = $this->mArticle->replaceSection(
                        $this->section, $this->textbox1, $this->summary, $this->edittime );
index 244bbd3..d0253eb 100644 (file)
@@ -22,6 +22,9 @@
  * @subpackage SpecialPage
  */
 
+/** */
+require_once( 'Revision.php' );
+
 define( 'MW_EXPORT_FULL',     0 );
 define( 'MW_EXPORT_CURRENT',  1 );
 
index 70713d0..f610df8 100644 (file)
@@ -6,6 +6,8 @@
  * DB accessable external objects
  *
  */
+require_once( 'LoadBalancer.php' );
+
 
 /** @package MediaWiki */
 
index ee48231..f8ef126 100644 (file)
@@ -27,6 +27,8 @@ $wgTotalEdits = -1;
 
 
 require_once( 'DatabaseFunctions.php' );
+require_once( 'UpdateClasses.php' );
+require_once( 'LogPage.php' );
 require_once( 'normal/UtfNormalUtil.php' );
 require_once( 'XmlFunctions.php' );
 
@@ -1506,6 +1508,11 @@ function &wfGetMimeMagic() {
                return $wgMimeMagic;
        }
 
+       if (!class_exists("MimeMagic")) {
+               #include on demand
+               require_once("MimeMagic.php");
+       }
+
        $wgMimeMagic= new MimeMagic();
 
        return $wgMimeMagic;
@@ -1854,27 +1861,4 @@ class ReplacerCallback {
        }
 }
 
-/***** DEPRECATED INTERFACES *******/
-function wfGetForwardedFor() { return ProxyTools::getForwardedFor(); }
-function wfGetIP() { return ProxyTools::getIP(); }
-function wfIP2Unsigned($ip) { return ProxyTools::IP2Unsigned($ip); }
-function wfIP2Hex($ip) { return ProxyTools::IP2Hex($ip); }
-function wfIsIPPublic($ip) { return ProxyTools::isIPPublic($ip); }
-function wfProxyCheck() { return ProxyTools::proxyCheck(); }
-function wfParseCIDR($range) { return ProxyTools::parseCIDR($range); }
-function wfIsLocallyBlockedProxy($ip) { return ProxyTools::isLocallyBlockedProxy($ip); }
-
-function wfGetCache($type) { return ObjectCacheManager::getCache($type); }
-function wfGetMainCache() { return ObjectCacheManager::getMainCache(); }
-function wfGetMessageCacheStorage() { return ObjectCacheManager::getMessageCache(); }
-function wfGetParserCacheStorage() { return ObjectCacheManager::getParserCache(); }
-
-function renderMath($tex) { return MathRenderer::renderMath($tex); }
-
-function showCreditsPage($article) { return Credits::showCreditsPage($article); }
-function getCredits($article, $cnt, $showIfMax=true) { return Credits::getCredits($article,$cnt,$showIfMax); }
-
-function wfGetHTTP( $url, $timeout = 'default' ) { return HttpFunctions::getHTTP($url,$timeout); }
-function wfIsLocalURL( $url ) { return HttpFunctions::isLocalURL($url); }
-
 ?>
index 8679660..4dee4da 100644 (file)
@@ -167,6 +167,17 @@ class ConcatenatedGzipHistoryBlob extends HistoryBlob
        }
 }
 
+
+/**
+ * One-step cache variable to hold base blobs; operations that
+ * pull multiple revisions may often pull multiple times from
+ * the same blob. By keeping the last-used one open, we avoid
+ * redundant unserialization and decompression overhead.
+ */
+global $wgBlobCache;
+$wgBlobCache = array();
+
+
 /**
  * @package MediaWiki
  */
@@ -204,15 +215,6 @@ class HistoryBlobStub {
        function getText() {
                $fname = 'HistoryBlob::getText';
                global $wgBlobCache;
-               /**
-                * One-step cache variable to hold base blobs; operations that
-                * pull multiple revisions may often pull multiple times from
-                * the same blob. By keeping the last-used one open, we avoid
-                * redundant unserialization and decompression overhead.
-                */
-               if (!is_array($wgBlobCache)) {
-                       $wgBlobCache = array();
-               }
                if( isset( $wgBlobCache[$this->mOldId] ) ) {
                        $obj = $wgBlobCache[$this->mOldId];
                } else {
@@ -229,6 +231,7 @@ class HistoryBlobStub {
                                        wfProfileOut( $fname );
                                        return false;
                                }
+                               require_once('ExternalStore.php');
                                $row->old_text=ExternalStore::fetchFromUrl($url);
 
                        }
index f748640..fd2e87e 100644 (file)
@@ -3,89 +3,88 @@
  * Various HTTP related functions
  */
 
-class HttpFunctions {
-       /**
-        * Get the contents of a file by HTTP
-        *
-        * if $timeout is 'default', $wgHTTPTimeout is used
-        */
-       function getHTTP( $url, $timeout = 'default' ) {
-               global $wgHTTPTimeout, $wgHTTPProxy, $wgVersion, $wgTitle;
+/**
+ * Get the contents of a file by HTTP
+ *
+ * if $timeout is 'default', $wgHTTPTimeout is used
+ */
+function wfGetHTTP( $url, $timeout = 'default' ) {
+       global $wgHTTPTimeout, $wgHTTPProxy, $wgVersion, $wgTitle;
 
-               # Use curl if available
-               if ( function_exists( 'curl_init' ) ) {
-                       $c = curl_init( $url );
-                       if ( HttpFunctions::isLocalURL( $url ) ) {
-                               curl_setopt( $c, CURLOPT_PROXY, 'localhost:80' );
-                       } else if ($wgHTTPProxy) {
-                               curl_setopt($c, CURLOPT_PROXY, $wgHTTPProxy);
-                       }
+       # Use curl if available
+       if ( function_exists( 'curl_init' ) ) {
+               $c = curl_init( $url );
+               if ( wfIsLocalURL( $url ) ) {
+                       curl_setopt( $c, CURLOPT_PROXY, 'localhost:80' );
+               } else if ($wgHTTPProxy) {
+                       curl_setopt($c, CURLOPT_PROXY, $wgHTTPProxy);
+               }
 
-                       if ( $timeout == 'default' ) {
-                               $timeout = $wgHTTPTimeout;
-                       }
-                       curl_setopt( $c, CURLOPT_TIMEOUT, $timeout );
-                       curl_setopt( $c, CURLOPT_USERAGENT, "MediaWiki/$wgVersion" );
+               if ( $timeout == 'default' ) {
+                       $timeout = $wgHTTPTimeout;
+               }
+               curl_setopt( $c, CURLOPT_TIMEOUT, $timeout );
+               curl_setopt( $c, CURLOPT_USERAGENT, "MediaWiki/$wgVersion" );
 
-                       # Set the referer to $wgTitle, even in command-line mode
-                       # This is useful for interwiki transclusion, where the foreign
-                       # server wants to know what the referring page is.
-                       # $_SERVER['REQUEST_URI'] gives a less reliable indication of the
-                       # referring page.
-                       if ( is_object( $wgTitle ) ) {
-                               curl_setopt( $c, CURLOPT_REFERER, $wgTitle->getFullURL() );
-                       }
+               # Set the referer to $wgTitle, even in command-line mode
+               # This is useful for interwiki transclusion, where the foreign
+               # server wants to know what the referring page is.
+               # $_SERVER['REQUEST_URI'] gives a less reliable indication of the
+               # referring page.
+               if ( is_object( $wgTitle ) ) {
+                       curl_setopt( $c, CURLOPT_REFERER, $wgTitle->getFullURL() );
+               }
 
-                       ob_start();
-                       curl_exec( $c );
-                       $text = ob_get_contents();
-                       ob_end_clean();
+               ob_start();
+               curl_exec( $c );
+               $text = ob_get_contents();
+               ob_end_clean();
 
-                       # Don't return the text of error messages, return false on error
-                       if ( curl_getinfo( $c, CURLINFO_HTTP_CODE ) != 200 ) {
-                               $text = false;
-                       }
-                       curl_close( $c );
-               } else {
-                       # Otherwise use file_get_contents, or its compatibility function from GlobalFunctions.php
-                       # This may take 3 minutes to time out, and doesn't have local fetch capabilities
-                       $url_fopen = ini_set( 'allow_url_fopen', 1 );
-                       $text = file_get_contents( $url );
-                       ini_set( 'allow_url_fopen', $url_fopen );
+               # Don't return the text of error messages, return false on error
+               if ( curl_getinfo( $c, CURLINFO_HTTP_CODE ) != 200 ) {
+                       $text = false;
                }
-               return $text;
+               curl_close( $c );
+       } else {
+               # Otherwise use file_get_contents, or its compatibility function from GlobalFunctions.php
+               # This may take 3 minutes to time out, and doesn't have local fetch capabilities
+               $url_fopen = ini_set( 'allow_url_fopen', 1 );
+               $text = file_get_contents( $url );
+               ini_set( 'allow_url_fopen', $url_fopen );
        }
+       return $text;
+}
 
-       /**
       * Check if the URL can be served by localhost
       */
-       function isLocalURL( $url ) {
-               global $wgCommandLineMode, $wgConf;
-               if ( $wgCommandLineMode ) {
-                       return false;
-               }
+/**
+ * Check if the URL can be served by localhost
+ */
+function wfIsLocalURL( $url ) {
+       global $wgCommandLineMode, $wgConf;
+       if ( $wgCommandLineMode ) {
+               return false;
+       }
 
-               // Extract host part
-               $matches = array();
-               if ( preg_match( '!^http://([\w.-]+)[/:].*$!', $url, $matches ) ) {
-                       $host = $matches[1];
-                       // Split up dotwise
-                       $domainParts = explode( '.', $host );
-                       // Check if this domain or any superdomain is listed in $wgConf as a local virtual host
-                       $domainParts = array_reverse( $domainParts );
-                       for ( $i = 0; $i < count( $domainParts ); $i++ ) {
-                               $domainPart = $domainParts[$i];
-                               if ( $i == 0 ) {
-                                       $domain = $domainPart;
-                               } else {
-                                       $domain = $domainPart . '.' . $domain;
-                               }
-                               if ( $wgConf->isLocalVHost( $domain ) ) {
-                                       return true;
-                               }
+       // Extract host part
+       $matches = array();
+       if ( preg_match( '!^http://([\w.-]+)[/:].*$!', $url, $matches ) ) {
+               $host = $matches[1];
+               // Split up dotwise
+               $domainParts = explode( '.', $host );
+               // Check if this domain or any superdomain is listed in $wgConf as a local virtual host
+               $domainParts = array_reverse( $domainParts );
+               for ( $i = 0; $i < count( $domainParts ); $i++ ) {
+                       $domainPart = $domainParts[$i];
+                       if ( $i == 0 ) {
+                               $domain = $domainPart;
+                       } else {
+                               $domain = $domainPart . '.' . $domain;
+                       }
+                       if ( $wgConf->isLocalVHost( $domain ) ) {
+                               return true;
                        }
                }
-               return false;
        }
+       return false;
 }
+
 ?>
index 8e6cf43..b219642 100644 (file)
@@ -12,6 +12,9 @@
  * extension=extensions/php_exif.dll
  */
 
+if ($wgShowEXIF)
+       require_once('Exif.php');
+
 /**
  * Bump this number when serialized cache records may be incompatible.
  */
index e9ed191..9b91c87 100644 (file)
@@ -9,6 +9,8 @@
 if( !defined( 'MEDIAWIKI' ) )
        die( -1 );
 
+require_once( 'Image.php' );
+
 /**
  * Special handling for image description pages
  * @package MediaWiki
@@ -307,8 +309,9 @@ END
                $wgOut->addHTML($sharedtext);
 
                if ($wgRepositoryBaseUrl && $wgFetchCommonsDescriptions) {
+                       require_once("HttpFunctions.php");
                        $ur = ini_set('allow_url_fopen', true);
-                       $text = HttpFunctions::getHTTP($url . '?action=render');
+                       $text = wfGetHTTP($url . '?action=render');
                        ini_set('allow_url_fopen', $ur);
                        if ($text)
                                $this->mExtraDescription = $text;
@@ -671,6 +674,7 @@ END
        }
 
        function blockedIPpage() {
+               require_once( 'EditPage.php' );
                $edit = new EditPage( $this );
                return $edit->blockedIPpage();
        }
index 5472858..bd09502 100644 (file)
@@ -119,6 +119,7 @@ class LinksUpdate {
                if ( $this->mRecursive ) {
                        $tlto = $this->mTitle->getTemplateLinksTo();
                        if ( count( $tlto ) ) {
+                               require_once( 'JobQueue.php' );
                                Job::queueLinksJobs( $tlto );
                        }
                }
@@ -154,6 +155,7 @@ class LinksUpdate {
                if ( $this->mRecursive ) {
                        $tlto = $this->mTitle->getTemplateLinksTo();
                        if ( count( $tlto ) ) {
+                               require_once( 'JobQueue.php' );
                                Job::queueLinksJobs( $tlto );
                        }
                }
index 3e6cd7e..6cf743b 100644 (file)
@@ -7,6 +7,7 @@
 /**
  * Depends on the database object
  */
+require_once( 'Database.php' );
 
 # Valid database indexes
 # Operation-based indexes
@@ -439,14 +440,12 @@ class LoadBalancer {
                }
 
                extract( $server );
-
                # Get class for this database type
-               if ($type != 'mysql' ) {
-                       $class = 'Database' . ucfirst( $type );
-               } else {
-                       $class = 'Database';
+               $class = 'Database' . ucfirst( $type );
+               if ( !class_exists( $class ) ) {
+                       require_once( "$class.php" );
                }
-               
+
                # Create object
                $db = new $class( $host, $user, $password, $dbname, 1, $flags );
                $db->setLBInfo( $server );
index 753c1dc..c3b2367 100644 (file)
@@ -83,6 +83,7 @@ class LogPage {
                                        $rcComment .= ': ' . $this->comment;
                        }
 
+                       require_once( 'RecentChange.php' );
                        RecentChange::notifyLog( $now, $titleObj, $wgUser, $rcComment, '',
                                $this->type, $this->action, $this->target, $this->comment, $this->params );
                }
index d47a429..e40abdf 100644 (file)
@@ -248,13 +248,15 @@ class MathRenderer {
                wfDebug( "TeX: getHashPath, hash is: $this->hash, path is: $path\n" );
                return $path;
        }
-       
-       static function renderMath ( $tex ) {
-               global $wgUser;
-               $math = new MathRenderer( $tex );
-               $math->setOutputMode( $wgUser->getOption('math'));
-               return $math->render();
-       }
+
+
+}
+
+function renderMath( $tex ) {
+       global $wgUser;
+       $math = new MathRenderer( $tex );
+       $math->setOutputMode( $wgUser->getOption('math'));
+       return $math->render();
 }
 
 ?>
index 083e220..8e54af9 100644 (file)
@@ -5,6 +5,9 @@
  * @subpackage Cache
  */
 
+/** */
+require_once( 'Revision.php' );
+
 /**
  *
  */
index d851f3a..fe7417d 100644 (file)
@@ -33,91 +33,93 @@ class FakeMemCachedClient {
 global $wgCaches;
 $wgCaches = array();
 
-class ObjectCacheManager {
-       /* @static */
-       function getCache( $inputType ) {
-               global $wgCaches, $wgMemCachedServers, $wgMemCachedDebug, $wgMemCachedPersistent;
-               $cache = false;
+/** @todo document */
+function &wfGetCache( $inputType ) {
+       global $wgCaches, $wgMemCachedServers, $wgMemCachedDebug, $wgMemCachedPersistent;
+       $cache = false;
 
-               if ( $inputType == CACHE_ANYTHING ) {
-                       reset( $wgCaches );
-                       $type = key( $wgCaches );
-                       if ( $type === false || $type === CACHE_NONE ) {
-                               $type = CACHE_DB;
-                       }
-               } else {
-                       $type = $inputType;
+       if ( $inputType == CACHE_ANYTHING ) {
+               reset( $wgCaches );
+               $type = key( $wgCaches );
+               if ( $type === false || $type === CACHE_NONE ) {
+                       $type = CACHE_DB;
                }
+       } else {
+               $type = $inputType;
+       }
 
-               if ( $type == CACHE_MEMCACHED ) {
-                       if ( !array_key_exists( CACHE_MEMCACHED, $wgCaches ) ){
-                               $wgCaches[CACHE_DB] = new MemCachedClientforWiki(
-                                       array('persistant' => $wgMemCachedPersistent, 'compress_threshold' => 1500 ) );
-                               $cache =& $wgCaches[CACHE_DB];
-                               $cache->set_servers( $wgMemCachedServers );
-                               $cache->set_debug( $wgMemCachedDebug );
-                       }
-               } elseif ( $type == CACHE_ACCEL ) {
-                       if ( !array_key_exists( CACHE_ACCEL, $wgCaches ) ) {
-                               if ( function_exists( 'eaccelerator_get' ) ) {
-                                       $wgCaches[CACHE_ACCEL] = new eAccelBagOStuff;
-                               } elseif ( function_exists( 'apc_fetch') ) {
-                                       $wgCaches[CACHE_ACCEL] = new APCBagOStuff;
-                               } elseif ( function_exists( 'mmcache_get' ) ) {
-                                       $wgCaches[CACHE_ACCEL] = new TurckBagOStuff;
-                               } else {
-                                       $wgCaches[CACHE_ACCEL] = false;
+       if ( $type == CACHE_MEMCACHED ) {
+               if ( !array_key_exists( CACHE_MEMCACHED, $wgCaches ) ){
+                       require_once( 'memcached-client.php' );
+
+                       if (!class_exists("MemcachedClientforWiki")) {
+                               class MemCachedClientforWiki extends memcached {
+                                       function _debugprint( $text ) {
+                                               wfDebug( "memcached: $text\n" );
+                                       }
                                }
                        }
-                       if ( $wgCaches[CACHE_ACCEL] !== false ) {
-                               $cache =& $wgCaches[CACHE_ACCEL];
-                       }
-               }
 
-               if ( $type == CACHE_DB || ( $inputType == CACHE_ANYTHING && $cache === false ) ) {
-                       if ( !array_key_exists( CACHE_DB, $wgCaches ) ) {
-                               $wgCaches[CACHE_DB] = new MediaWikiBagOStuff('objectcache');
-                       }
+                       $wgCaches[CACHE_DB] = new MemCachedClientforWiki(
+                               array('persistant' => $wgMemCachedPersistent, 'compress_threshold' => 1500 ) );
                        $cache =& $wgCaches[CACHE_DB];
+                       $cache->set_servers( $wgMemCachedServers );
+                       $cache->set_debug( $wgMemCachedDebug );
                }
-
-               if ( $cache === false ) {
-                       if ( !array_key_exists( CACHE_NONE, $wgCaches ) ) {
-                               $wgCaches[CACHE_NONE] = new FakeMemCachedClient;
+       } elseif ( $type == CACHE_ACCEL ) {
+               if ( !array_key_exists( CACHE_ACCEL, $wgCaches ) ) {
+                       if ( function_exists( 'eaccelerator_get' ) ) {
+                               require_once( 'BagOStuff.php' );
+                               $wgCaches[CACHE_ACCEL] = new eAccelBagOStuff;
+                       } elseif ( function_exists( 'apc_fetch') ) {
+                               require_once( 'BagOStuff.php' );
+                               $wgCaches[CACHE_ACCEL] = new APCBagOStuff;
+                       } elseif ( function_exists( 'mmcache_get' ) ) {
+                               require_once( 'BagOStuff.php' );
+                               $wgCaches[CACHE_ACCEL] = new TurckBagOStuff;
+                       } else {
+                               $wgCaches[CACHE_ACCEL] = false;
                        }
-                       $cache =& $wgCaches[CACHE_NONE];
                }
-
-               return $cache;
-       }
-       
-       /** @static */
-       function &getMainCache() {
-               global $wgMainCacheType;
-               $ret =& ObjectCacheManager::getCache( $wgMainCacheType );
-               return $ret;
+               if ( $wgCaches[CACHE_ACCEL] !== false ) {
+                       $cache =& $wgCaches[CACHE_ACCEL];
+               }
        }
 
-       /** @static */
-       function &getMessageCache() {
-               global $wgMessageCacheType;
-               $ret =& ObjectCacheManager::getCache( $wgMessageCacheType );
-               return $ret;
+       if ( $type == CACHE_DB || ( $inputType == CACHE_ANYTHING && $cache === false ) ) {
+               if ( !array_key_exists( CACHE_DB, $wgCaches ) ) {
+                       require_once( 'BagOStuff.php' );
+                       $wgCaches[CACHE_DB] = new MediaWikiBagOStuff('objectcache');
+               }
+               $cache =& $wgCaches[CACHE_DB];
        }
-       
-       /** @static */
-       function &getParserCache() {
-               global $wgParserCacheType;
-               $ret =& ObjectCacheManager::getCache( $wgParserCacheType );
-               return $ret;
+
+       if ( $cache === false ) {
+               if ( !array_key_exists( CACHE_NONE, $wgCaches ) ) {
+                       $wgCaches[CACHE_NONE] = new FakeMemCachedClient;
+               }
+               $cache =& $wgCaches[CACHE_NONE];
        }
-       
+
+       return $cache;
 }
 
-class MemCachedClientforWiki extends memcached {
-       function _debugprint( $text ) {
-               wfDebug( "memcached: $text\n" );
-       }
+function &wfGetMainCache() {
+       global $wgMainCacheType;
+       $ret =& wfGetCache( $wgMainCacheType );
+       return $ret;
+}
+
+function &wfGetMessageCacheStorage() {
+       global $wgMessageCacheType;
+       $ret =& wfGetCache( $wgMessageCacheType );
+       return $ret;
+}
+
+function &wfGetParserCacheStorage() {
+       global $wgParserCacheType;
+       $ret =& wfGetCache( $wgParserCacheType );
+       return $ret;
 }
 
 ?>
index 451acb2..c155d38 100644 (file)
@@ -5,6 +5,9 @@ if ( ! defined( 'MEDIAWIKI' ) )
  * @package MediaWiki
  */
 
+if ( $wgUseTeX )
+       require_once 'Math.php';
+
 /**
  * @todo document
  * @package MediaWiki
@@ -647,7 +650,7 @@ class OutputPage {
 
                $id = $wgUser->blockedBy();
                $reason = $wgUser->blockedFor();
-               $ip = ProxyTools::getIP();
+               $ip = wfGetIP();
 
                if ( is_numeric( $id ) ) {
                        $name = User::whoIs( $id );
index 2c69a3e..2e70e4d 100644 (file)
@@ -576,6 +576,9 @@ class PageHistory {
         * @param string $type
         */
        function feed( $type ) {
+               require_once 'Feed.php';
+               require_once 'SpecialRecentchanges.php';
+               
                global $wgFeedClasses;
                if( !isset( $wgFeedClasses[$type] ) ) {
                        global $wgOut;
index 8e6fd96..2bfa482 100644 (file)
@@ -6,6 +6,11 @@
  * @subpackage Parser
  */
 
+/** */
+require_once( 'Sanitizer.php' );
+require_once( 'HttpFunctions.php' );
+require_once( 'ImageGallery.php' );
+
 /**
  * Update this version number when the ParserOutput format
  * changes in an incompatible way, so the parser cache
@@ -447,7 +452,7 @@ class Parser
                                        $output = wfEscapeHTMLTagsOnly( $content );
                                        break;
                                case 'math':
-                                       $output = MathRenderer::renderMath( $content );
+                                       $output = renderMath( $content );
                                        break;
                                case 'pre':
                                        // Backwards-compatibility hack
@@ -2967,7 +2972,7 @@ class Parser
                        }
                }
 
-               $text = HttpFunctions::getHTTP($url);
+               $text = wfGetHTTP($url);
                if (!$text)
                        return wfMsg('scarytranscludefailed', $url);
 
index b5dae85..e7b64f6 100644 (file)
@@ -5,6 +5,9 @@
  * @subpackage Experimental
  */
 
+/** */
+require_once ('Parser.php');
+
 /**
  * This should one day become the XML->(X)HTML parser
  * Based on work by Jan Hidders and Magnus Manske
index 531e336..edecc4f 100644 (file)
@@ -278,6 +278,7 @@ class Profiler {
                        }
                }
                $prof .= "\nTotal: $total\n\n";
+
                return $prof;
        }
 
@@ -321,6 +322,7 @@ class Profiler {
                } else {
                        $pfhost = '';
                }
+
                $sql = "UPDATE $profiling "."SET pf_count=pf_count+{$eventCount}, "."pf_time=pf_time + {$timeSum} ".
                        "WHERE pf_name='{$encname}' AND pf_server='{$pfhost}'";
                $dbw->query($sql);
index 350078d..bed79c1 100644 (file)
  * @package MediaWiki
  */
 
-class ProxyTools {
-       function getForwardedFor() {
-               if( function_exists( 'apache_request_headers' ) ) {
-                       // More reliable than $_SERVER due to case and -/_ folding
-                       $set = apache_request_headers();
-                       $index = 'X-Forwarded-For';
-               } else {
-                       // Subject to spoofing with headers like X_Forwarded_For
-                       $set = $_SERVER;
-                       $index = 'HTTP_X_FORWARDED_FOR';
-               }
-               if( isset( $set[$index] ) ) {
-                       return $set[$index];
-               } else {
-                       return null;
-               }
+function wfGetForwardedFor() {
+       if( function_exists( 'apache_request_headers' ) ) {
+               // More reliable than $_SERVER due to case and -/_ folding
+               $set = apache_request_headers();
+               $index = 'X-Forwarded-For';
+       } else {
+               // Subject to spoofing with headers like X_Forwarded_For
+               $set = $_SERVER;
+               $index = 'HTTP_X_FORWARDED_FOR';
        }
+       if( isset( $set[$index] ) ) {
+               return $set[$index];
+       } else {
+               return null;
+       }
+}
 
-       /** Work out the IP address based on various globals */
-       function getIP() {
-               global $wgSquidServers, $wgSquidServersNoPurge, $wgIP;
+/** Work out the IP address based on various globals */
+function wfGetIP() {
+       global $wgSquidServers, $wgSquidServersNoPurge, $wgIP;
 
-               # Return cached result
-               if ( !empty( $wgIP ) ) {
-                       return $wgIP;
-               }
+       # Return cached result
+       if ( !empty( $wgIP ) ) {
+               return $wgIP;
+       }
 
-               /* collect the originating ips */
-               # Client connecting to this webserver
-               if ( isset( $_SERVER['REMOTE_ADDR'] ) ) {
-                       $ipchain = array( $_SERVER['REMOTE_ADDR'] );
-               } else {
-                       # Running on CLI?
-                       $ipchain = array( '127.0.0.1' );
-               }
-               $ip = $ipchain[0];
-
-               # Get list of trusted proxies
-               # Flipped for quicker access
-               $trustedProxies = array_flip( array_merge( $wgSquidServers, $wgSquidServersNoPurge ) );
-               if ( count( $trustedProxies ) ) {
-                       # Append XFF on to $ipchain
-                       $forwardedFor = ProxyTools::getForwardedFor();
-                       if ( isset( $forwardedFor ) ) {
-                               $xff = array_map( 'trim', explode( ',', $forwardedFor ) );
-                               $xff = array_reverse( $xff );
-                               $ipchain = array_merge( $ipchain, $xff );
-                       }
-                       # Step through XFF list and find the last address in the list which is a trusted server
-                       # Set $ip to the IP address given by that trusted server, unless the address is not sensible (e.g. private)
-                       foreach ( $ipchain as $i => $curIP ) {
-                               if ( array_key_exists( $curIP, $trustedProxies ) ) {
-                                       if ( isset( $ipchain[$i + 1] ) && ProxyTools::isIPPublic( $ipchain[$i + 1] ) ) {
-                                               $ip = $ipchain[$i + 1];
-                                       }
-                               } else {
-                                       break;
+       /* collect the originating ips */
+       # Client connecting to this webserver
+       if ( isset( $_SERVER['REMOTE_ADDR'] ) ) {
+               $ipchain = array( $_SERVER['REMOTE_ADDR'] );
+       } else {
+               # Running on CLI?
+               $ipchain = array( '127.0.0.1' );
+       }
+       $ip = $ipchain[0];
+
+       # Get list of trusted proxies
+       # Flipped for quicker access
+       $trustedProxies = array_flip( array_merge( $wgSquidServers, $wgSquidServersNoPurge ) );
+       if ( count( $trustedProxies ) ) {
+               # Append XFF on to $ipchain
+               $forwardedFor = wfGetForwardedFor();
+               if ( isset( $forwardedFor ) ) {
+                       $xff = array_map( 'trim', explode( ',', $forwardedFor ) );
+                       $xff = array_reverse( $xff );
+                       $ipchain = array_merge( $ipchain, $xff );
+               }
+               # Step through XFF list and find the last address in the list which is a trusted server
+               # Set $ip to the IP address given by that trusted server, unless the address is not sensible (e.g. private)
+               foreach ( $ipchain as $i => $curIP ) {
+                       if ( array_key_exists( $curIP, $trustedProxies ) ) {
+                               if ( isset( $ipchain[$i + 1] ) && wfIsIPPublic( $ipchain[$i + 1] ) ) {
+                                       $ip = $ipchain[$i + 1];
                                }
+                       } else {
+                               break;
                        }
                }
+       }
 
-               wfDebug( "IP: $ip\n" );
-               $wgIP = $ip;
-               return $ip;
-       }
-
-       /**
-        * Given an IP address in dotted-quad notation, returns an unsigned integer.
-        * Like ip2long() except that it actually works and has a consistent error return value.
-        */
-       function IP2Unsigned( $ip ) {
-               $n = ip2long( $ip );
-               if ( $n == -1 || $n === false ) { # Return value on error depends on PHP version
-                       $n = false;
-               } elseif ( $n < 0 ) {
-                       $n += pow( 2, 32 );
-               }
-               return $n;
+       wfDebug( "IP: $ip\n" );
+       $wgIP = $ip;
+       return $ip;
+}
+
+/**
+ * Given an IP address in dotted-quad notation, returns an unsigned integer.
+ * Like ip2long() except that it actually works and has a consistent error return value.
+ */
+function wfIP2Unsigned( $ip ) {
+       $n = ip2long( $ip );
+       if ( $n == -1 || $n === false ) { # Return value on error depends on PHP version
+               $n = false;
+       } elseif ( $n < 0 ) {
+               $n += pow( 2, 32 );
        }
+       return $n;
+}
 
-       /**
-        * Return a zero-padded hexadecimal representation of an IP address
-        */
-       function IP2Hex( $ip ) {
-               $n = ProxyTools::IP2Unsigned( $ip );
-               if ( $n !== false ) {
-                       $n = sprintf( '%08X', $n );
-               }
-               return $n;
+/**
+ * Return a zero-padded hexadecimal representation of an IP address
+ */
+function wfIP2Hex( $ip ) {
+       $n = wfIP2Unsigned( $ip );
+       if ( $n !== false ) {
+               $n = sprintf( '%08X', $n );
        }
+       return $n;
+}
 
-       /**
       * Determine if an IP address really is an IP address, and if it is public,
       * i.e. not RFC 1918 or similar
       */
-       function isIPPublic( $ip ) {
-               $n = ProxyTools::IP2Unsigned( $ip );
-               if ( !$n ) {
-                       return false;
-               }
+/**
+ * Determine if an IP address really is an IP address, and if it is public,
+ * i.e. not RFC 1918 or similar
+ */
+function wfIsIPPublic( $ip ) {
+       $n = wfIP2Unsigned( $ip );
+       if ( !$n ) {
+               return false;
+       }
        
-               // ip2long accepts incomplete addresses, as well as some addresses
-               // followed by garbage characters. Check that it's really valid.
-               if( $ip != long2ip( $n ) ) {
-                       return false;
-               }
+       // ip2long accepts incomplete addresses, as well as some addresses
+       // followed by garbage characters. Check that it's really valid.
+       if( $ip != long2ip( $n ) ) {
+               return false;
+       }
 
-               static $privateRanges = false;
-               if ( !$privateRanges ) {
-                       $privateRanges = array(
-                               array( '10.0.0.0',    '10.255.255.255' ),   # RFC 1918 (private)
-                               array( '172.16.0.0',  '172.31.255.255' ),   #     "
-                               array( '192.168.0.0', '192.168.255.255' ),  #     "
-                               array( '0.0.0.0',     '0.255.255.255' ),    # this network
-                               array( '127.0.0.0',   '127.255.255.255' ),  # loopback
-                       );
-               }
+       static $privateRanges = false;
+       if ( !$privateRanges ) {
+               $privateRanges = array(
+                       array( '10.0.0.0',    '10.255.255.255' ),   # RFC 1918 (private)
+                       array( '172.16.0.0',  '172.31.255.255' ),   #     "
+                       array( '192.168.0.0', '192.168.255.255' ),  #     "
+                       array( '0.0.0.0',     '0.255.255.255' ),    # this network
+                       array( '127.0.0.0',   '127.255.255.255' ),  # loopback
+               );
+       }
 
-               foreach ( $privateRanges as $r ) {
-                       $start = ProxyTools::IP2Unsigned( $r[0] );
-                       $end = ProxyTools::IP2Unsigned( $r[1] );
-                       if ( $n >= $start && $n <= $end ) {
-                               return false;
-                       }
+       foreach ( $privateRanges as $r ) {
+               $start = wfIP2Unsigned( $r[0] );
+               $end = wfIP2Unsigned( $r[1] );
+               if ( $n >= $start && $n <= $end ) {
+                       return false;
                }
-               return true;
        }
+       return true;
+}
 
-       /**
       * Forks processes to scan the originating IP for an open proxy server
       * MemCached can be used to skip IPs that have already been scanned
       */
-       function proxyCheck() {
-               global $wgBlockOpenProxies, $wgProxyPorts, $wgProxyScriptPath;
-               global $wgUseMemCached, $wgMemc, $wgDBname, $wgProxyMemcExpiry;
-               global $wgProxyKey;
+/**
+ * Forks processes to scan the originating IP for an open proxy server
+ * MemCached can be used to skip IPs that have already been scanned
+ */
+function wfProxyCheck() {
+       global $wgBlockOpenProxies, $wgProxyPorts, $wgProxyScriptPath;
+       global $wgUseMemCached, $wgMemc, $wgDBname, $wgProxyMemcExpiry;
+       global $wgProxyKey;
 
-               if ( !$wgBlockOpenProxies ) {
-                       return;
-               }
+       if ( !$wgBlockOpenProxies ) {
+               return;
+       }
 
-               $ip = ProxyTools::getIP();
+       $ip = wfGetIP();
 
-               # Get MemCached key
-               $skip = false;
-               if ( $wgUseMemCached ) {
-                       $mcKey = "$wgDBname:proxy:ip:$ip";
-                       $mcValue = $wgMemc->get( $mcKey );
-                       if ( $mcValue ) {
-                               $skip = true;
-                       }
+       # Get MemCached key
+       $skip = false;
+       if ( $wgUseMemCached ) {
+               $mcKey = "$wgDBname:proxy:ip:$ip";
+               $mcValue = $wgMemc->get( $mcKey );
+               if ( $mcValue ) {
+                       $skip = true;
                }
+       }
 
-               # Fork the processes
-               if ( !$skip ) {
-                       $title = Title::makeTitle( NS_SPECIAL, 'Blockme' );
-                       $iphash = md5( $ip . $wgProxyKey );
-                       $url = $title->getFullURL( 'ip='.$iphash );
-
-                       foreach ( $wgProxyPorts as $port ) {
-                               $params = implode( ' ', array(
-                                                       escapeshellarg( $wgProxyScriptPath ),
-                                                       escapeshellarg( $ip ),
-                                                       escapeshellarg( $port ),
-                                                       escapeshellarg( $url )
-                                                       ));
-                               exec( "php $params &>/dev/null &" );
-                       }
-                       # Set MemCached key
-                       if ( $wgUseMemCached ) {
-                               $wgMemc->set( $mcKey, 1, $wgProxyMemcExpiry );
-                       }
+       # Fork the processes
+       if ( !$skip ) {
+               $title = Title::makeTitle( NS_SPECIAL, 'Blockme' );
+               $iphash = md5( $ip . $wgProxyKey );
+               $url = $title->getFullURL( 'ip='.$iphash );
+
+               foreach ( $wgProxyPorts as $port ) {
+                       $params = implode( ' ', array(
+                                               escapeshellarg( $wgProxyScriptPath ),
+                                               escapeshellarg( $ip ),
+                                               escapeshellarg( $port ),
+                                               escapeshellarg( $url )
+                                               ));
+                       exec( "php $params &>/dev/null &" );
+               }
+               # Set MemCached key
+               if ( $wgUseMemCached ) {
+                       $wgMemc->set( $mcKey, 1, $wgProxyMemcExpiry );
                }
        }
+}
 
-       /**
-        * Convert a network specification in CIDR notation to an integer network and a number of bits
-        */
-       function parseCIDR( $range ) {
-               $parts = explode( '/', $range, 2 );
-               if ( count( $parts ) != 2 ) {
-                       return array( false, false );
-               }
-               $network = ProxyTools::IP2Unsigned( $parts[0] );
-               if ( $network !== false && is_numeric( $parts[1] ) && $parts[1] >= 0 && $parts[1] <= 32 ) {
-                       $bits = $parts[1];
-               } else {
-                       $network = false;
-                       $bits = false;
-               }
-               return array( $network, $bits );
+/**
+ * Convert a network specification in CIDR notation to an integer network and a number of bits
+ */
+function wfParseCIDR( $range ) {
+       $parts = explode( '/', $range, 2 );
+       if ( count( $parts ) != 2 ) {
+               return array( false, false );
+       }
+       $network = wfIP2Unsigned( $parts[0] );
+       if ( $network !== false && is_numeric( $parts[1] ) && $parts[1] >= 0 && $parts[1] <= 32 ) {
+               $bits = $parts[1];
+       } else {
+               $network = false;
+               $bits = false;
        }
+       return array( $network, $bits );
+}
 
-       /**
       * Check if an IP address is in the local proxy list
       */
-       function isLocallyBlockedProxy( $ip ) {
-               global $wgProxyList;
-               $fname = 'ProxyTools::isLocallyBlockedProxy';
+/**
+ * Check if an IP address is in the local proxy list
+ */
+function wfIsLocallyBlockedProxy( $ip ) {
+       global $wgProxyList;
+       $fname = 'wfIsLocallyBlockedProxy';
 
-               if ( !$wgProxyList ) {
-                       return false;
-               }
-               wfProfileIn( $fname );
+       if ( !$wgProxyList ) {
+               return false;
+       }
+       wfProfileIn( $fname );
 
-               if ( !is_array( $wgProxyList ) ) {
-                       # Load from the specified file
-                       $wgProxyList = array_map( 'trim', file( $wgProxyList ) );
-               }
+       if ( !is_array( $wgProxyList ) ) {
+               # Load from the specified file
+               $wgProxyList = array_map( 'trim', file( $wgProxyList ) );
+       }
 
-               if ( !is_array( $wgProxyList ) ) {
-                       $ret = false;
-               } elseif ( array_search( $ip, $wgProxyList ) !== false ) {
-                       $ret = true;
-               } elseif ( array_key_exists( $ip, $wgProxyList ) ) {
-                       # Old-style flipped proxy list
-                       $ret = true;
-               } else {
-                       $ret = false;
-               }
-               wfProfileOut( $fname );
-               return $ret;
+       if ( !is_array( $wgProxyList ) ) {
+               $ret = false;
+       } elseif ( array_search( $ip, $wgProxyList ) !== false ) {
+               $ret = true;
+       } elseif ( array_key_exists( $ip, $wgProxyList ) ) {
+               # Old-style flipped proxy list
+               $ret = true;
+       } else {
+               $ret = false;
        }
+       wfProfileOut( $fname );
+       return $ret;
 }
+
+
+
+
 ?>
index 515e458..7848c53 100644 (file)
@@ -4,6 +4,11 @@
  * @package MediaWiki
  */
 
+/**
+ *
+ */
+require_once 'Feed.php';
+
 /**
  * List of query page classes and their associated special pages, for periodic update purposes
  */
index 252ab32..5685385 100644 (file)
@@ -10,6 +10,9 @@
  * @package MediaWiki
  */
 
+/** */
+require_once( 'Revision.php' );
+
 /**
  * @todo document
  * @package MediaWiki
index d550513..cae6d76 100644 (file)
@@ -205,7 +205,7 @@ class RecentChange
                }
 
                if ( !$ip ) {
-                       $ip = ProxyTools::getIP();
+                       $ip = wfGetIP();
                        if ( !$ip ) {
                                $ip = '';
                        }
@@ -249,7 +249,7 @@ class RecentChange
          $ip='', $size = 0, $newId = 0 )
        {
                if ( !$ip ) {
-                       $ip = ProxyTools::getIP();
+                       $ip = wfGetIP();
                        if ( !$ip ) {
                                $ip = '';
                        }
@@ -294,7 +294,7 @@ class RecentChange
        /*static*/ function notifyMove( $timestamp, &$oldTitle, &$newTitle, &$user, $comment, $ip='', $overRedir = false )
        {
                if ( !$ip ) {
-                       $ip = ProxyTools::getIP();
+                       $ip = wfGetIP();
                        if ( !$ip ) {
                                $ip = '';
                        }
@@ -344,7 +344,7 @@ class RecentChange
           $type, $action, $target, $logComment, $params )
        {
                if ( !$ip ) {
-                       $ip = ProxyTools::getIP();
+                       $ip = wfGetIP();
                        if ( !$ip ) {
                                $ip = '';
                        }
index 9aaa93c..e9083a7 100644 (file)
@@ -4,6 +4,10 @@
  * @todo document
  */
 
+/** */
+require_once( 'Database.php' );
+require_once( 'Article.php' );
+
 /** @+ */
 define( 'MW_REV_DELETED_TEXT',       1 );
 define( 'MW_REV_DELETED_COMMENT',    2 );
@@ -510,6 +514,7 @@ class Revision {
                                wfProfileOut( $fname );
                                return false;
                        }
+                       require_once('ExternalStore.php');
                        $text=ExternalStore::fetchFromURL($url);
                }
 
@@ -599,6 +604,7 @@ class Revision {
                        } else {
                                $store = $wgDefaultExternalStore;
                        }
+                       require_once('ExternalStore.php');
                        // Store and get the URL
                        $data = ExternalStore::insert( $store, $data );
                        if ( !$data ) {
index 0175210..2ef7045 100644 (file)
@@ -195,8 +195,10 @@ class SearchEngine {
                        $class = $wgSearchType;
                } elseif( $wgDBtype == 'mysql' ) {
                        $class = 'SearchMySQL4';
+                       require_once( 'SearchMySQL4.php' );
                } else if ( $wgDBtype == 'PostgreSQL' ) {
                        $class = 'SearchTsearch2';
+                       require_once( 'SearchTsearch2.php' );
                } else {
                        $class = 'SearchEngineDummy';
                }
index 80bddbd..6683cbe 100644 (file)
@@ -24,6 +24,9 @@
  * @subpackage Search
  */
 
+/** */
+require_once( 'SearchEngine.php' );
+
 /** @package MediaWiki */
 class SearchMySQL extends SearchEngine {
        /**
index dcc1f68..59f1bbe 100644 (file)
@@ -23,6 +23,8 @@
  * @subpackage Search
  */
 
+require_once( 'SearchMySQL.php' );
+
 /**
  * @package MediaWiki
  * @subpackage Search
index 767979c..3c0f132 100644 (file)
@@ -23,6 +23,9 @@
  * @subpackage Search
  */
 
+/** */
+require_once( 'SearchEngine.php' );
+
 /**
  * @todo document
  * @package MediaWiki
index 37981a6..1f222b3 100644 (file)
@@ -37,6 +37,7 @@ class SearchUpdate {
                $fname = 'SearchUpdate::doUpdate';
                wfProfileIn( $fname );
 
+               require_once( 'SearchEngine.php' );
                $search = SearchEngine::create();
                $lc = $search->legalSearchChars() . '&#;';
 
index dedf6a4..4c4328d 100644 (file)
@@ -22,14 +22,13 @@ if ( !isset( $wgVersion ) ) {
        die( -1 );
 }
 
-require('AutoLoader.php');
-
 if( !isset( $wgProfiling ) )
        $wgProfiling = false;
 
 if ( function_exists( 'wfProfileIn' ) ) {
        /* nada, everything should be done already */
 } elseif ( $wgProfiling and (0 == rand() % $wgProfileSampleRate ) ) {
+       require_once( 'Profiling.php' );
        $wgProfiling = true;
        if ($wgProfilerType == "") {
                $wgProfiler = new Profiler();
@@ -49,8 +48,29 @@ wfProfileIn( $fname.'-includes' );
 require_once( 'GlobalFunctions.php' );
 require_once( 'Hooks.php' );
 require_once( 'Namespace.php' );
+require_once( 'User.php' );
+require_once( 'Skin.php' );
+require_once( 'OutputPage.php' );
+require_once( 'LinkCache.php' );
+require_once( 'LinkBatch.php' );
+require_once( 'Title.php' );
+require_once( 'Article.php' );
 require_once( 'MagicWord.php' );
-
+require_once( 'Block.php' );
+require_once( 'MessageCache.php' );
+require_once( 'Parser.php' );
+require_once( 'ParserCache.php' );
+require_once( 'WebRequest.php' );
+require_once( 'LoadBalancer.php' );
+require_once( 'HistoryBlob.php' );
+require_once( 'ProxyTools.php' );
+require_once( 'ObjectCache.php' );
+require_once( 'WikiError.php' );
+require_once( 'SpecialPage.php' );
+
+if ( $wgUseDynamicDates ) {
+       require_once( 'DateFormatter.php' );
+}
 
 wfProfileOut( $fname.'-includes' );
 wfProfileIn( $fname.'-misc1' );
@@ -88,9 +108,9 @@ $wgUseEnotif = $wgEnotifUserTalk || $wgEnotifWatchlist;
 wfProfileOut( $fname.'-misc1' );
 wfProfileIn( $fname.'-memcached' );
 
-$wgMemc =& ObjectCacheManager::getMainCache();
-$messageMemc =& ObjectCacheManager::getMessageCache();
-$parserMemc =& ObjectCacheManager::getParserCache();
+$wgMemc =& wfGetMainCache();
+$messageMemc =& wfGetMessageCacheStorage();
+$parserMemc =& wfGetParserCacheStorage();
 
 wfDebug( 'Main cache: ' . get_class( $wgMemc ) .
        "\nMessage cache: " . get_class( $messageMemc ) .
@@ -188,6 +208,7 @@ foreach ( $wgSkinExtensionFunctions as $func ) {
 }
 
 if( !is_object( $wgAuth ) ) {
+       require_once( 'AuthPlugin.php' );
        $wgAuth = new AuthPlugin();
 }
 
@@ -275,6 +296,7 @@ $wgMagicWords = array();
 $wgMwRedir =& MagicWord::get( MAG_REDIRECT );
 
 if ( $wgUseXMLparser ) {
+       require_once( 'ParserXML.php' );
        $wgParser = new ParserXML();
 } else {
        $wgParser = new Parser();
index dc0a998..5bf36ab 100644 (file)
@@ -8,11 +8,28 @@ if ( ! defined( 'MEDIAWIKI' ) )
  * @subpackage Skins
  */
 
+# See skin.txt
+require_once( 'Linker.php' );
+require_once( 'Image.php' );
+
 # Get a list of available skins
 # Build using the regular expression '^(.*).php$'
 # Array keys are all lower case, array value keep the case used by filename
 #
 
+$skinDir = dir( $wgStyleDirectory );
+
+# while code from www.php.net
+while (false !== ($file = $skinDir->read())) {
+       // Skip non-PHP files, hidden files, and '.dep' includes
+       if(preg_match('/^([^.]*)\.php$/',$file, $matches)) {
+               $aSkin = $matches[1];
+               $wgValidSkinNames[strtolower($aSkin)] = $aSkin;
+       }
+}
+$skinDir->close();
+unset($matches);
+
 /**
  * The main skin class that provide methods and properties for all other skins.
  * This base class is also the "Standard" skin.
@@ -38,35 +55,9 @@ class Skin extends Linker {
         */
        function getSkinNames() {
                global $wgValidSkinNames;
-               if (!is_array($wgValidSkinNames)) {
-                       Skin::initializeSkinNames();
-               }
                return $wgValidSkinNames;
        }
 
-       /** 
-        * Initializes set of available skins.
-        * @return array of strings - skin names
-        * @static
-        */
-       
-       function initializeSkinNames() {
-               global $wgStyleDirectory, $wgValidSkinNames;
-               $skinDir = dir( $wgStyleDirectory );
-
-               # while code from www.php.net
-               while (false !== ($file = $skinDir->read())) {
-                       // Skip non-PHP files, hidden files, and '.dep' includes
-                       if(preg_match('/^([^.]*)\.php$/',$file, $matches)) {
-                               $aSkin = $matches[1];
-                               $wgValidSkinNames[strtolower($aSkin)] = $aSkin;
-                       }
-               }
-               $skinDir->close();
-               unset($matches);
-               
-       }
-
        /**
         * Normalize a skin preference value to a form that can be loaded.
         * If a skin can't be found, it will fall back to the configured
@@ -754,7 +745,7 @@ END;
                $s = '';
                if ( $wgUser->isAnon() ) {
                        if( $wgShowIPinHeader && isset( $_COOKIE[ini_get('session.name')] ) ) {
-                               $n = ProxyTools::getIP();
+                               $n = wfGetIP();
 
                                $tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(),
                                  $wgLang->getNsText( NS_TALK ) );
@@ -905,7 +896,8 @@ END;
                }
 
                if (isset($wgMaxCredits) && $wgMaxCredits != 0) {
-                   $s .= ' ' . Credits::getCredits($wgArticle, $wgMaxCredits, $wgShowCreditsIfMax);
+                   require_once('Credits.php');
+                   $s .= ' ' . getCredits($wgArticle, $wgMaxCredits, $wgShowCreditsIfMax);
                } else {
                    $s .= $this->lastModified();
                }
@@ -1023,6 +1015,7 @@ END;
         */
        function specialPagesList() {
                global $wgUser, $wgContLang, $wgServer, $wgRedirectScript, $wgAvailableRights;
+               require_once('SpecialPage.php');
                $a = array();
                $pages = SpecialPage::getPages();
 
index c86b67e..f054153 100644 (file)
@@ -343,7 +343,8 @@ class SkinTemplate extends Skin {
                        $this->credits = false;
 
                        if (isset($wgMaxCredits) && $wgMaxCredits != 0) {
-                               $this->credits = Credits::getCredits($wgArticle, $wgMaxCredits, $wgShowCreditsIfMax);
+                               require_once("Credits.php");
+                               $this->credits = getCredits($wgArticle, $wgMaxCredits, $wgShowCreditsIfMax);
                        } else {
                                $tpl->set('lastmod', $this->lastModified());
                        }
index c3524e4..b452b14 100644 (file)
@@ -12,7 +12,7 @@ function wfSpecialBlockme()
 {
        global $wgBlockOpenProxies, $wgOut, $wgProxyKey;
 
-       $ip = ProxyTools::getIP();
+       $ip = wfGetIP();
 
        if ( !$wgBlockOpenProxies || $_REQUEST['ip'] != md5( $ip . $wgProxyKey ) ) {
                $wgOut->addWikiText( wfMsg( "disabled" ) );
index bd2829d..7c54654 100644 (file)
  * @subpackage SpecialPage
  */
 
-/**
- * @todo put all global specialpages stuff into class
- */
-global $wgSpecialPages, $wgDisableCounters, $wgDisableInternalSearch, $wgEmailAuthentication;
 
 /**
  * @access private
index 69a6813..bccbc6e 100644 (file)
@@ -444,7 +444,7 @@ class PreferencesForm {
         * @access private
         */
        function mainPrefsForm( $status , $message = '' ) {
-               global $wgUser, $wgOut, $wgLang, $wgContLang;
+               global $wgUser, $wgOut, $wgLang, $wgContLang, $wgValidSkinNames;
                global $wgAllowRealName, $wgImageLimits, $wgThumbLimits;
                global $wgDisableLangConversion;
                global $wgEnotifWatchlist, $wgEnotifUserTalk,$wgEnotifMinorEdits;
@@ -723,7 +723,7 @@ class PreferencesForm {
                $previewtext = wfMsg('skinpreview');
                # Only show members of $wgValidSkinNames rather than
                # $skinNames (skins is all skin names from Language.php)
-               foreach (Skin::getSkinNames() as $skinkey => $skinname ) {
+               foreach ($wgValidSkinNames as $skinkey => $skinname ) {
                        if ( in_array( $skinkey, $wgSkipSkins ) ) {
                                continue;
                        }
index 48470a7..74c6ebf 100644 (file)
@@ -5,6 +5,13 @@
  * @subpackage SpecialPage
  */
 
+/**
+ *
+ */
+require_once( 'Feed.php' );
+require_once( 'ChangesList.php' );
+require_once( 'Revision.php' );
+
 /**
  * Constructor
  */
index e61f485..84b732f 100644 (file)
@@ -9,6 +9,8 @@
  *
  */
 require_once 'Image.php';
+require_once 'MacBinary.php';
+require_once 'Licenses.php';
 /**
  * Entry point
  */
index 2d38388..03a4185 100644 (file)
@@ -210,7 +210,7 @@ class LoginForm {
                        return false;
                }
 
-               $ip = ProxyTools::getIP();
+               $ip = wfGetIP();
                if ( $wgEnableSorbs && !in_array( $ip, $wgProxyWhitelist ) &&
                  $wgUser->inSorbsBlacklist( $ip ) )
                {
@@ -416,7 +416,7 @@ class LoginForm {
 
                $u->saveSettings();
 
-               $ip = ProxyTools::getIP();
+               $ip = wfGetIP();
                if ( '' == $ip ) { $ip = '(Unknown)'; }
 
                $m = wfMsg( 'passwordremindertext', $ip, $u->getName(), $np, $wgServer . $wgScript );
index c941e2b..5f7e857 100644 (file)
@@ -190,7 +190,7 @@ class SpecialVersion {
         * @return string
         */
        function IPInfo() {
-               $ip =  str_replace( '--', ' - ', htmlspecialchars( ProxyTools::getIP() ) );
+               $ip =  str_replace( '--', ' - ', htmlspecialchars( wfGetIP() ) );
                return "<!-- visited from $ip -->\n" .
                        "<span style='display:none'>visited from $ip</span>";
        }
index 730c11b..1e87fd8 100644 (file)
@@ -5,7 +5,8 @@
  * @package MediaWiki
  */
 
-global $wgTitleInterwikiCache, $wgTitleCache;
+/** */
+require_once( 'normal/UtfNormal.php' );
 
 $wgTitleInterwikiCache = array();
 $wgTitleCache = array();
@@ -333,6 +334,7 @@ class Title {
         */
        /* static */ function indexTitle( $ns, $title ) {
                global $wgContLang;
+               require_once( 'SearchEngine.php' );
 
                $lc = SearchEngine::legalSearchChars() . '&#;';
                $t = $wgContLang->stripForSearch( $title );
@@ -1160,7 +1162,8 @@ class Title {
         * Check that the corresponding skin exists
         */
        function isValidCssJsSubpage() {
-               return( $this->isCssJsSubpage() && array_key_exists( $this->getSkinFromCssJsSubpage(), Skin::getSkinNames() ) );
+               global $wgValidSkinNames;
+               return( $this->isCssJsSubpage() && array_key_exists( $this->getSkinFromCssJsSubpage(), $wgValidSkinNames ) );
        }
        /**
         * Trim down a .css or .js subpage title to get the corresponding skin name
index d3c2b03..e6da731 100644 (file)
@@ -5,4 +5,13 @@
  * @package MediaWiki
  */
 
+/**
+ *
+ */
+
+require_once( 'SiteStatsUpdate.php' );
+require_once( 'LinksUpdate.php' );
+require_once( 'SearchUpdate.php' );
+require_once( 'SquidUpdate.php' );
+
 ?>
\ No newline at end of file
index a9ab118..15d469a 100644 (file)
@@ -5,6 +5,11 @@
  * @package MediaWiki
  */
 
+/**
+ *
+ */
+require_once( 'WatchedItem.php' );
+
 # Number of characters in user_token field
 define( 'USER_TOKEN_LENGTH', 32 );
 
@@ -428,7 +433,7 @@ class User {
                wfDebug( "$fname: checking...\n" );
 
                $this->mBlockedby = 0;
-               $ip = ProxyTools::getIP();
+               $ip = wfGetIP();
 
                # User/IP blocking
                $block = new Block();
@@ -449,7 +454,7 @@ class User {
                if ( !$this->isAllowed('proxyunbannable') && !in_array( $ip, $wgProxyWhitelist ) ) {
 
                        # Local list
-                       if ( ProxyTools::isLocallyBlockedProxy( $ip ) ) {
+                       if ( wfIsLocallyBlockedProxy( $ip ) ) {
                                $this->mBlockedby = wfMsg( 'proxyblocker' );
                                $this->mBlockreason = wfMsg( 'proxyblockreason' );
                        }
@@ -533,7 +538,7 @@ class User {
                $limits = $wgRateLimits[$action];
                $keys = array();
                $id = $this->getId();
-               $ip = ProxyTools::getIP();
+               $ip = wfGetIP();
 
                if( isset( $limits['anon'] ) && $id == 0 ) {
                        $keys["$wgDBname:limiter:$action:anon"] = $limits['anon'];
@@ -785,7 +790,7 @@ class User {
        function getName() {
                $this->loadFromDatabase();
                if ( $this->mName === false ) {
-                       $this->mName = ProxyTools::getIP();
+                       $this->mName = wfGetIP();
                }
                return $this->mName;
        }
@@ -1521,7 +1526,7 @@ class User {
                }
 
                # Check if this IP address is already blocked
-               $ipblock = Block::newFromDB( ProxyTools::getIP() );
+               $ipblock = Block::newFromDB( wfGetIP() );
                if ( $ipblock->isValid() ) {
                        # If the user is already blocked. Then check if the autoblock would
                        # excede the user block. If it would excede, then do nothing, else
@@ -1536,8 +1541,8 @@ class User {
                }
 
                # Make a new block object with the desired properties
-               wfDebug( "Autoblocking {$this->mName}@" . ProxyTools::getIP() . "\n" );
-               $ipblock->mAddress = ProxyTools::getIP();
+               wfDebug( "Autoblocking {$this->mName}@" . wfGetIP() . "\n" );
+               $ipblock->mAddress = wfGetIP();
                $ipblock->mUser = 0;
                $ipblock->mBy = $userblock->mBy;
                $ipblock->mReason = wfMsg( 'autoblocker', $this->getName(), $userblock->mReason );
@@ -1757,7 +1762,7 @@ class User {
                $url = $this->confirmationTokenUrl( $expiration );
                return $this->sendMail( wfMsg( 'confirmemail_subject' ),
                        wfMsg( 'confirmemail_body',
-                               ProxyTools::getIP(),
+                               wfGetIP(),
                                $this->getName(),
                                $url,
                                $wgContLang->timeanddate( $expiration, false ) ) );
index efae012..736e215 100644 (file)
@@ -117,6 +117,7 @@ class WebRequest {
                                        $data = $wgContLang->checkTitleEncoding( $data );
                                }
                        }
+                       require_once( 'normal/UtfNormal.php' );
                        $data = $this->normalizeUnicode( $data );
                        return $data;
                } else {
index a134552..187dc06 100644 (file)
@@ -176,8 +176,10 @@ class MediaWiki {
        
                switch( $title->getNamespace() ) {
                case NS_IMAGE:
+                       require_once( 'includes/ImagePage.php' );
                        return new ImagePage( $title );
                case NS_CATEGORY:
+                       require_once( 'includes/CategoryPage.php' );
                        return new CategoryPage( $title );
                default:
                        return new Article( $title );
@@ -282,6 +284,8 @@ class MediaWiki {
                        $n = intval( $wgJobRunRate );
                }
 
+               require_once( 'JobQueue.php' );
+
                while ( $n-- && false != ($job = Job::pop())) {
                        $output = $job->toString() . "\n";
                        if ( !$job->run() ) {
@@ -355,7 +359,8 @@ class MediaWiki {
                                }
                                break;
                        case 'credits':
-                               Credits::showCreditsPage( $article );
+                               require_once( 'includes/Credits.php' );
+                               showCreditsPage( $article );
                                break;
                        case 'submit':
                                if( !$this->getVal( 'CommandLineMode' ) && !$request->checkSessionCookie() ) {
@@ -370,9 +375,11 @@ class MediaWiki {
                                $oldid = $request->getVal( 'oldid' );
                                if( !$this->getVal( 'UseExternalEditor' ) || $action=='submit' || $internal ||
                                   $section || $oldid || ( !$user->getOption( 'externaleditor' ) && !$external ) ) {
+                                       require_once( 'includes/EditPage.php' );
                                        $editor = new EditPage( $article );
                                        $editor->submit();
                                } elseif( $this->getVal( 'UseExternalEditor' ) && ( $external || $user->getOption( 'externaleditor' ) ) ) {
+                                       require_once( 'includes/ExternalEdit.php' );
                                        $mode = $request->getVal( 'mode' );
                                        $extedit = new ExternalEdit( $article, $mode );
                                        $extedit->edit();
@@ -382,10 +389,12 @@ class MediaWiki {
                                if( $_SERVER['REQUEST_URI'] == $title->getInternalURL( 'action=history' ) ) {
                                        $output->setSquidMaxage( $this->getVal( 'SquidMaxage' ) );
                                }
+                               require_once( 'includes/PageHistory.php' );
                                $history = new PageHistory( $article );
                                $history->history();
                                break;
                        case 'raw':
+                               require_once( 'includes/RawPage.php' );
                                $raw = new RawPage( $article );
                                $raw->view();
                                break;