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