Merge "Make abstract Config class truly implementation-agnostic"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 27 May 2014 01:43:39 +0000 (01:43 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 27 May 2014 01:43:39 +0000 (01:43 +0000)
1  2 
includes/AutoLoader.php
includes/DefaultSettings.php
includes/context/RequestContext.php

diff --combined includes/AutoLoader.php
@@@ -89,7 -89,6 +89,7 @@@ $wgAutoloadLocalClasses = array
        'HTMLButtonField' => 'includes/htmlform/HTMLButtonField.php',
        'HTMLCheckField' => 'includes/htmlform/HTMLCheckField.php',
        'HTMLCheckMatrix' => 'includes/htmlform/HTMLCheckMatrix.php',
 +      'HTMLFormFieldCloner' => 'includes/htmlform/HTMLFormFieldCloner.php',
        'HTMLEditTools' => 'includes/htmlform/HTMLEditTools.php',
        'HTMLFloatField' => 'includes/htmlform/HTMLFloatField.php',
        'HTMLForm' => 'includes/htmlform/HTMLForm.php',
        'MagicWordArray' => 'includes/MagicWord.php',
        'MailAddress' => 'includes/UserMailer.php',
        'MediaWiki' => 'includes/Wiki.php',
 -      'MediaWiki_I18N' => 'includes/SkinTemplate.php',
 +      'MediaWikiI18N' => 'includes/SkinTemplate.php',
        'MediaWikiVersionFetcher' => 'includes/MediaWikiVersionFetcher.php',
        'Message' => 'includes/Message.php',
        'MessageBlobStore' => 'includes/MessageBlobStore.php',
  
        # includes/config
        'Config' => 'includes/config/Config.php',
-       'GlobalConfig' => 'includes/config/GlobalConfig.php',
+       'ConfigException' => 'includes/config/ConfigException.php',
+       'ConfigFactory' => 'includes/config/ConfigFactory.php',
+       'GlobalVarConfig' => 'includes/config/GlobalVarConfig.php',
  
        # includes/content
        'AbstractContent' => 'includes/content/AbstractContent.php',
        'SqliteInstaller' => 'includes/installer/SqliteInstaller.php',
        'SqliteUpdater' => 'includes/installer/SqliteUpdater.php',
        'WebInstaller' => 'includes/installer/WebInstaller.php',
 -      'WebInstaller_Complete' => 'includes/installer/WebInstallerPage.php',
 -      'WebInstaller_Copying' => 'includes/installer/WebInstallerPage.php',
 -      'WebInstaller_DBConnect' => 'includes/installer/WebInstallerPage.php',
 -      'WebInstaller_DBSettings' => 'includes/installer/WebInstallerPage.php',
 -      'WebInstaller_Document' => 'includes/installer/WebInstallerPage.php',
 -      'WebInstaller_ExistingWiki' => 'includes/installer/WebInstallerPage.php',
 -      'WebInstaller_Install' => 'includes/installer/WebInstallerPage.php',
 -      'WebInstaller_Language' => 'includes/installer/WebInstallerPage.php',
 -      'WebInstaller_Name' => 'includes/installer/WebInstallerPage.php',
 -      'WebInstaller_Options' => 'includes/installer/WebInstallerPage.php',
 -      'WebInstaller_Readme' => 'includes/installer/WebInstallerPage.php',
 -      'WebInstaller_ReleaseNotes' => 'includes/installer/WebInstallerPage.php',
 -      'WebInstaller_Restart' => 'includes/installer/WebInstallerPage.php',
 -      'WebInstaller_Upgrade' => 'includes/installer/WebInstallerPage.php',
 -      'WebInstaller_UpgradeDoc' => 'includes/installer/WebInstallerPage.php',
 -      'WebInstaller_Welcome' => 'includes/installer/WebInstallerPage.php',
 +      'WebInstallerComplete' => 'includes/installer/WebInstallerPage.php',
 +      'WebInstallerCopying' => 'includes/installer/WebInstallerPage.php',
 +      'WebInstallerDBConnect' => 'includes/installer/WebInstallerPage.php',
 +      'WebInstallerDBSettings' => 'includes/installer/WebInstallerPage.php',
 +      'WebInstallerDocument' => 'includes/installer/WebInstallerPage.php',
 +      'WebInstallerExistingWiki' => 'includes/installer/WebInstallerPage.php',
 +      'WebInstallerInstall' => 'includes/installer/WebInstallerPage.php',
 +      'WebInstallerLanguage' => 'includes/installer/WebInstallerPage.php',
 +      'WebInstallerName' => 'includes/installer/WebInstallerPage.php',
 +      'WebInstallerOptions' => 'includes/installer/WebInstallerPage.php',
 +      'WebInstallerReadme' => 'includes/installer/WebInstallerPage.php',
 +      'WebInstallerReleaseNotes' => 'includes/installer/WebInstallerPage.php',
 +      'WebInstallerRestart' => 'includes/installer/WebInstallerPage.php',
 +      'WebInstallerUpgrade' => 'includes/installer/WebInstallerPage.php',
 +      'WebInstallerUpgradeDoc' => 'includes/installer/WebInstallerPage.php',
 +      'WebInstallerWelcome' => 'includes/installer/WebInstallerPage.php',
        'WebInstallerOutput' => 'includes/installer/WebInstallerOutput.php',
        'WebInstallerPage' => 'includes/installer/WebInstallerPage.php',
  
        'IEContentAnalyzer' => 'includes/libs/IEContentAnalyzer.php',
        'IEUrlExtension' => 'includes/libs/IEUrlExtension.php',
        'MappedIterator' => 'includes/libs/MappedIterator.php',
 +      'IPSet' => 'includes/libs/IPSet.php',
        'JavaScriptMinifier' => 'includes/libs/JavaScriptMinifier.php',
        'JSCompilerContext' => 'includes/libs/jsminplus.php',
        'JSMinPlus' => 'includes/libs/jsminplus.php',
        'RunningStat' => 'includes/libs/RunningStat.php',
        'ScopedCallback' => 'includes/libs/ScopedCallback.php',
        'ScopedPHPTimeout' => 'includes/libs/ScopedPHPTimeout.php',
 +      'SwiftVirtualRESTService' => 'includes/libs/virtualrest/SwiftVirtualRESTService.php',
 +      'VirtualRESTService' => 'includes/libs/virtualrest/VirtualRESTService.php',
 +      'VirtualRESTServiceClient' => 'includes/libs/virtualrest/VirtualRESTServiceClient.php',
        'XmlTypeCheck' => 'includes/libs/XmlTypeCheck.php',
  
        # includes/libs/lessphp
        'ResourceLoaderUserTokensModule' => 'includes/resourceloader/ResourceLoaderUserTokensModule.php',
        'ResourceLoaderLanguageDataModule' =>
                'includes/resourceloader/ResourceLoaderLanguageDataModule.php',
 +      'ResourceLoaderLanguageNamesModule' =>
 +              'includes/resourceloader/ResourceLoaderLanguageNamesModule.php',
        'ResourceLoaderWikiModule' => 'includes/resourceloader/ResourceLoaderWikiModule.php',
  
        # includes/revisiondelete
 -      'RevDel_ArchivedFileItem' => 'includes/revisiondelete/RevisionDelete.php',
 -      'RevDel_ArchivedFileList' => 'includes/revisiondelete/RevisionDelete.php',
 -      'RevDel_ArchivedRevisionItem' => 'includes/revisiondelete/RevisionDelete.php',
 -      'RevDel_ArchiveItem' => 'includes/revisiondelete/RevisionDelete.php',
 -      'RevDel_ArchiveList' => 'includes/revisiondelete/RevisionDelete.php',
 -      'RevDel_FileItem' => 'includes/revisiondelete/RevisionDelete.php',
 -      'RevDel_FileList' => 'includes/revisiondelete/RevisionDelete.php',
 -      'RevDel_Item' => 'includes/revisiondelete/RevisionDeleteAbstracts.php',
 -      'RevDel_List' => 'includes/revisiondelete/RevisionDeleteAbstracts.php',
 -      'RevDel_LogItem' => 'includes/revisiondelete/RevisionDelete.php',
 -      'RevDel_LogList' => 'includes/revisiondelete/RevisionDelete.php',
 -      'RevDel_RevisionItem' => 'includes/revisiondelete/RevisionDelete.php',
 -      'RevDel_RevisionList' => 'includes/revisiondelete/RevisionDelete.php',
 +      'RevDelArchivedFileItem' => 'includes/revisiondelete/RevisionDelete.php',
 +      'RevDelArchivedFileList' => 'includes/revisiondelete/RevisionDelete.php',
 +      'RevDelArchivedRevisionItem' => 'includes/revisiondelete/RevisionDelete.php',
 +      'RevDelArchiveItem' => 'includes/revisiondelete/RevisionDelete.php',
 +      'RevDelArchiveList' => 'includes/revisiondelete/RevisionDelete.php',
 +      'RevDelFileItem' => 'includes/revisiondelete/RevisionDelete.php',
 +      'RevDelFileList' => 'includes/revisiondelete/RevisionDelete.php',
 +      'RevDelItem' => 'includes/revisiondelete/RevisionDeleteAbstracts.php',
 +      'RevDelList' => 'includes/revisiondelete/RevisionDeleteAbstracts.php',
 +      'RevDelLogItem' => 'includes/revisiondelete/RevisionDelete.php',
 +      'RevDelLogList' => 'includes/revisiondelete/RevisionDelete.php',
 +      'RevDelRevisionItem' => 'includes/revisiondelete/RevisionDelete.php',
 +      'RevDelRevisionList' => 'includes/revisiondelete/RevisionDelete.php',
        'RevisionDeleter' => 'includes/revisiondelete/RevisionDeleter.php',
        'RevisionDeleteUser' => 'includes/revisiondelete/RevisionDeleteUser.php',
  
        'HTMLBlockedUsersItemSelect' => 'includes/specials/SpecialBlockList.php',
        'ImageListPager' => 'includes/specials/SpecialListfiles.php',
        'ImportReporter' => 'includes/specials/SpecialImport.php',
 -      'IPBlockForm' => 'includes/specials/SpecialBlock.php',
        'LinkSearchPage' => 'includes/specials/SpecialLinkSearch.php',
        'ListredirectsPage' => 'includes/specials/SpecialListredirects.php',
        'ListDuplicatedFilesPage' => 'includes/specials/SpecialListDuplicatedFiles.php',
        'WantedFilesPage' => 'includes/specials/SpecialWantedfiles.php',
        'WantedPagesPage' => 'includes/specials/SpecialWantedpages.php',
        'WantedTemplatesPage' => 'includes/specials/SpecialWantedtemplates.php',
 -      'WatchlistEditor' => 'includes/specials/SpecialEditWatchlist.php',
        'WithoutInterwikiPage' => 'includes/specials/SpecialWithoutinterwiki.php',
  
        # includes/templates
        'CdbWriter' => 'includes/utils/Cdb.php',
        'CdbWriterDBA' => 'includes/utils/CdbDBA.php',
        'CdbWriterPHP' => 'includes/utils/CdbPHP.php',
 -      'ConfEditor' => 'includes/utils/ConfEditor.php',
 -      'ConfEditorParseError' => 'includes/utils/ConfEditor.php',
 -      'ConfEditorToken' => 'includes/utils/ConfEditor.php',
        'DoubleReplacer' => 'includes/utils/StringUtils.php',
        'ExplodeIterator' => 'includes/utils/StringUtils.php',
        'HashtableReplacer' => 'includes/utils/StringUtils.php',
        'CsvStatsOutput' => 'maintenance/language/StatOutputs.php',
        'ExtensionLanguages' => 'maintenance/language/languages.inc',
        'Languages' => 'maintenance/language/languages.inc',
 -      'MessageWriter' => 'maintenance/language/writeMessagesArray.inc',
        'StatsOutput' => 'maintenance/language/StatOutputs.php',
        'TextStatsOutput' => 'maintenance/language/StatOutputs.php',
        'WikiStatsOutput' => 'maintenance/language/StatOutputs.php',
@@@ -60,11 -60,14 +60,14 @@@ if ( !defined( 'MEDIAWIKI' ) ) 
  $wgConf = new SiteConfiguration;
  
  /**
-  * Class name to use for accessing Config.
-  * Currently only 'GlobalConfig' is available
+  * Registry of factory functions to create config objects:
+  * The 'main' key must be set, and the value should be a valid
+  * callable.
   * @since 1.23
   */
- $wgConfigClass = 'GlobalConfig';
+ $wgConfigRegistry = array(
+       'main' => 'GlobalVarConfig::newInstance'
+ );
  
  /**
   * MediaWiki version number
@@@ -104,13 -107,6 +107,13 @@@ $wgServer = WebRequest::detectServer()
   */
  $wgCanonicalServer = false;
  
 +/**
 + * Server name. This is automatically computed by parsing the bare
 + * hostname out of $wgCanonicalServer. It should not be customized.
 + * @since 1.24
 + */
 +$wgServerName = false;
 +
  /************************************************************************//**
   * @name   Script path settings
   * @{
@@@ -407,6 -403,8 +410,6 @@@ $wgImgAuthUrlPathMap = array()
   *                          url        : base URL to the root of the zone
   *                          urlsByExt  : map of file extension types to base URLs
   *                                       (useful for using a different cache for videos)
 - *                          handlerUrl : base script-handled URL to the root of the zone
 - *                                       (see FileRepo::getZoneHandlerUrl() function)
   *                      Zones default to using "<repo name>-<zone name>" as the container name
   *                      and default to using the container root as the zone's root directory.
   *                      Nesting of zone locations within other zones should be avoided.
@@@ -1311,22 -1309,21 +1314,22 @@@ $wgDjvuOutputExtension = 'jpg'
   * @{
   */
  
 -$serverName = substr( $wgServer, strrpos( $wgServer, '/' ) + 1 );
  
  /**
   * Site admin email address.
 + *
 + * Defaults to "wikiadmin@{$wgServerName}".
   */
 -$wgEmergencyContact = 'wikiadmin@' . $serverName;
 +$wgEmergencyContact = false;
  
  /**
   * Password reminder email address.
   *
   * The address we should use as sender when a user is requesting his password.
 + *
 + * Defaults to "apache@{$wgServerName}".
   */
 -$wgPasswordSender = 'apache@' . $serverName;
 -
 -unset( $serverName ); # Don't leak local variables to global scope
 +$wgPasswordSender = false;
  
  /**
   * Password reminder name
@@@ -2893,6 -2890,11 +2896,6 @@@ $wgShowIPinHeader = true
   */
  $wgSiteNotice = '';
  
 -/**
 - * A subtitle to add to the tagline, for skins that have it/
 - */
 -$wgExtraSubtitle = '';
 -
  /**
   * If this is set, a "donate" link will appear in the sidebar. Set it to a URL.
   */
@@@ -3602,17 -3604,14 +3605,17 @@@ $wgNamespacesWithSubpages = array
  );
  
  /**
 -  * Array holding default tracking category names.
 -  *
 -  * Array contains the system messages for each tracking category.
 -  * Tracking categories allow pages with certain characteristics to be tracked.
 -  * It works by adding any such page to a category automatically.
 -  *
 -  * @since 1.23
 -  */
 + * Array holding default tracking category names.
 + *
 + * Array contains the system messages for each tracking category.
 + * Tracking categories allow pages with certain characteristics to be tracked.
 + * It works by adding any such page to a category automatically.
 + *
 + * A message with the suffix '-desc' should be added as a description message
 + * to have extra information on Special:TrackingCategories.
 + *
 + * @since 1.23
 + */
  $wgTrackingCategories = array(
        'index-category',
        'noindex-category',
        'post-expand-template-inclusion-category',
        'hidden-category-category',
        'broken-file-category',
 +      'node-count-exceeded-category',
 +      'expansion-depth-exceeded-category',
  );
  
  /**
@@@ -3722,14 -3719,36 +3725,14 @@@ $wgMaxTemplateDepth = 40
  $wgMaxPPExpandDepth = 40;
  
  /**
 - * The external URL protocols
 + * URL schemes that should be recognized as valid by wfParseUrl().
 + * @see wfParseUrl
   */
  $wgUrlProtocols = array(
 -      'http://',
 -      'https://',
 -      'ftp://',
 -      'ftps://', // If we allow ftp:// we should allow the secure version.
 -      'ssh://',
 -      'sftp://', // SFTP > FTP
 -      'irc://',
 -      'ircs://', // @bug 28503
 -      'xmpp:', // Another open communication protocol
 -      'sip:',
 -      'sips:',
 -      'gopher://',
 -      'telnet://', // Well if we're going to support the above.. -ævar
 -      'nntp://', // @bug 3808 RFC 1738
 -      'worldwind://',
 -      'mailto:',
 -      'tel:', // If we can make emails linkable, why not phone numbers?
 -      'sms:', // Likewise this is standardized too
 -      'news:',
 -      'svn://',
 -      'git://',
 -      'mms://',
 -      'bitcoin:', // Even registerProtocolHandler whitelists this along with mailto:
 -      'magnet:', // No reason to reject torrents over magnet: when they're allowed over http://
 -      'urn:', // Allow URNs to be used in Microdata/RDFa <link ... href="urn:...">s
 -      'geo:', // urls define geo locations, they're useful in Microdata/RDFa and for coordinates
 -      '//', // for protocol-relative URLs
 +      'bitcoin:', 'ftp://', 'ftps://', 'geo:', 'git://', 'gopher://', 'http://',
 +      'https://', 'irc://', 'ircs://', 'magnet:', 'mailto:', 'mms://', 'news:',
 +      'nntp://', 'redis://', 'sftp://', 'sip:', 'sips:', 'sms:', 'ssh://',
 +      'svn://', 'tel:', 'telnet://', 'urn:', 'worldwind://', 'xmpp:', '//'
  );
  
  /**
@@@ -4260,7 -4279,6 +4263,7 @@@ $wgGroupPermissions['*']['editmyoptions
  $wgGroupPermissions['user']['move'] = true;
  $wgGroupPermissions['user']['move-subpages'] = true;
  $wgGroupPermissions['user']['move-rootuserpages'] = true; // can move root userpages
 +$wgGroupPermissions['user']['move-categorypages'] = true;
  $wgGroupPermissions['user']['movefile'] = true;
  $wgGroupPermissions['user']['read'] = true;
  $wgGroupPermissions['user']['edit'] = true;
@@@ -4308,7 -4326,6 +4311,7 @@@ $wgGroupPermissions['sysop']['importupl
  $wgGroupPermissions['sysop']['move'] = true;
  $wgGroupPermissions['sysop']['move-subpages'] = true;
  $wgGroupPermissions['sysop']['move-rootuserpages'] = true;
 +$wgGroupPermissions['sysop']['move-categorypages'] = true;
  $wgGroupPermissions['sysop']['patrol'] = true;
  $wgGroupPermissions['sysop']['autopatrol'] = true;
  $wgGroupPermissions['sysop']['protect'] = true;
@@@ -4828,7 -4845,7 +4831,7 @@@ $wgProxyKey = false
   */
  
  /**
 - * Default cookie expiration time. Setting to 0 makes all cookies session-only.
 + * Default cookie lifetime, in seconds. Setting to 0 makes all cookies session-only.
   */
  $wgCookieExpiration = 180 * 86400;
  
