Make WordPress Core


Ignore:
Timestamp:
09/09/2013 02:54:50 AM (11 years ago)
Author:
dd32
Message:

WP_Filesystem: Let the code breathe, add some additional whitespace between method definitions and comments.

File:
1 edited

Legend:

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

    r25082 r25305  
    2121     */
    2222    var $verbose = false;
     23
    2324    /**
    2425     * Cached list of local filepaths to mapped remote filepaths.
     
    4849    function abspath() {
    4950        $folder = $this->find_folder(ABSPATH);
    50         //Perhaps the FTP folder is rooted at the WordPress install, Check for wp-includes folder in root, Could have some false positives, but rare.
     51        // Perhaps the FTP folder is rooted at the WordPress install, Check for wp-includes folder in root, Could have some false positives, but rare.
    5152        if ( ! $folder && $this->is_dir('/wp-includes') )
    5253            $folder = '/';
    5354        return $folder;
    5455    }
     56
    5557    /**
    5658     * Returns the path on the remote filesystem of WP_CONTENT_DIR
     
    6365        return $this->find_folder(WP_CONTENT_DIR);
    6466    }
     67
    6568    /**
    6669     * Returns the path on the remote filesystem of WP_PLUGIN_DIR
     
    7477        return $this->find_folder(WP_PLUGIN_DIR);
    7578    }
     79
    7680    /**
    7781     * Returns the path on the remote filesystem of the Themes Directory
     
    9296        return $this->find_folder( $theme_root );
    9397    }
     98
    9499    /**
    95100     * Returns the path on the remote filesystem of WP_LANG_DIR
     
    122127        return $this->abspath();
    123128    }
     129
    124130    /**
    125131     * Locates a folder on the remote filesystem.
     
    189195            }
    190196        } elseif ( 'direct' == $this->method ) {
    191             $folder = str_replace('\\', '/', $folder); //Windows path sanitisation
     197            $folder = str_replace('\\', '/', $folder); // Windows path sanitisation
    192198            return trailingslashit($folder);
    193199        }
    194200
    195         $folder = preg_replace('|^([a-z]{1}):|i', '', $folder); //Strip out windows drive letter if it's there.
    196         $folder = str_replace('\\', '/', $folder); //Windows path sanitisation
     201        $folder = preg_replace('|^([a-z]{1}):|i', '', $folder); // Strip out windows drive letter if it's there.
     202        $folder = str_replace('\\', '/', $folder); // Windows path sanitisation
    197203
    198204        if ( isset($this->cache[ $folder ] ) )
    199205            return $this->cache[ $folder ];
    200206
    201         if ( $this->exists($folder) ) { //Folder exists at that absolute path.
     207        if ( $this->exists($folder) ) { // Folder exists at that absolute path.
    202208            $folder = trailingslashit($folder);
    203209            $this->cache[ $folder ] = $folder;
     
    240246        foreach ( $folder_parts as $index => $key ) {
    241247            if ( $index == $last_index )
    242                 continue; //We want this to be caught by the next code block.
    243 
    244             //Working from /home/ to /user/ to /wordpress/ see if that file exists within the current folder,
     248                continue; // We want this to be caught by the next code block.
     249
     250            // Working from /home/ to /user/ to /wordpress/ see if that file exists within the current folder,
    245251            // If it's found, change into it and follow through looking for it.
    246252            // If it cant find WordPress down that route, it'll continue onto the next folder level, and see if that matches, and so on.
    247253            // If it reaches the end, and still cant find it, it'll return false for the entire function.
    248254            if ( isset($files[ $key ]) ){
    249                 //Lets try that folder:
     255                // Lets try that folder:
    250256                $newdir = trailingslashit(path_join($base, $key));
    251257                if ( $this->verbose )
     
    258264        }
    259265
    260         //Only check this as a last resort, to prevent locating the incorrect install. All above procedures will fail quickly if this is the right branch to take.
     266        // Only check this as a last resort, to prevent locating the incorrect install. All above procedures will fail quickly if this is the right branch to take.
    261267        if (isset( $files[ $last_path ] ) ) {
    262268            if ( $this->verbose )
     
    373379     */
    374380    function is_binary( $text ) {
    375         return (bool) preg_match('|[^\x20-\x7E]|', $text); //chr(32)..chr(127)
     381        return (bool) preg_match( '|[^\x20-\x7E]|', $text ); // chr(32)..chr(127)
    376382    }
    377383}
Note: See TracChangeset for help on using the changeset viewer.