Ticket #7690: 7690.4.diff
| File 7690.4.diff, 2.2 KB (added by , 18 years ago) |
|---|
-
wp-admin/includes/class-wp-filesystem-ssh2.php
9 9 /** 10 10 * WordPress Filesystem Class for implementing SSH2. 11 11 * 12 * To use this class you must follow these steps for PHP 5.2.6+ 13 * 14 * @contrib http://kevin.vanzonneveld.net/techblog/article/make_ssh_connections_with_php/ - Installation Notes 15 * 16 * Complie libssh2 (Note: Only 0.14 is officaly working with PHP 5.2.6+ right now.) 17 * 18 * cd /usr/src 19 * wget http://surfnet.dl.sourceforge.net/sourceforge/libssh2/libssh2-0.14.tar.gz 20 * tar -zxvf libssh2-0.14.tar.gz 21 * cd libssh2-0.14/ 22 * ./configure 23 * make all install 24 * 25 * Note: No not leave the directory yet! 26 * 27 * Enter: pecl install -f ssh2 28 * 29 * Copy the ssh.so file it creates to your PHP Module Directory. 30 * Open up your PHP.INI file and look for where extensions are placed. 31 * Add in your PHP.ini file: extension=ssh2.so 32 * 33 * Restart Apache! 34 * Check phpinfo() streams to confirm that: ssh2.shell, ssh2.exec, ssh2.tunnel, ssh2.scp, ssh2.sftp exist. 35 * 36 * 12 37 * @since 2.7 13 38 * @package WordPress 14 39 * @subpackage Filesystem … … 71 96 $this->options['username'] = $opt['username']; 72 97 73 98 if ( empty ($opt['password']) ) 74 $this->errors->add('empty_password', __('SSH password is required'));99 $this->errors->add('empty_password', __('SSH2 password is required')); 75 100 else 76 101 $this->options['password'] = $opt['password']; 77 102 … … 103 128 $time_start = time(); 104 129 $data = ""; 105 130 while( true ) { 106 if( (time()-$time_start) > $this->timeout ) {131 if( (time()-$time_start) > $this->timeout ) { 107 132 $this->errors->add('command', sprintf(__('Connection to the server has timeout after %s seconds.'), $this->timeout)); 108 133 break; 109 134 } 110 while( $buf = fread( $stream, strlen($stream) ) ) {135 while( $buf = fread( $stream, strlen($stream) ) ) { 111 136 $data .= $buf; 112 137 } 113 138 } … … 448 473 } 449 474 } 450 475 451 ?> 452 No newline at end of file 476 ?>