Make WordPress Core

Changeset 31145


Ignore:
Timestamp:
01/11/2015 10:03:59 PM (12 years ago)
Author:
wonderboymusic
Message:

In WP_Filesystem_Base, make the only private member, $cache, public and remove magic methods. $cache was always public until [28487], has been essentially public via a magic method since.

See #30891.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-filesystem-base.php

    r30722 r31145  
    2525         * Cached list of local filepaths to mapped remote filepaths.
    2626         *
    27          * @access private
    2827         * @since 2.7.0
    2928         * @var array
    3029         */
    31         private $cache = array();
     30        public $cache = array();
    3231
    3332        /**
    … …  
    3938         */
    4039        public $method = '';
    41 
    42         /**
    43          * Make private properties readable for backwards compatibility.
    44          *
    45          * @since 4.0.0
    46          * @access public
    47          *
    48          * @param string $name Property to get.
    49          * @return mixed Property.
    50          */
    51         public function __get( $name ) {
    52                 return $this->$name;
    53         }
    54 
    55         /**
    56          * Make private properties settable for backwards compatibility.
    57          *
    58          * @since 4.0.0
    59          * @access public
    60          *
    61          * @param string $name  Property to set.
    62          * @param mixed  $value Property value.
    63          * @return mixed Newly-set property.
    64          */
    65         public function __set( $name, $value ) {
    66                 return $this->$name = $value;
    67         }
    68 
    69         /**
    70          * Make private properties checkable for backwards compatibility.
    71          *
    72          * @since 4.0.0
    73          * @access public
    74          *
    75          * @param string $name Property to check if set.
    76          * @return bool Whether the property is set.
    77          */
    78         public function __isset( $name ) {
    79                 return isset( $this->$name );
    80         }
    81 
    82         /**
    83          * Make private properties un-settable for backwards compatibility.
    84          *
    85          * @since 4.0.0
    86          * @access public
    87          *
    88          * @param string $name Property to unset.
    89          */
    90         public function __unset( $name ) {
    91                 unset( $this->$name );
    92         }
    9340
    9441        /**
    … …  
    281228         * Expects Windows sanitized path.
    282229         *
    283          * @access private
    284230         * @since 2.7.0
    285231         *
    … …  
    440386         * Determine if the string provided contains binary characters.
    441387         *
    442          * @access private
    443388         * @since 2.7.0
    444389         *
Note: See TracChangeset for help on using the changeset viewer.