Changeset 11823 for trunk/wp-admin/includes/class-wp-filesystem-ftpext.php
- Timestamp:
- 08/15/2009 12:01:04 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/class-wp-filesystem-ftpext.php
r11821 r11823 17 17 class WP_Filesystem_FTPext extends WP_Filesystem_Base { 18 18 var $link; 19 var $timeout = 5;20 19 var $errors = null; 21 20 var $options = array(); … … 34 33 35 34 // Set defaults: 35 //This Class uses the timeout on a per-connection basis, Others use it on a per-action basis. 36 37 if ( ! defined('FS_TIMEOUT') ) 38 define('FS_TIMEOUT', 240); 39 36 40 if ( empty($opt['port']) ) 37 41 $this->options['port'] = 21; … … 65 69 function connect() { 66 70 if ( isset($this->options['ssl']) && $this->options['ssl'] && function_exists('ftp_ssl_connect') ) 67 $this->link = @ftp_ssl_connect($this->options['hostname'], $this->options['port'], $this->timeout);68 else 69 $this->link = @ftp_connect($this->options['hostname'], $this->options['port'], $this->timeout);71 $this->link = @ftp_ssl_connect($this->options['hostname'], $this->options['port'], FS_CONNECT_TIMEOUT); 72 else 73 $this->link = @ftp_connect($this->options['hostname'], $this->options['port'], FS_CONNECT_TIMEOUT); 70 74 71 75 if ( ! $this->link ) { … … 81 85 //Set the Connection to use Passive FTP 82 86 @ftp_pasv( $this->link, true ); 87 if ( @ftp_get_option($this->link, FTP_TIMEOUT_SEC) < FTP_TIMEOUT ) 88 @ftp_set_option($this->link, FTP_TIMEOUT_SEC, FTP_TIMEOUT); 83 89 84 90 return true;
Note: See TracChangeset
for help on using the changeset viewer.