MediaWiki REL1_30
DerivativeResourceLoaderContext.php
Go to the documentation of this file.
1<?php
31 const INHERIT_VALUE = -1;
32
36 private $context;
37
41 protected $skin = self::INHERIT_VALUE;
42 protected $user = self::INHERIT_VALUE;
47
49 $this->context = $context;
50 }
51
52 public function getModules() {
53 if ( $this->modules === self::INHERIT_VALUE ) {
54 return $this->context->getModules();
55 }
56 return $this->modules;
57 }
58
62 public function setModules( array $modules ) {
63 $this->modules = $modules;
64 }
65
66 public function getLanguage() {
67 if ( $this->language === self::INHERIT_VALUE ) {
68 return $this->context->getLanguage();
69 }
70 return $this->language;
71 }
72
76 public function setLanguage( $language ) {
77 $this->language = $language;
78 // Invalidate direction since it is based on language
79 $this->direction = null;
80 $this->hash = null;
81 }
82
83 public function getDirection() {
84 if ( $this->direction === self::INHERIT_VALUE ) {
85 return $this->context->getDirection();
86 }
87 if ( $this->direction === null ) {
88 $this->direction = Language::factory( $this->getLanguage() )->getDir();
89 }
90 return $this->direction;
91 }
92
96 public function setDirection( $direction ) {
97 $this->direction = $direction;
98 $this->hash = null;
99 }
100
101 public function getSkin() {
102 if ( $this->skin === self::INHERIT_VALUE ) {
103 return $this->context->getSkin();
104 }
105 return $this->skin;
106 }
107
111 public function setSkin( $skin ) {
112 $this->skin = $skin;
113 $this->hash = null;
114 }
115
116 public function getUser() {
117 if ( $this->user === self::INHERIT_VALUE ) {
118 return $this->context->getUser();
119 }
120 return $this->user;
121 }
122
126 public function setUser( $user ) {
127 $this->user = $user;
128 $this->hash = null;
129 $this->userObj = null;
130 }
131
132 public function getDebug() {
133 if ( $this->debug === self::INHERIT_VALUE ) {
134 return $this->context->getDebug();
135 }
136 return $this->debug;
137 }
138
142 public function setDebug( $debug ) {
143 $this->debug = $debug;
144 $this->hash = null;
145 }
146
147 public function getOnly() {
148 if ( $this->only === self::INHERIT_VALUE ) {
149 return $this->context->getOnly();
150 }
151 return $this->only;
152 }
153
157 public function setOnly( $only ) {
158 $this->only = $only;
159 $this->hash = null;
160 }
161
162 public function getVersion() {
163 if ( $this->version === self::INHERIT_VALUE ) {
164 return $this->context->getVersion();
165 }
166 return $this->version;
167 }
168
172 public function setVersion( $version ) {
173 $this->version = $version;
174 $this->hash = null;
175 }
176
177 public function getRaw() {
178 if ( $this->raw === self::INHERIT_VALUE ) {
179 return $this->context->getRaw();
180 }
181 return $this->raw;
182 }
183
187 public function setRaw( $raw ) {
188 $this->raw = $raw;
189 }
190
191 public function getRequest() {
192 return $this->context->getRequest();
193 }
194
195 public function getResourceLoader() {
196 return $this->context->getResourceLoader();
197 }
198
199}
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two distribute and or modify the software for each author s protection and we want to make certain that everyone understands that there is no warranty for this free software If the software is modified by someone else and passed we want its recipients to know that what they have is not the so that any problems introduced by others will not reflect on the original authors reputations any free program is threatened constantly by software patents We wish to avoid the danger that redistributors of a free program will individually obtain patent in effect making the program proprietary To prevent we have made it clear that any patent must be licensed for everyone s free use or not licensed at all The precise terms and conditions for distribution and modification follow GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR DISTRIBUTION AND MODIFICATION This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License The refers to any such program or and a work based on the Program means either the Program or any derivative work under copyright a work containing the Program or a portion of either verbatim or with modifications and or translated into another language(Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying
Allows changing specific properties of a context object, without changing the main one.
__construct(ResourceLoaderContext $context)
Object passed around to modules which contains information about the state of a specific loader reque...
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a skin(according to that user 's preference)
Prior to version