- Timestamp:
- 09/09/2013 02:54:50 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-filesystem-ftpext.php
r25304 r25305 24 24 $this->errors = new WP_Error(); 25 25 26 // Check if possible to use ftp functions.26 // Check if possible to use ftp functions. 27 27 if ( ! extension_loaded('ftp') ) { 28 28 $this->errors->add('no_ftp_ext', __('The ftp PHP extension is not available')); … … 30 30 } 31 31 32 // Set defaults: 33 //This Class uses the timeout on a per-connection basis, Others use it on a per-action basis. 32 // This Class uses the timeout on a per-connection basis, Others use it on a per-action basis. 34 33 35 34 if ( ! defined('FS_TIMEOUT') ) … … 81 80 } 82 81 83 // Set the Connection to use Passive FTP82 // Set the Connection to use Passive FTP 84 83 @ftp_pasv( $this->link, true ); 85 84 if ( @ftp_get_option($this->link, FTP_TIMEOUT_SEC) < FS_TIMEOUT ) … … 99 98 return false; 100 99 101 fseek( $temp, 0); //Skip back to the start of the file being written to100 fseek( $temp, 0 ); // Skip back to the start of the file being written to 102 101 $contents = ''; 103 102 … … 109 108 return $contents; 110 109 } 110 111 111 function get_contents_array($file) { 112 112 return explode("\n", $this->get_contents($file)); … … 137 137 return $ret; 138 138 } 139 139 140 function cwd() { 140 141 $cwd = @ftp_pwd($this->link); … … 143 144 return $cwd; 144 145 } 146 145 147 function chdir($dir) { 146 148 return @ftp_chdir($this->link, $dir); 147 149 } 150 148 151 function chgrp($file, $group, $recursive = false ) { 149 152 return false; 150 153 } 154 151 155 function chmod($file, $mode = false, $recursive = false) { 152 156 if ( ! $mode ) { … … 171 175 return (bool)@ftp_chmod($this->link, $mode, $file); 172 176 } 177 173 178 function chown($file, $owner, $recursive = false ) { 174 179 return false; 175 180 } 181 176 182 function owner($file) { 177 183 $dir = $this->dirlist($file); 178 184 return $dir[$file]['owner']; 179 185 } 186 180 187 function getchmod($file) { 181 188 $dir = $this->dirlist($file); 182 189 return $dir[$file]['permsn']; 183 190 } 191 184 192 function group($file) { 185 193 $dir = $this->dirlist($file); 186 194 return $dir[$file]['group']; 187 195 } 196 188 197 function copy($source, $destination, $overwrite = false, $mode = false) { 189 198 if ( ! $overwrite && $this->exists($destination) ) … … 194 203 return $this->put_contents($destination, $content, $mode); 195 204 } 205 196 206 function move($source, $destination, $overwrite = false) { 197 207 return ftp_rename($this->link, $source, $destination); … … 217 227 return !empty($list); //empty list = no file, so invert. 218 228 } 229 219 230 function is_file($file) { 220 231 return $this->exists($file) && !$this->is_dir($file); 221 232 } 233 222 234 function is_dir($path) { 223 235 $cwd = $this->cwd(); … … 229 241 return false; 230 242 } 243 231 244 function is_readable($file) { 232 //Get dir list, Check if the file is readable by the current user??233 245 return true; 234 246 } 247 235 248 function is_writable($file) { 236 //Get dir list, Check if the file is writable by the current user??237 249 return true; 238 250 } 251 239 252 function atime($file) { 240 253 return false; 241 254 } 255 242 256 function mtime($file) { 243 257 return ftp_mdtm($this->link, $file); 244 258 } 259 245 260 function size($file) { 246 261 return ftp_size($this->link, $file); 247 262 } 263 248 264 function touch($file, $time = 0, $atime = 0) { 249 265 return false; 250 266 } 267 251 268 function mkdir($path, $chmod = false, $chown = false, $chgrp = false) { 252 269 $path = untrailingslashit($path); … … 263 280 return true; 264 281 } 282 265 283 function rmdir($path, $recursive = false) { 266 284 return $this->delete($path, $recursive);
Note: See TracChangeset
for help on using the changeset viewer.