MediaWiki  REL1_23
DeprecatedGlobal.php
Go to the documentation of this file.
00001 <?php
00028 class DeprecatedGlobal extends StubObject {
00029     // The m's are to stay consistent with parent class.
00030     protected $mRealValue, $mVersion;
00031 
00032     function __construct( $name, $realValue, $version = false ) {
00033         parent::__construct( $name );
00034         $this->mRealValue = $realValue;
00035         $this->mVersion = $version;
00036     }
00037 
00038     function _newObject() {
00039         /* Put the caller offset for wfDeprecated as 6, as
00040          * that gives the function that uses this object, since:
00041          * 1 = this function ( _newObject )
00042          * 2 = StubObject::_unstub
00043          * 3 = StubObject::_call
00044          * 4 = StubObject::__call
00045          * 5 = DeprecatedGlobal::<method of global called>
00046          * 6 = Actual function using the global.
00047          * Of course its theoretically possible to have other call
00048          * sequences for this method, but that seems to be
00049          * rather unlikely.
00050          */
00051         wfDeprecated( '$' . $this->mGlobal, $this->mVersion, false, 6 );
00052         return $this->mRealValue;
00053     }
00054 }