X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fresourceloader%2FResourceLoaderModule.php;h=c9fd267d12ddc4cab9eb445e87ffe8298724c5ad;hp=c376fa7362db99c9877ec857af70e160dfe774f2;hb=fa0f6f34972c0e0f4aac24a03b3efdfc45f256f6;hpb=9e4326370946eace9a20cd3d89f57a027f64257a diff --git a/includes/resourceloader/ResourceLoaderModule.php b/includes/resourceloader/ResourceLoaderModule.php index c376fa7362..c9fd267d12 100644 --- a/includes/resourceloader/ResourceLoaderModule.php +++ b/includes/resourceloader/ResourceLoaderModule.php @@ -1,7 +1,5 @@ or ) - const LOAD_STYLES = 'styles'; - // Module may have other resources (loaded via mw.loader from a script) - const LOAD_GENERAL = 'general'; - - # sitewide core module like a skin file or jQuery component - const ORIGIN_CORE_SITEWIDE = 1; - - # per-user module generated by the software - const ORIGIN_CORE_INDIVIDUAL = 2; - - # sitewide module generated from user-editable files, like MediaWiki:Common.js, or - # modules accessible to multiple users, such as those generated by the Gadgets extension. - const ORIGIN_USER_SITEWIDE = 3; - - # per-user module generated from user-editable files, like User:Me/vector.js - const ORIGIN_USER_INDIVIDUAL = 4; - - # an access constant; make sure this is kept as the largest number in this group - const ORIGIN_ALL = 10; + /** @var Config */ + protected $config; + /** @var LoggerInterface */ + protected $logger; - # script and style modules form a hierarchy of trustworthiness, with core modules like - # skins and jQuery as most trustworthy, and user scripts as least trustworthy. We can - # limit the types of scripts and styles we allow to load on, say, sensitive special - # pages like Special:UserLogin and Special:Preferences + /** + * Script and style modules form a hierarchy of trustworthiness, with core modules + * like skins and jQuery as most trustworthy, and user scripts as least trustworthy. We can + * limit the types of scripts and styles we allow to load on, say, sensitive special + * pages like Special:UserLogin and Special:Preferences + * @var int + */ protected $origin = self::ORIGIN_CORE_SITEWIDE; + /** @var string|null Module name */ protected $name = null; + /** @var string[] What client platforms the module targets (e.g. desktop, mobile) */ protected $targets = [ 'desktop' ]; - // In-object cache for file dependencies + /** @var array Map of (variant => indirect file dependencies) */ protected $fileDeps = []; - // In-object cache for message blob (keyed by language) + /** @var array Map of (language => in-object cache for message blob) */ protected $msgBlobs = []; - // In-object cache for version hash + /** @var array Map of (context hash => cached module version hash) */ protected $versionHash = []; - // In-object cache for module content + /** @var array Map of (context hash => cached module content) */ protected $contents = []; - /** - * @var Config - */ - protected $config; - - /** - * @var array|bool - */ + /** @var string|bool Deprecation string or true if deprecated; false otherwise */ protected $deprecated = false; + /** @var string Scripts only */ + const TYPE_SCRIPTS = 'scripts'; + /** @var string Styles only */ + const TYPE_STYLES = 'styles'; + /** @var string Scripts and styles */ + const TYPE_COMBINED = 'combined'; + + /** @var string Module only has styles (loaded via