Give a warning when people use $wgArticle. Add's a class that can be used to give...
[lhc/web/wiklou.git] / includes / DeprecatedGlobal.php
1 <?php
2 /**
3 * Class to allow throwing wfDeprecated warnings
4 * when people use globals that we do not want them to.
5 * (For example like $wgArticle)
6 */
7
8 class DeprecatedGlobal extends StubObject {
9 // The m's are to stay consistent with parent class.
10 protected $mRealValue, $mVersion;
11
12 function __construct( $name, $realValue, $version = false ) {
13 parent::__construct( $name );
14 $this->mRealValue = $realValue;
15 $this->mVersion = $version;
16 }
17
18 function _newObject() {
19 wfDeprecated( '$' . $this->mGlobal, $this->mVersion, false, 6 );
20 return $this->mRealValue;
21 }
22 }