Changeset 28496
- Timestamp:
- 05/19/2014 01:28:10 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-upgrader.php
r28479 r28496 22 22 */ 23 23 class 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) { 29 29 if ( null == $skin ) 30 30 $this->skin = new WP_Upgrader_Skin(); … … 33 33 } 34 34 35 function init() {35 public function init() { 36 36 $this->skin->set_upgrader($this); 37 37 $this->generic_strings(); 38 38 } 39 39 40 function generic_strings() {40 public function generic_strings() { 41 41 $this->strings['bad_request'] = __('Invalid Data provided.'); 42 42 $this->strings['fs_unavailable'] = __('Could not access filesystem.'); … … 60 60 } 61 61 62 function fs_connect( $directories = array() ) {62 public function fs_connect( $directories = array() ) { 63 63 global $wp_filesystem; 64 64 … … 107 107 } //end fs_connect(); 108 108 109 function download_package($package) {109 public function download_package($package) { 110 110 111 111 /** … … 139 139 } 140 140 141 function unpack_package($package, $delete_package = true) {141 public function unpack_package($package, $delete_package = true) { 142 142 global $wp_filesystem; 143 143 … … 178 178 } 179 179 180 function install_package( $args = array() ) {180 public function install_package( $args = array() ) { 181 181 global $wp_filesystem, $wp_theme_directories; 182 182 … … 348 348 } 349 349 350 function run( $options ) {350 public function run( $options ) { 351 351 352 352 $defaults = array( … … 442 442 } 443 443 444 function maintenance_mode($enable = false) {444 public function maintenance_mode($enable = false) { 445 445 global $wp_filesystem; 446 446 $file = $wp_filesystem->abspath() . '.maintenance'; … … 468 468 class Plugin_Upgrader extends WP_Upgrader { 469 469 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() { 474 474 $this->strings['up_to_date'] = __('The plugin is at the latest version.'); 475 475 $this->strings['no_package'] = __('Update package not available.'); … … 482 482 } 483 483 484 function install_strings() {484 public function install_strings() { 485 485 $this->strings['no_package'] = __('Install package not available.'); 486 486 $this->strings['downloading_package'] = __('Downloading install package from <span class="code">%s</span>…'); … … 492 492 } 493 493 494 function install( $package, $args = array() ) {494 public function install( $package, $args = array() ) { 495 495 496 496 $defaults = array( … … 526 526 } 527 527 528 function upgrade( $plugin, $args = array() ) {528 public function upgrade( $plugin, $args = array() ) { 529 529 530 530 $defaults = array( … … 577 577 } 578 578 579 function bulk_upgrade( $plugins, $args = array() ) {579 public function bulk_upgrade( $plugins, $args = array() ) { 580 580 581 581 $defaults = array( … … 691 691 } 692 692 693 function check_package($source) {693 public function check_package($source) { 694 694 global $wp_filesystem; 695 695 … … 718 718 719 719 //return plugin info. 720 function plugin_info() {720 public function plugin_info() { 721 721 if ( ! is_array($this->result) ) 722 722 return false; … … 734 734 735 735 //Hooked to pre_install 736 function deactivate_plugin_before_upgrade($return, $plugin) {736 public function deactivate_plugin_before_upgrade($return, $plugin) { 737 737 738 738 if ( is_wp_error($return) ) //Bypass. … … 754 754 755 755 //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) { 757 757 global $wp_filesystem; 758 758 … … 792 792 class Theme_Upgrader extends WP_Upgrader { 793 793 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() { 798 798 $this->strings['up_to_date'] = __('The theme is at the latest version.'); 799 799 $this->strings['no_package'] = __('Update package not available.'); … … 806 806 } 807 807 808 function install_strings() {808 public function install_strings() { 809 809 $this->strings['no_package'] = __('Install package not available.'); 810 810 $this->strings['downloading_package'] = __('Downloading install package from <span class="code">%s</span>…'); … … 826 826 } 827 827 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) { 829 829 // Check to see if we need to install a parent theme 830 830 $theme_info = $this->theme_info(); … … 885 885 } 886 886 887 function hide_activate_preview_actions($actions) {887 public function hide_activate_preview_actions($actions) { 888 888 unset($actions['activate'], $actions['preview']); 889 889 return $actions; 890 890 } 891 891 892 function install( $package, $args = array() ) {892 public function install( $package, $args = array() ) { 893 893 894 894 $defaults = array( … … 926 926 } 927 927 928 function upgrade( $theme, $args = array() ) {928 public function upgrade( $theme, $args = array() ) { 929 929 930 930 $defaults = array( … … 976 976 } 977 977 978 function bulk_upgrade( $themes, $args = array() ) {978 public function bulk_upgrade( $themes, $args = array() ) { 979 979 980 980 $defaults = array( … … 1077 1077 } 1078 1078 1079 function check_package($source) {1079 public function check_package($source) { 1080 1080 global $wp_filesystem; 1081 1081 … … 1104 1104 } 1105 1105 1106 function current_before($return, $theme) {1106 public function current_before($return, $theme) { 1107 1107 1108 1108 if ( is_wp_error($return) ) … … 1120 1120 } 1121 1121 1122 function current_after($return, $theme) {1122 public function current_after($return, $theme) { 1123 1123 if ( is_wp_error($return) ) 1124 1124 return $return; … … 1142 1142 } 1143 1143 1144 function delete_old_theme( $removed, $local_destination, $remote_destination, $theme ) {1144 public function delete_old_theme( $removed, $local_destination, $remote_destination, $theme ) { 1145 1145 global $wp_filesystem; 1146 1146 … … 1161 1161 } 1162 1162 1163 function theme_info($theme = null) {1163 public function theme_info($theme = null) { 1164 1164 1165 1165 if ( empty($theme) ) { … … 1185 1185 class Language_Pack_Upgrader extends WP_Upgrader { 1186 1186 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 ) { 1191 1191 // Avoid recursion. 1192 1192 if ( $upgrader && $upgrader instanceof Language_Pack_Upgrader ) … … 1206 1206 } 1207 1207 1208 function upgrade_strings() {1208 public function upgrade_strings() { 1209 1209 $this->strings['starting_upgrade'] = __( 'Some of your translations need updating. Sit tight for a few more seconds while we update them as well.' ); 1210 1210 $this->strings['up_to_date'] = __( 'The translation is up to date.' ); // We need to silently skip this case … … 1216 1216 } 1217 1217 1218 function upgrade( $update = false, $args = array() ) {1218 public function upgrade( $update = false, $args = array() ) { 1219 1219 if ( $update ) 1220 1220 $update = array( $update ); … … 1223 1223 } 1224 1224 1225 function bulk_upgrade( $language_updates = array(), $args = array() ) {1225 public function bulk_upgrade( $language_updates = array(), $args = array() ) { 1226 1226 global $wp_filesystem; 1227 1227 … … 1324 1324 } 1325 1325 1326 function check_package( $source, $remote_source ) {1326 public function check_package( $source, $remote_source ) { 1327 1327 global $wp_filesystem; 1328 1328 … … 1349 1349 } 1350 1350 1351 function get_name_for_update( $update ) {1351 public function get_name_for_update( $update ) { 1352 1352 switch ( $update->type ) { 1353 1353 case 'core': … … 1380 1380 class Core_Upgrader extends WP_Upgrader { 1381 1381 1382 function upgrade_strings() {1382 public function upgrade_strings() { 1383 1383 $this->strings['up_to_date'] = __('WordPress is at the latest version.'); 1384 1384 $this->strings['no_package'] = __('Update package not available.'); … … 1391 1391 } 1392 1392 1393 function upgrade( $current, $args = array() ) {1393 public function upgrade( $current, $args = array() ) { 1394 1394 global $wp_filesystem; 1395 1395 … … 1537 1537 1538 1538 // 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 */ ) { 1540 1540 include( ABSPATH . WPINC . '/version.php' ); // $wp_version; // x.y.z 1541 1541 … … 1635 1635 } 1636 1636 1637 function check_files() {1637 public function check_files() { 1638 1638 global $wp_version, $wp_local_package; 1639 1639 … … 1663 1663 */ 1664 1664 class 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) { 1670 1670 1671 1671 if ( empty($_FILES[$form]['name']) && empty($_GET[$urlholder]) ) … … 1718 1718 } 1719 1719 1720 function cleanup() {1720 public function cleanup() { 1721 1721 if ( $this->id ) 1722 1722 wp_delete_attachment( $this->id );
Note: See TracChangeset
for help on using the changeset viewer.