- Timestamp:
- 05/19/2014 12:13:29 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php
r26869 r28490 16 16 */ 17 17 class WP_Filesystem_ftpsockets extends WP_Filesystem_Base { 18 var$ftp = false;19 var$errors = null;20 var$options = array();21 22 function __construct($opt = '') {18 public $ftp = false; 19 public $errors = null; 20 public $options = array(); 21 22 public function __construct($opt = '') { 23 23 $this->method = 'ftpsockets'; 24 24 $this->errors = new WP_Error(); … … 54 54 } 55 55 56 function connect() {56 public function connect() { 57 57 if ( ! $this->ftp ) 58 58 return false; … … 81 81 } 82 82 83 function get_contents( $file ) {83 public function get_contents( $file ) { 84 84 if ( ! $this->exists($file) ) 85 85 return false; … … 114 114 } 115 115 116 function get_contents_array($file) {116 public function get_contents_array($file) { 117 117 return explode("\n", $this->get_contents($file) ); 118 118 } 119 119 120 function put_contents($file, $contents, $mode = false ) {120 public function put_contents($file, $contents, $mode = false ) { 121 121 $temp = wp_tempnam( $file ); 122 122 if ( ! $temphandle = @fopen($temp, 'w+') ) { … … 152 152 } 153 153 154 function cwd() {154 public function cwd() { 155 155 $cwd = $this->ftp->pwd(); 156 156 if ( $cwd ) … … 159 159 } 160 160 161 function chdir($file) {161 public function chdir($file) { 162 162 return $this->ftp->chdir($file); 163 163 } 164 164 165 function chgrp($file, $group, $recursive = false ) {166 return false; 167 } 168 169 function chmod($file, $mode = false, $recursive = false ) {165 public function chgrp($file, $group, $recursive = false ) { 166 return false; 167 } 168 169 public function chmod($file, $mode = false, $recursive = false ) { 170 170 if ( ! $mode ) { 171 171 if ( $this->is_file($file) ) … … 188 188 } 189 189 190 function owner($file) {190 public function owner($file) { 191 191 $dir = $this->dirlist($file); 192 192 return $dir[$file]['owner']; 193 193 } 194 194 195 function getchmod($file) {195 public function getchmod($file) { 196 196 $dir = $this->dirlist($file); 197 197 return $dir[$file]['permsn']; 198 198 } 199 199 200 function group($file) {200 public function group($file) { 201 201 $dir = $this->dirlist($file); 202 202 return $dir[$file]['group']; 203 203 } 204 204 205 function copy($source, $destination, $overwrite = false, $mode = false) {205 public function copy($source, $destination, $overwrite = false, $mode = false) { 206 206 if ( ! $overwrite && $this->exists($destination) ) 207 207 return false; … … 214 214 } 215 215 216 function move($source, $destination, $overwrite = false ) {216 public function move($source, $destination, $overwrite = false ) { 217 217 return $this->ftp->rename($source, $destination); 218 218 } 219 219 220 function delete($file, $recursive = false, $type = false) {220 public function delete($file, $recursive = false, $type = false) { 221 221 if ( empty($file) ) 222 222 return false; … … 229 229 } 230 230 231 function exists( $file ) {231 public function exists( $file ) { 232 232 $list = $this->ftp->nlist( $file ); 233 233 return !empty( $list ); //empty list = no file, so invert. … … 235 235 } 236 236 237 function is_file($file) {237 public function is_file($file) { 238 238 if ( $this->is_dir($file) ) 239 239 return false; … … 243 243 } 244 244 245 function is_dir($path) {245 public function is_dir($path) { 246 246 $cwd = $this->cwd(); 247 247 if ( $this->chdir($path) ) { … … 252 252 } 253 253 254 function is_readable($file) {254 public function is_readable($file) { 255 255 return true; 256 256 } 257 257 258 function is_writable($file) {258 public function is_writable($file) { 259 259 return true; 260 260 } 261 261 262 function atime($file) {263 return false; 264 } 265 266 function mtime($file) {262 public function atime($file) { 263 return false; 264 } 265 266 public function mtime($file) { 267 267 return $this->ftp->mdtm($file); 268 268 } 269 269 270 function size($file) {270 public function size($file) { 271 271 return $this->ftp->filesize($file); 272 272 } 273 273 274 function touch($file, $time = 0, $atime = 0 ) {275 return false; 276 } 277 278 function mkdir($path, $chmod = false, $chown = false, $chgrp = false ) {274 public function touch($file, $time = 0, $atime = 0 ) { 275 return false; 276 } 277 278 public function mkdir($path, $chmod = false, $chown = false, $chgrp = false ) { 279 279 $path = untrailingslashit($path); 280 280 if ( empty($path) ) … … 293 293 } 294 294 295 function rmdir($path, $recursive = false ) {295 public function rmdir($path, $recursive = false ) { 296 296 $this->delete($path, $recursive); 297 297 } 298 298 299 function dirlist($path = '.', $include_hidden = true, $recursive = false ) {299 public function dirlist($path = '.', $include_hidden = true, $recursive = false ) { 300 300 if ( $this->is_file($path) ) { 301 301 $limit_file = basename($path); … … 346 346 } 347 347 348 function __destruct() {348 public function __destruct() { 349 349 $this->ftp->quit(); 350 350 }
Note: See TracChangeset
for help on using the changeset viewer.