Make WordPress Core


Ignore:
Timestamp:
08/09/2008 05:36:14 AM (18 years ago)
Author:
ryan
Message:

Trailing whitespace cleanup

File:
1 edited

Legend:

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

    r8255 r8600  
    33        var $verbose = false;
    44        var $cache = array();
    5        
     5
    66        var $method = '';
    7        
     7
    88        function abspath() {
    9                 if ( defined('FTP_BASE') && strpos($this->method, 'ftp') !== false ) 
     9                if ( defined('FTP_BASE') && strpos($this->method, 'ftp') !== false )
    1010                        return FTP_BASE;
    1111                return $this->find_folder(ABSPATH);
    1212        }
    1313        function wp_content_dir() {
    14                 if ( defined('FTP_CONTENT_DIR') && strpos($this->method, 'ftp') !== false ) 
     14                if ( defined('FTP_CONTENT_DIR') && strpos($this->method, 'ftp') !== false )
    1515                        return FTP_CONTENT_DIR;
    1616                return $this->find_folder(WP_CONTENT_DIR);
    1717        }
    1818        function wp_plugins_dir() {
    19                 if ( defined('FTP_PLUGIN_DIR') && strpos($this->method, 'ftp') !== false ) 
     19                if ( defined('FTP_PLUGIN_DIR') && strpos($this->method, 'ftp') !== false )
    2020                        return FTP_PLUGIN_DIR;
    2121                return $this->find_folder(WP_PLUGIN_DIR);
     
    3434                return $this->abspath();
    3535        }
    36        
     36
    3737        function find_folder($folder) {
    3838                $folder = str_replace('\\', '/', $folder); //Windows Sanitiation
     
    4848                return $return;
    4949        }
    50        
     50
    5151        // Assumes $folder is windows sanitized;
    5252        // Assumes that the drive letter is safe to be stripped off, Should not be a problem for windows servers.
     
    5454                if ( empty( $base ) || '.' == $base )
    5555                        $base = trailingslashit($this->cwd());
    56                
     56
    5757                $folder = preg_replace('|^([a-z]{1}):|i', '', $folder); //Strip out windows driveletter if its there.
    58                
     58
    5959                $folder_parts = explode('/', $folder);
    6060                $last_path = $folder_parts[ count($folder_parts) - 1 ];
    61                
     61
    6262                $files = $this->dirlist( $base );
    63                
     63
    6464                foreach ( $folder_parts as $key ) {
    6565                        if ( $key == $last_path )
    6666                                continue; //We want this to be caught by the next code block.
    6767
    68                         //Working from /home/ to /user/ to /wordpress/ see if that file exists within the current folder, 
    69                         // If its found, change into it and follow through looking for it. 
     68                        //Working from /home/ to /user/ to /wordpress/ see if that file exists within the current folder,
     69                        // If its found, change into it and follow through looking for it.
    7070                        // If it cant find WordPress down that route, it'll continue onto the next folder level, and see if that matches, and so on.
    7171                        // If it reaches the end, and still cant find it, it'll return false for the entire function.
     
    7979                        }
    8080                }
    81                
     81
    8282                //Only check this as a last resort, to prevent locating the incorrect install. All above proceeedures will fail quickly if this is the right branch to take.
    8383                if(isset( $files[ $last_path ] ) ) {
     
    8989                        return false;//Prevent tihs function looping again.
    9090                //As an extra last resort, Change back to / if the folder wasnt found. This comes into effect when the CWD is /home/user/ but WP is at /var/www/.... mainly dedicated setups.
    91                 return $this->search_for_folder($folder, '/', true); 
    92                
     91                return $this->search_for_folder($folder, '/', true);
     92
    9393        }
    94        
     94
    9595        //Common Helper functions.
    9696        function gethchmod($file){
     
    144144                   if($key = array_search($attarray[$i], $legal))
    145145                           $realmode .= $legal[$key];
    146                            
     146
    147147                $mode = str_pad($realmode, 9, '-');
    148148                $trans = array('-'=>'0', 'r'=>'4', 'w'=>'2', 'x'=>'1');
    149149                $mode = strtr($mode,$trans);
    150                
     150
    151151                $newmode = '';
    152152                $newmode .= $mode[0] + $mode[1] + $mode[2];
Note: See TracChangeset for help on using the changeset viewer.