Make WordPress Core


Ignore:
Timestamp:
08/27/2016 02:36:42 PM (10 years ago)
Author:
dd32
Message:

Bootstrap: Revert [38399] as it's broken /build/ and subsequently core.svn.wordpress.org.

The generated classmaps reference /src/ files and operates in the assumption that the base directory is one level above wp-settings.php, which it isn't after our build processes are run.

See #36335

File:
1 edited

Legend:

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

    r38399 r38402  
    738738        mbstring_binary_safe_encoding();
    739739
     740        require_once(ABSPATH . 'wp-admin/includes/class-pclzip.php');
     741
    740742        $archive = new PclZip($file);
    741743
    … …  
    885887        global $wp_filesystem;
    886888
     889        require_once(ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php');
     890
    887891        $method = get_filesystem_method( $args, $context, $allow_relaxed_file_ownership );
    888892
    … …  
    890894                return false;
    891895
    892         $map = array(
    893                 'base' => 'WP_Filesystem_Base',
    894                 'direct' => 'WP_Filesystem_Direct',
    895                 'ftpext' => 'WP_Filesystem_FTPext',
    896                 'ftpsockets' => 'WP_Filesystem_ftpsockets',
    897                 'ssh2' => 'WP_Filesystem_SSH2',
    898         );
    899 
    900         $l = strtolower( $method );
    901         if ( array_key_exists( $l, $map ) ) {
    902                 $classname = $map[ $l ];
    903         } else {
    904                 $classname = "WP_Filesystem_{$method}";
    905         }
    906 
    907         if ( ! class_exists( $classname ) ) {
     896        if ( ! class_exists( "WP_Filesystem_$method" ) ) {
    908897
    909898                /**
    … …  
    919908                $abstraction_file = apply_filters( 'filesystem_method_file', ABSPATH . 'wp-admin/includes/class-wp-filesystem-' . $method . '.php', $method );
    920909
    921                 if ( ! file_exists( $abstraction_file ) ) {
     910                if ( ! file_exists($abstraction_file) )
    922911                        return;
    923                 }
    924 
    925                 require_once( $abstraction_file );
    926         }
    927 
    928         $wp_filesystem = new $classname( $args );
     912
     913                require_once($abstraction_file);
     914        }
     915        $method = "WP_Filesystem_$method";
     916
     917        $wp_filesystem = new $method($args);
    929918
    930919        //Define the timeouts for the connections. Only available after the construct is called to allow for per-transport overriding of the default.
Note: See TracChangeset for help on using the changeset viewer.