@@@ -6186,7 -6203,6 +6189,7 @@@ $wgJobTypesExcludedFromDefaultQueue = a
   * may have a variable number of work items, as is the case with batch jobs.
   * This is used by runJobs.php and not jobs run via $wgJobRunRate.
   * These settings should be global to all wikis.
 + * @var float[]
   */
  $wgJobBackoffThrottling = array();
  
@@@ -7074,14 -7090,6 +7077,14 @@@ $wgCompiledFiles = array()
   */
  $wgPagePropsHaveSortkey = true;
  
 +/**
 + * Port where you have HTTPS running
 + * Supports HTTPS on non-standard ports
 + * @see bug 65184
 + * @since 1.24
 + */
 +$wgHttpsPort = 443;
 +
  /**
   * For really cool vim folding this needs to be at the end:
   * vim: foldmarker=@{,@} foldmethod=marker
@@@ -84,7 -84,9 +84,9 @@@ class RequestContext implements IContex
         */
        public function getConfig() {
                if ( $this->config === null ) {
-                       $this->config = Config::factory();
+                       // @todo In the future, we could move this to WebStart.php so
+                       // the Config object is ready for when initialization happens
+                       $this->config = ConfigFactory::getDefaultInstance()->makeConfig( 'main' );
                }
  
                return $this->config;
        /**
         * Get the Title object
         *
 -       * @return Title
 +       * @return Title|null
         */
        public function getTitle() {
                if ( $this->title === null ) {