WordPress.org

Make WordPress Core

Changeset 28496


Ignore:
Timestamp:
05/19/2014 01:28:10 AM (6 years ago)
Author:
wonderboymusic
Message:

Add access modifier (public) to methods and members of WP_Upgrader and its subclasses.

See #27881, #22234.

File:
1 edited

Legend:

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

    r28479 r28496  
    2222 */
    2323class WP_Upgrader {
    24     var $strings = array();
    25     var $skin = null;
    26     var $result = array();
    27 
    28     function __construct($skin = null) {
     24    public $strings = array();
     25    public $skin = null;
     26    public $result = array();
     27
     28    public function __construct($skin = null) {
    2929        if ( null == $skin )
    3030            $this->skin = new WP_Upgrader_Skin();
     
    3333    }
    3434
    35     function init() {
     35    public function init() {
    3636        $this->skin->set_upgrader($this);
    3737        $this->generic_strings();
    3838    }
    3939
    40     function generic_strings() {
     40    public function generic_strings() {
    4141        $this->strings['bad_request'] = __('Invalid Data provided.');
    4242        $this->strings['fs_unavailable'] = __('Could not access filesystem.');
     
    6060    }
    6161
    62     function fs_connect( $directories = array() ) {
     62    public function fs_connect( $directories = array() ) {
    6363        global $wp_filesystem;
    6464
     
    107107    } //end fs_connect();
    108108
    109     function download_package($package) {
     109    public function download_package($package) {
    110110
    111111        /**
     
    139139    }
    140140
    141     function unpack_package($package, $delete_package = true) {
     141    public function unpack_package($package, $delete_package = true) {
    142142        global $wp_filesystem;
    143143
     
    178178    }
    179179
    180     function install_package( $args = array() ) {
     180    public function install_package( $args = array() ) {
    181181        global $wp_filesystem, $wp_theme_directories;
    182182
     
    348348    }
    349349
    350     function run( $options ) {
     350    public function run( $options ) {
    351351
    352352        $defaults = array(
     
    442442    }
    443443
    444     function maintenance_mode($enable = false) {
     444    public function maintenance_mode($enable = false) {
    445445        global $wp_filesystem;
    446446        $file = $wp_filesystem->abspath() . '.maintenance';
     
    468468class Plugin_Upgrader extends WP_Upgrader {
    469469
    470     var $result;
    471     var $bulk = false;
    472 
    473     function upgrade_strings() {
     470    public $result;
     471    public $bulk = false;
     472
     473    public function upgrade_strings() {
    474474        $this->strings['up_to_date'] = __('The plugin is at the latest version.');
    475475        $this->strings['no_package'] = __('Update package not available.');
     
    482482    }
    483483
    484     function install_strings() {
     484    public function install_strings() {
    485485        $this->strings['no_package'] = __('Install package not available.');
    486486        $this->strings['downloading_package'] = __('Downloading install package from <span class="code">%s</span>&#8230;');
     
    492492    }
    493493
    494     function install( $package, $args = array() ) {
     494    public function install( $package, $args = array() ) {
    495495
    496496        $defaults = array(
     
    526526    }
    527527
    528     function upgrade( $plugin, $args = array() ) {
     528    public function upgrade( $plugin, $args = array() ) {
    529529
    530530        $defaults = array(
     
    577577    }
    578578
    579     function bulk_upgrade( $plugins, $args = array() ) {
     579    public function bulk_upgrade( $plugins, $args = array() ) {
    580580
    581581        $defaults = array(
     
    691691    }
    692692
    693     function check_package($source) {
     693    public function check_package($source) {
    694694        global $wp_filesystem;
    695695
     
    718718
    719719    //return plugin info.
    720     function plugin_info() {
     720    public function plugin_info() {
    721721        if ( ! is_array($this->result) )
    722722            return false;
     
    734734
    735735    //Hooked to pre_install
    736     function deactivate_plugin_before_upgrade($return, $plugin) {
     736    public function deactivate_plugin_before_upgrade($return, $plugin) {
    737737
    738738        if ( is_wp_error($return) ) //Bypass.
     
    754754
    755755    //Hooked to upgrade_clear_destination
    756     function delete_old_plugin($removed, $local_destination, $remote_destination, $plugin) {
     756    public function delete_old_plugin($removed, $local_destination, $remote_destination, $plugin) {
    757757        global $wp_filesystem;
    758758
     
    792792class Theme_Upgrader extends WP_Upgrader {
    793793
    794     var $result;
    795     var $bulk = false;
    796 
    797     function upgrade_strings() {
     794    public $result;
     795    public $bulk = false;
     796
     797    public function upgrade_strings() {
    798798        $this->strings['up_to_date'] = __('The theme is at the latest version.');
    799799        $this->strings['no_package'] = __('Update package not available.');
     
    806806    }
    807807
    808     function install_strings() {
     808    public function install_strings() {
    809809        $this->strings['no_package'] = __('Install package not available.');
    810810        $this->strings['downloading_package'] = __('Downloading install package from <span class="code">%s</span>&#8230;');
     
    826826    }
    827827
    828     function check_parent_theme_filter($install_result, $hook_extra, $child_result) {
     828    public function check_parent_theme_filter($install_result, $hook_extra, $child_result) {
    829829        // Check to see if we need to install a parent theme
    830830        $theme_info = $this->theme_info();
     
    885885    }
    886886
    887     function hide_activate_preview_actions($actions) {
     887    public function hide_activate_preview_actions($actions) {
    888888        unset($actions['activate'], $actions['preview']);
    889889        return $actions;
    890890    }
    891891
    892     function install( $package, $args = array() ) {
     892    public function install( $package, $args = array() ) {
    893893
    894894        $defaults = array(
     
    926926    }
    927927
    928     function upgrade( $theme, $args = array() ) {
     928    public function upgrade( $theme, $args = array() ) {
    929929
    930930        $defaults = array(
     
    976976    }
    977977
    978     function bulk_upgrade( $themes, $args = array() ) {
     978    public function bulk_upgrade( $themes, $args = array() ) {
    979979
    980980        $defaults = array(
     
    10771077    }
    10781078
    1079     function check_package($source) {
     1079    public function check_package($source) {
    10801080        global $wp_filesystem;
    10811081
     
    11041104    }
    11051105
    1106     function current_before($return, $theme) {
     1106    public function current_before($return, $theme) {
    11071107
    11081108        if ( is_wp_error($return) )
     
    11201120    }
    11211121
    1122     function current_after($return, $theme) {
     1122    public function current_after($return, $theme) {
    11231123        if ( is_wp_error($return) )
    11241124            return $return;
     
    11421142    }
    11431143
    1144     function delete_old_theme( $removed, $local_destination, $remote_destination, $theme ) {
     1144    public function delete_old_theme( $removed, $local_destination, $remote_destination, $theme ) {
    11451145        global $wp_filesystem;
    11461146
     
    11611161    }
    11621162
    1163     function theme_info($theme = null) {
     1163    public function theme_info($theme = null) {
    11641164
    11651165        if ( empty($theme) ) {
     
    11851185class Language_Pack_Upgrader extends WP_Upgrader {
    11861186
    1187     var $result;
    1188     var $bulk = true;
    1189 
    1190     static function async_upgrade( $upgrader = false ) {
     1187    public $result;
     1188    public $bulk = true;
     1189
     1190    public static function async_upgrade( $upgrader = false ) {
    11911191        // Avoid recursion.
    11921192        if ( $upgrader && $upgrader instanceof Language_Pack_Upgrader )
     
    12061206    }
    12071207
    1208     function upgrade_strings() {
     1208    public function upgrade_strings() {
    12091209        $this->strings['starting_upgrade'] = __( 'Some of your translations need updating. Sit tight for a few more seconds while we update them as well.' );
    12101210        $this->strings['up_to_date'] = __( 'The translation is up to date.' ); // We need to silently skip this case
     
    12161216    }
    12171217
    1218     function upgrade( $update = false, $args = array() ) {
     1218    public function upgrade( $update = false, $args = array() ) {
    12191219        if ( $update )
    12201220            $update = array( $update );
     
    12231223    }
    12241224
    1225     function bulk_upgrade( $language_updates = array(), $args = array() ) {
     1225    public function bulk_upgrade( $language_updates = array(), $args = array() ) {
    12261226        global $wp_filesystem;
    12271227
     
    13241324    }
    13251325
    1326     function check_package( $source, $remote_source ) {
     1326    public function check_package( $source, $remote_source ) {
    13271327        global $wp_filesystem;
    13281328
     
    13491349    }
    13501350
    1351     function get_name_for_update( $update ) {
     1351    public function get_name_for_update( $update ) {
    13521352        switch ( $update->type ) {
    13531353            case 'core':
     
    13801380class Core_Upgrader extends WP_Upgrader {
    13811381
    1382     function upgrade_strings() {
     1382    public function upgrade_strings() {
    13831383        $this->strings['up_to_date'] = __('WordPress is at the latest version.');
    13841384        $this->strings['no_package'] = __('Update package not available.');
     
    13911391    }
    13921392
    1393     function upgrade( $current, $args = array() ) {
     1393    public function upgrade( $current, $args = array() ) {
    13941394        global $wp_filesystem;
    13951395
     
    15371537
    15381538    // Determines if this WordPress Core version should update to $offered_ver or not
    1539     static function should_update_to_version( $offered_ver /* x.y.z */ ) {
     1539    public static function should_update_to_version( $offered_ver /* x.y.z */ ) {
    15401540        include( ABSPATH . WPINC . '/version.php' ); // $wp_version; // x.y.z
    15411541
     
    16351635    }
    16361636
    1637     function check_files() {
     1637    public function check_files() {
    16381638        global $wp_version, $wp_local_package;
    16391639
     
    16631663 */
    16641664class File_Upload_Upgrader {
    1665     var $package;
    1666     var $filename;
    1667     var $id = 0;
    1668 
    1669     function __construct($form, $urlholder) {
     1665    public $package;
     1666    public $filename;
     1667    public $id = 0;
     1668
     1669    public function __construct($form, $urlholder) {
    16701670
    16711671        if ( empty($_FILES[$form]['name']) && empty($_GET[$urlholder]) )
     
    17181718    }
    17191719
    1720     function cleanup() {
     1720    public function cleanup() {
    17211721        if ( $this->id )
    17221722            wp_delete_attachment( $this->id );
Note: See TracChangeset for help on using the changeset viewer.