Changeset 33685
- Timestamp:
- 08/21/2015 04:12:45 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-upgrader.php
r33684 r33685 437 437 */ 438 438 $res = apply_filters( 'upgrader_pre_install', true, $args['hook_extra'] ); 439 439 440 if ( is_wp_error( $res ) ) { 440 441 return $res; … … 467 468 */ 468 469 $source = apply_filters( 'upgrader_source_selection', $source, $remote_source, $this ); 470 469 471 if ( is_wp_error( $source ) ) { 470 472 return $source; … … 475 477 $source_files = array_keys( $wp_filesystem->dirlist( $source ) ); 476 478 } 479 477 480 /* 478 481 * Protection against deleting files in any important base directories. … … 487 490 $protected_directories = array_merge( $protected_directories, $wp_theme_directories ); 488 491 } 492 489 493 if ( in_array( $destination, $protected_directories ) ) { 490 494 $remote_destination = trailingslashit( $remote_destination ) . trailingslashit( basename( $source ) ); … … 493 497 494 498 if ( $clear_destination ) { 495 // We're going to clear the destination if there's something there 499 // We're going to clear the destination if there's something there. 496 500 $this->skin->feedback('remove_old'); 497 501 … … 601 605 * {@see WP_Upgrader::run()}. 602 606 * } 603 *604 607 * @return array|false|WP_error The result from self::install_package() on success, otherwise a WP_Error, 605 608 * or false if unable to connect to the filesystem. … … 663 666 } 664 667 665 //Download the package (Note, This just returns the filename of the file if the package is a local file) 668 /* 669 * Download the package (Note, This just returns the filename 670 * of the file if the package is a local file) 671 */ 666 672 $download = $this->download_package( $options['package'] ); 667 673 if ( is_wp_error($download) ) { … … 676 682 $delete_package = ( $download != $options['package'] ); // Do not delete a "local" file 677 683 678 // Unzips the file into a temporary directory684 // Unzips the file into a temporary directory. 679 685 $working_dir = $this->unpack_package( $download, $delete_package ); 680 686 if ( is_wp_error($working_dir) ) { … … 687 693 } 688 694 689 // With the given options, this installs it to the destination directory.695 // With the given options, this installs it to the destination directory. 690 696 $result = $this->install_package( array( 691 697 'source' => $working_dir, … … 702 708 $this->skin->feedback('process_failed'); 703 709 } else { 704 // Install Succeeded710 // Install succeeded. 705 711 $this->skin->feedback('process_success'); 706 712 } … … 762 768 * @access public 763 769 * @var array|WP_Error $result 770 * 764 771 * @see WP_Upgrader::$result 765 772 */ … … 823 830 * Default true. 824 831 * } 825 *826 832 * @return bool|WP_Error True if the install was successful, false or a WP_Error otherwise. 827 833 */ … … 941 947 * Default true. 942 948 * } 943 *944 949 * @return array|false An array of results indexed by plugin file, or false if unable to connect to the filesystem. 945 950 */ … … 970 975 $this->skin->bulk_header(); 971 976 972 // Only start maintenance mode if: 973 // - running Multisite and there are one or more plugins specified, OR 974 // - a plugin with an update available is currently active. 975 // @TODO: For multisite, maintenance mode should only kick in for individual sites if at all possible. 977 /* 978 * Only start maintenance mode if: 979 * - running Multisite and there are one or more plugins specified, OR 980 * - a plugin with an update available is currently active. 981 * @TODO: For multisite, maintenance mode should only kick in for individual sites if at all possible. 982 */ 976 983 $maintenance = ( is_multisite() && ! empty( $plugins ) ); 977 984 foreach ( $plugins as $plugin ) … … 997 1004 } 998 1005 999 // Get the URL to the zip file 1006 // Get the URL to the zip file. 1000 1007 $r = $current->response[ $plugin ]; 1001 1008 … … 1052 1059 remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin')); 1053 1060 1054 // Force refresh of plugin update information 1061 // Force refresh of plugin update information. 1055 1062 wp_clean_plugins_cache( $parsed_args['clear_update_cache'] ); 1056 1063 … … 1070 1077 * 1071 1078 * @param string $source The path to the downloaded package source. 1072 * @return string|WP_Error The source as passed, or a {@see WP_Error} object if no plugins were found. 1079 * @return string|WP_Error The source as passed, or a {@see WP_Error} object 1080 * if no plugins were found. 1073 1081 */ 1074 1082 public function check_package($source) {
Note: See TracChangeset
for help on using the changeset viewer.