[wp-trac] [WordPress Trac] #10348: WP_filesystem improvements

WordPress Trac wp-trac at lists.automattic.com
Tue Jul 7 01:04:01 UTC 2009


#10348: WP_filesystem improvements
-------------------------+--------------------------------------------------
 Reporter:  blazerlocal  |       Owner:  dd32          
     Type:  enhancement  |      Status:  assigned      
 Priority:  normal       |   Milestone:  Future Release
Component:  Filesystem   |     Version:  2.9           
 Severity:  normal       |    Keywords:                
-------------------------+--------------------------------------------------

Comment(by blazerlocal):

 >But it seems like its a rather heavy Implementation of it.
 SSH is a rather heavy protocol. the server can use any number of
 encryption algorithms, public key algorithms, etc, and a client that
 doesn't support a good selection of them is useless as a client. besides,
 i would say openssh (as used by the ssh2 extension) is a heck of a lot
 more heavy an implementation of ssh than phpseclib. certainly it supports
 a lot more features. indeed, openssh is a superset of openssl and ssl and
 ssh have nothing to do with one another.


 >SFTP is obviously only supported by the SSH Extension at present.
 that's what i'm proposing change.

 >The Screen for all FTP Methods(That includes SSH) has an option of which
 type of connection to use. "FTP, FTPS, SSH" (SSH only if its supported)
 i don't think so...  wp-admin/update.php calls WP_Filesystem() as defined
 in wp-admin/includes/file.php which in turn calls get_filesystem_method().
 get_filesystem_method(), in turn, returns a string - not an array but a
 string. and methods aren't concatenated, either - it's just one method and
 that's it:

 {{{
 function get_filesystem_method($args = array()) {
         $method = false;
         if( function_exists('getmyuid') && function_exists('fileowner') ){
                 $temp_file = wp_tempnam();
                 if ( getmyuid() == fileowner($temp_file) )
                         $method = 'direct';
                 unlink($temp_file);
         }

         if ( ! $method && isset($args['connection_type']) && 'ssh' ==
 $args['connection_type'] && extension_loaded('ssh2') ) $method = 'ssh2';
         if ( ! $method && extension_loaded('ftp') ) $method = 'ftpext';
         if ( ! $method && ( extension_loaded('sockets') ||
 function_exists('fsockopen') ) ) $method = 'ftpsockets'; //Sockets: Socket
 extension; PHP Mode: FSockopen / fwrite / fread
         return apply_filters('filesystem_method', $method);
 }
 }}}
 if $method isn't defined and the ssh2 extension is loaded (among other
 things), $method is set to 'ssh2' and is never overwritten or modified by
 any of the other lines. maybe the latest SVN lets you select the method
 you'd like to use but the latest released version of Wordpress does not.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10348#comment:7>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list