Merge "resourceloader: Add Doxygen group and improve overall docs"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sun, 15 Sep 2019 19:58:46 +0000 (19:58 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sun, 15 Sep 2019 19:58:46 +0000 (19:58 +0000)
27 files changed:
includes/resourceloader/DerivativeResourceLoaderContext.php
includes/resourceloader/MessageBlobStore.php
includes/resourceloader/ResourceLoader.php
includes/resourceloader/ResourceLoaderCircularDependencyError.php
includes/resourceloader/ResourceLoaderClientHtml.php
includes/resourceloader/ResourceLoaderContext.php
includes/resourceloader/ResourceLoaderFileModule.php
includes/resourceloader/ResourceLoaderFilePath.php
includes/resourceloader/ResourceLoaderForeignApiModule.php
includes/resourceloader/ResourceLoaderImage.php
includes/resourceloader/ResourceLoaderImageModule.php
includes/resourceloader/ResourceLoaderLanguageDataModule.php
includes/resourceloader/ResourceLoaderLessVarFileModule.php
includes/resourceloader/ResourceLoaderModule.php
includes/resourceloader/ResourceLoaderOOUIFileModule.php
includes/resourceloader/ResourceLoaderOOUIIconPackModule.php
includes/resourceloader/ResourceLoaderOOUIModule.php
includes/resourceloader/ResourceLoaderSiteModule.php
includes/resourceloader/ResourceLoaderSiteStylesModule.php
includes/resourceloader/ResourceLoaderSkinModule.php
includes/resourceloader/ResourceLoaderStartUpModule.php
includes/resourceloader/ResourceLoaderUserDefaultsModule.php
includes/resourceloader/ResourceLoaderUserModule.php
includes/resourceloader/ResourceLoaderUserOptionsModule.php
includes/resourceloader/ResourceLoaderUserStylesModule.php
includes/resourceloader/ResourceLoaderUserTokensModule.php
includes/resourceloader/ResourceLoaderWikiModule.php

index d84a92a..0a1d5f7 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * Derivative context for ResourceLoader modules.
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  */
 
 /**
+ * A mutable version of ResourceLoaderContext.
+ *
  * Allows changing specific properties of a context object,
- * without changing the main one. Inspired by DerivativeContext.
+ * without changing the main one. Inspired by MediaWiki's DerivativeContext.
  *
+ * @ingroup ResourceLoader
  * @since 1.24
  */
 class DerivativeResourceLoaderContext extends ResourceLoaderContext {
index d0f6729..b4f0b7c 100644 (file)
@@ -27,10 +27,13 @@ use Psr\Log\NullLogger;
 use Wikimedia\Rdbms\Database;
 
 /**
- * This class generates message blobs for use by ResourceLoader modules.
+ * This class generates message blobs for use by ResourceLoader.
  *
- * A message blob is a JSON object containing the interface messages for a certain module in
- * a certain language.
+ * A message blob is a JSON object containing the interface messages for a
+ * certain module in a certain language.
+ *
+ * @ingroup ResourceLoader
+ * @since 1.17
  */
 class MessageBlobStore implements LoggerAwareInterface {
 
index 6121bbf..d959ff6 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * Base class for resource loading system.
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -30,13 +28,21 @@ use Wikimedia\Rdbms\DBConnectionError;
 use Wikimedia\WrappedString;
 
 /**
- * Dynamic JavaScript and CSS resource loading system.
+ * @defgroup ResourceLoader ResourceLoader
+ *
+ * For higher level documentation, see <https://www.mediawiki.org/wiki/ResourceLoader/Architecture>.
+ */
+
+/**
+ * ResourceLoader is a loading system for JavaScript and CSS resources.
+ *
+ * For higher level documentation, see <https://www.mediawiki.org/wiki/ResourceLoader/Architecture>.
  *
- * Most of the documentation is on the MediaWiki documentation wiki starting at:
- *    https://www.mediawiki.org/wiki/ResourceLoader
+ * @ingroup ResourceLoader
+ * @since 1.17
  */
 class ResourceLoader implements LoggerAwareInterface {
-       /** @var Config $config */
+       /** @var Config */
        protected $config;
        /** @var MessageBlobStore */
        protected $blobStore;
index 7cd53fe..5a62861 100644 (file)
@@ -1,6 +1,5 @@
 <?php
 /**
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -20,6 +19,7 @@
  */
 
 /**
+ * @ingroup ResourceLoader
  * @internal For use by ResourceLoaderStartUpModule only
  */
 class ResourceLoaderCircularDependencyError extends Exception {
index ea35de6..bf03e49 100644 (file)
@@ -24,6 +24,7 @@ use Wikimedia\WrappedStringList;
 /**
  * Load and configure a ResourceLoader client on an HTML page.
  *
+ * @ingroup ResourceLoader
  * @since 1.28
  */
 class ResourceLoaderClientHtml {
index 95b8ff0..3db0c01 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * Context for ResourceLoader modules.
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -26,8 +24,11 @@ use MediaWiki\Logger\LoggerFactory;
 use MediaWiki\MediaWikiServices;
 
 /**
- * Object passed around to modules which contains information about the state
- * of a specific loader request.
+ * Context object that contains information about the state of a specific
+ * ResourceLoader web request. Passed around to ResourceLoaderModule methods.
+ *
+ * @ingroup ResourceLoader
+ * @since 1.17
  */
 class ResourceLoaderContext implements MessageLocalizer {
        const DEFAULT_LANG = 'qqx';
index f2d0856..23a9a14 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * ResourceLoader module based on local JavaScript/CSS files.
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  */
 
 /**
- * ResourceLoader module based on local JavaScript/CSS files.
+ * Module based on local JavaScript/CSS files.
  *
  * The following public methods can query the database:
  *
  * - getDefinitionSummary / … / ResourceLoaderModule::getFileDependencies.
  * - getVersionHash / getDefinitionSummary / … / ResourceLoaderModule::getFileDependencies.
  * - getStyles / ResourceLoaderModule::saveFileDependencies.
+ *
+ * @ingroup ResourceLoader
+ * @since 1.17
  */
 class ResourceLoaderFileModule extends ResourceLoaderModule {
 
index dff9a39..c70081b 100644 (file)
@@ -1,8 +1,5 @@
 <?php
 /**
- * An object to represent a path to a JavaScript/CSS file, along with a remote
- * and local base path, for use with ResourceLoaderFileModule.
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -24,6 +21,9 @@
 /**
  * An object to represent a path to a JavaScript/CSS file, along with a remote
  * and local base path, for use with ResourceLoaderFileModule.
+ *
+ * @ingroup ResourceLoader
+ * @since 1.17
  */
 class ResourceLoaderFilePath {
 
index 4d215d6..152a1f7 100644 (file)
@@ -1,8 +1,5 @@
 <?php
 /**
- * ResourceLoader module for mediawiki.ForeignApi that has dynamically
- * generated dependencies, via a hook usable by extensions.
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  */
 
 /**
- * ResourceLoader module for mediawiki.ForeignApi and its generated data
+ * Module for mediawiki.ForeignApi that has dynamically
+ * generated dependencies, via a hook usable by extensions.
+ *
+ * @ingroup ResourceLoader
+ * @internal
  */
 class ResourceLoaderForeignApiModule extends ResourceLoaderFileModule {
        public function getDependencies( ResourceLoaderContext $context = null ) {
index 43ebfbf..2b0f5ed 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * Class encapsulating an image used in a ResourceLoaderImageModule.
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -25,6 +23,7 @@ use MediaWiki\Shell\Shell;
 /**
  * Class encapsulating an image used in a ResourceLoaderImageModule.
  *
+ * @ingroup ResourceLoader
  * @since 1.25
  */
 class ResourceLoaderImage {
index 902fa91..0585cfd 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * ResourceLoader module for generated and embedded images.
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -22,8 +20,9 @@
  */
 
 /**
- * ResourceLoader module for generated and embedded images.
+ * Module for generated and embedded images.
  *
+ * @ingroup ResourceLoader
  * @since 1.25
  */
 class ResourceLoaderImageModule extends ResourceLoaderModule {
index c0a0921..ffc9b3d 100644 (file)
  */
 
 /**
- * ResourceLoader module for populating language specific data, such as grammar forms.
+ * Module for populating language specific data, such as grammar forms.
+ *
+ * @ingroup ResourceLoader
+ * @internal
  */
 class ResourceLoaderLanguageDataModule extends ResourceLoaderFileModule {
 
index 0269ec3..49501ff 100644 (file)
@@ -1,7 +1,28 @@
 <?php
+/**
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ */
 
 /**
- * Subclass with context specific LESS variables
+ * Module augmented with context-specific LESS variables.
+ *
+ * @ingroup ResourceLoader
+ * @since 1.32
  */
 class ResourceLoaderLessVarFileModule extends ResourceLoaderFileModule {
        protected $lessVariables = [];
index ed2d09c..c9fd267 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * Abstraction for ResourceLoader modules.
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -32,6 +30,9 @@ use Wikimedia\ScopedCallback;
 
 /**
  * Abstraction for ResourceLoader modules, with name registration and maxage functionality.
+ *
+ * @ingroup ResourceLoader
+ * @since 1.17
  */
 abstract class ResourceLoaderModule implements LoggerAwareInterface {
        /** @var Config */
index 7d39a58..e1a2711 100644 (file)
  */
 
 /**
- * ResourceLoaderFileModule which magically loads the right skinScripts and skinStyles for every
+ * Module which magically loads the right skinScripts and skinStyles for every
  * skin, using the specified OOUI theme for each.
  *
- * @since 1.30
+ * @ingroup ResourceLoader
+ * @internal
  */
 class ResourceLoaderOOUIFileModule extends ResourceLoaderFileModule {
        use ResourceLoaderOOUIModule;
index c860362..11c59a0 100644 (file)
@@ -21,6 +21,7 @@
 /**
  * Allows loading arbitrary sets of OOUI icons.
  *
+ * @ingroup ResourceLoader
  * @since 1.34
  */
 class ResourceLoaderOOUIIconPackModule extends ResourceLoaderOOUIImageModule {
index fdcc213..007bbd1 100644 (file)
@@ -21,7 +21,8 @@
 /**
  * Convenience methods for dealing with OOUI themes and their relations to MW skins.
  *
- * @since 1.30
+ * @ingroup ResourceLoader
+ * @internal
  */
 trait ResourceLoaderOOUIModule {
        protected static $knownScriptsModules = [ 'core' ];
index 236112e..0ae8371 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * ResourceLoader module for site customizations.
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  */
 
 /**
- * Module for site customizations
+ * Module for site customizations.
+ *
+ * @ingroup ResourceLoader
+ * @internal
  */
 class ResourceLoaderSiteModule extends ResourceLoaderWikiModule {
 
index 79922bf..be4e31d 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * ResourceLoader module for site style customizations.
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  */
 
 /**
- * Module for site style customizations
+ * Module for site style customizations.
+ *
+ * @ingroup ResourceLoader
+ * @internal
  */
 class ResourceLoaderSiteStylesModule extends ResourceLoaderWikiModule {
 
index 0f33666..e7ab951 100644 (file)
  */
 
 /**
- * ResourceLoader module for skin stylesheets.
+ * Module for skin stylesheets.
+ *
+ * @ingroup ResourceLoader
+ * @internal
  */
 class ResourceLoaderSkinModule extends ResourceLoaderFileModule {
        /**
index 9f583a5..78775fb 100644 (file)
@@ -38,6 +38,9 @@ use MediaWiki\MediaWikiServices;
  * - safemode: Only register modules that have ORIGIN_CORE as their origin.
  *   This effectively disables ORIGIN_USER modules. (T185303)
  *   See also: OutputPage::disallowUserJs()
+ *
+ * @ingroup ResourceLoader
+ * @internal
  */
 class ResourceLoaderStartUpModule extends ResourceLoaderModule {
        protected $targets = [ 'desktop', 'mobile' ];
index 61cff82..9610cce 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * ResourceLoader module for default user preferences.
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -23,6 +21,9 @@
 
 /**
  * Module for default user preferences.
+ *
+ * @ingroup ResourceLoader
+ * @internal
  */
 class ResourceLoaderUserDefaultsModule extends ResourceLoaderModule {
 
index 026cea1..4794231 100644 (file)
  */
 
 /**
- * Module for user customizations scripts
+ * Module for user customizations scripts.
+ *
+ * @ingroup ResourceLoader
+ * @internal
  */
 class ResourceLoaderUserModule extends ResourceLoaderWikiModule {
 
index ecbb501..866d98b 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * ResourceLoader module for user preference customizations.
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  */
 
 /**
- * Module for user preference customizations
+ * Module for user preferences.
+ *
+ * @ingroup ResourceLoader
+ * @internal
  */
 class ResourceLoaderUserOptionsModule extends ResourceLoaderModule {
 
index 69e8a97..fe949aa 100644 (file)
  */
 
 /**
- * Module for user customizations styles
+ * Module for user customizations styles.
+ *
+ * @ingroup ResourceLoader
+ * @internal
  */
 class ResourceLoaderUserStylesModule extends ResourceLoaderWikiModule {
 
index 85c14cb..45edd6e 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * ResourceLoader module for user tokens.
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * http://www.gnu.org/copyleft/gpl.html
  *
  * @file
- * @author Krinkle
  */
 
 /**
- * Module for user tokens
+ * Module for user authorization tokens.
+ *
+ * @ingroup ResourceLoader
+ * @internal
  */
 class ResourceLoaderUserTokensModule extends ResourceLoaderModule {
 
index 7a2fc51..37501d4 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * Abstraction for ResourceLoader modules that pull from wiki pages.
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -48,6 +46,9 @@ use MediaWiki\MediaWikiServices;
  *   - getDB()
  *   - isKnownEmpty()
  *   - getTitleInfo()
+ *
+ * @ingroup ResourceLoader
+ * @since 1.17
  */
 class ResourceLoaderWikiModule extends ResourceLoaderModule {