Changeset 28488
- Timestamp:
- 05/19/2014 12:08:38 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-filesystem-direct.php
r27566 r28488 22 22 * @param mixed $arg ignored argument 23 23 */ 24 function __construct($arg) {24 public function __construct($arg) { 25 25 $this->method = 'direct'; 26 26 $this->errors = new WP_Error(); … … 33 33 * @return string|bool The function returns the read data or false on failure. 34 34 */ 35 function get_contents($file) {35 public function get_contents($file) { 36 36 return @file_get_contents($file); 37 37 } … … 43 43 * @return array|bool the file contents in an array or false on failure. 44 44 */ 45 function get_contents_array($file) {45 public function get_contents_array($file) { 46 46 return @file($file); 47 47 } … … 55 55 * @return bool False upon failure. 56 56 */ 57 function put_contents( $file, $contents, $mode = false ) {57 public function put_contents( $file, $contents, $mode = false ) { 58 58 $fp = @fopen( $file, 'wb' ); 59 59 if ( ! $fp ) … … 83 83 * @return string|bool the current working directory on success, or false on failure. 84 84 */ 85 function cwd() {85 public function cwd() { 86 86 return @getcwd(); 87 87 } … … 93 93 * @return bool Returns true on success or false on failure. 94 94 */ 95 function chdir($dir) {95 public function chdir($dir) { 96 96 return @chdir($dir); 97 97 } … … 105 105 * @return bool Returns true on success or false on failure. 106 106 */ 107 function chgrp($file, $group, $recursive = false) {107 public function chgrp($file, $group, $recursive = false) { 108 108 if ( ! $this->exists($file) ) 109 109 return false; … … 129 129 * @return bool Returns true on success or false on failure. 130 130 */ 131 function chmod($file, $mode = false, $recursive = false) {131 public function chmod($file, $mode = false, $recursive = false) { 132 132 if ( ! $mode ) { 133 133 if ( $this->is_file($file) ) … … 158 158 * @return bool Returns true on success or false on failure. 159 159 */ 160 function chown($file, $owner, $recursive = false) {160 public function chown($file, $owner, $recursive = false) { 161 161 if ( ! $this->exists($file) ) 162 162 return false; … … 179 179 * @return string|bool Username of the user or false on error. 180 180 */ 181 function owner($file) {181 public function owner($file) { 182 182 $owneruid = @fileowner($file); 183 183 if ( ! $owneruid ) … … 197 197 * @return string Mode of the file (last 3 digits). 198 198 */ 199 function getchmod($file) {199 public function getchmod($file) { 200 200 return substr( decoct( @fileperms( $file ) ), -3 ); 201 201 } 202 202 203 function group($file) {203 public function group($file) { 204 204 $gid = @filegroup($file); 205 205 if ( ! $gid ) … … 211 211 } 212 212 213 function copy($source, $destination, $overwrite = false, $mode = false) {213 public function copy($source, $destination, $overwrite = false, $mode = false) { 214 214 if ( ! $overwrite && $this->exists($destination) ) 215 215 return false; … … 221 221 } 222 222 223 function move($source, $destination, $overwrite = false) {223 public function move($source, $destination, $overwrite = false) { 224 224 if ( ! $overwrite && $this->exists($destination) ) 225 225 return false; … … 237 237 } 238 238 239 function delete($file, $recursive = false, $type = false) {239 public function delete($file, $recursive = false, $type = false) { 240 240 if ( empty( $file ) ) // Some filesystems report this as /, which can cause non-expected recursive deletion of all files in the filesystem. 241 241 return false; … … 265 265 } 266 266 267 function exists($file) {267 public function exists($file) { 268 268 return @file_exists($file); 269 269 } 270 270 271 function is_file($file) {271 public function is_file($file) { 272 272 return @is_file($file); 273 273 } 274 274 275 function is_dir($path) {275 public function is_dir($path) { 276 276 return @is_dir($path); 277 277 } 278 278 279 function is_readable($file) {279 public function is_readable($file) { 280 280 return @is_readable($file); 281 281 } 282 282 283 function is_writable($file) {283 public function is_writable($file) { 284 284 return @is_writable($file); 285 285 } 286 286 287 function atime($file) {287 public function atime($file) { 288 288 return @fileatime($file); 289 289 } 290 290 291 function mtime($file) {291 public function mtime($file) { 292 292 return @filemtime($file); 293 293 } 294 294 295 function size($file) {295 public function size($file) { 296 296 return @filesize($file); 297 297 } 298 298 299 function touch($file, $time = 0, $atime = 0) {299 public function touch($file, $time = 0, $atime = 0) { 300 300 if ($time == 0) 301 301 $time = time(); … … 305 305 } 306 306 307 function mkdir($path, $chmod = false, $chown = false, $chgrp = false) {307 public function mkdir($path, $chmod = false, $chown = false, $chgrp = false) { 308 308 // safe mode fails with a trailing slash under certain PHP versions. 309 309 $path = untrailingslashit($path); … … 324 324 } 325 325 326 function rmdir($path, $recursive = false) {326 public function rmdir($path, $recursive = false) { 327 327 return $this->delete($path, $recursive); 328 328 } 329 329 330 function dirlist($path, $include_hidden = true, $recursive = false) {330 public function dirlist($path, $include_hidden = true, $recursive = false) { 331 331 if ( $this->is_file($path) ) { 332 332 $limit_file = basename($path);
Note: See TracChangeset
for help on using the changeset viewer.