55 protected $deprecatedPublicProperties = [];
69 $property, $version, $class =
null, $component =
null
71 $this->deprecatedPublicProperties[
$property] = [ $version, $class ?: get_class(), $component ];
74 public function __get( $name ) {
75 if ( isset( $this->deprecatedPublicProperties[$name] ) ) {
76 list( $version, $class, $component ) = $this->deprecatedPublicProperties[
$name];
77 $qualifiedName = $class .
'::$' .
$name;
82 $qualifiedName = get_class() .
'::$' .
$name;
85 trigger_error(
"Cannot access non-public property $qualifiedName", E_USER_ERROR );
88 trigger_error(
"Undefined property: $qualifiedName", E_USER_NOTICE );
94 if ( isset( $this->deprecatedPublicProperties[$name] ) ) {
95 list( $version, $class, $component ) = $this->deprecatedPublicProperties[
$name];
96 $qualifiedName = $class .
'::$' .
$name;
102 $qualifiedName = get_class() .
'::$' .
$name;
105 trigger_error(
"Cannot access non-public property $qualifiedName", E_USER_ERROR );
120 if ( property_exists( $this,
$property ) ) {
132 $obfuscatedProps = array_keys( (
array)$this );
133 $obfuscatedPropTail =
"\0$property";
134 foreach ( $obfuscatedProps as $obfuscatedProp ) {
136 if ( strpos( $obfuscatedProp, $obfuscatedPropTail, 1 ) !==
false ) {
137 $classname = substr( $obfuscatedProp, 1, -strlen( $obfuscatedPropTail ) );
138 if ( $classname ===
'*' ) {
140 $classname = __CLASS__;
deprecatePublicProperty( $property, $version, $class=null, $component=null)
Mark a property as deprecated.
trait DeprecationHelper
Use this trait in classes which have properties for which public access is deprecated.
deprecationHelperGetPropertyOwner( $property)
Like property_exists but also check for non-visible private properties and returns which class in the...
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
Allows to change the fields on the form that will be generated $name
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))