- Timestamp:
- 12/01/2014 12:12:05 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php
r29206 r30678 82 82 } 83 83 84 /** 85 * @param string $file 86 * @return bool|string 87 */ 84 88 public function get_contents( $file ) { 85 89 if ( ! $this->exists($file) ) … … 114 118 return $contents; 115 119 } 116 120 /** 121 * @param string $file 122 * @return array 123 */ 117 124 public function get_contents_array($file) { 118 125 return explode("\n", $this->get_contents($file) ); 119 126 } 120 127 128 /** 129 * @param string $file 130 * @param string $contents 131 * @param int|bool $mode 132 * @return bool 133 */ 121 134 public function put_contents($file, $contents, $mode = false ) { 122 135 $temp = wp_tempnam( $file ); … … 164 177 } 165 178 179 /** 180 * @param string $file 181 * @param bool $group 182 * @param bool $recursive 183 */ 166 184 public function chgrp($file, $group, $recursive = false ) { 167 185 return false; 168 186 } 169 187 188 /** 189 * @param string $file 190 * @param int|bool $mode 191 * @param bool $recursive 192 * @return bool 193 */ 170 194 public function chmod($file, $mode = false, $recursive = false ) { 171 195 if ( ! $mode ) { … … 189 213 } 190 214 215 /** 216 * @param string $file 217 * @return string 218 */ 191 219 public function owner($file) { 192 220 $dir = $this->dirlist($file); 193 221 return $dir[$file]['owner']; 194 222 } 195 223 /** 224 * @param string $file 225 * @return string 226 */ 196 227 public function getchmod($file) { 197 228 $dir = $this->dirlist($file); 198 229 return $dir[$file]['permsn']; 199 230 } 200 231 /** 232 * @param string $file 233 * @return string 234 */ 201 235 public function group($file) { 202 236 $dir = $this->dirlist($file); 203 237 return $dir[$file]['group']; 204 238 } 205 239 /** 240 * @param string $source 241 * @param string $destination 242 * @param bool $overwrite 243 * @param int|bool $mode 244 * @return bool 245 */ 206 246 public function copy($source, $destination, $overwrite = false, $mode = false) { 207 247 if ( ! $overwrite && $this->exists($destination) ) … … 214 254 return $this->put_contents($destination, $content, $mode); 215 255 } 216 256 /** 257 * @param string $source 258 * @param string $destination 259 * @param bool $overwrite 260 * @return bool 261 */ 217 262 public function move($source, $destination, $overwrite = false ) { 218 263 return $this->ftp->rename($source, $destination); 219 264 } 220 265 /** 266 * @param string $file 267 * @param bool $recursive 268 * @param string $type 269 * @return bool 270 */ 221 271 public function delete($file, $recursive = false, $type = false) { 222 272 if ( empty($file) ) … … 230 280 } 231 281 282 /** 283 * @param string $file 284 * @return bool 285 */ 232 286 public function exists( $file ) { 233 287 $list = $this->ftp->nlist( $file ); … … 236 290 } 237 291 292 /** 293 * @param string $file 294 * @return bool 295 */ 238 296 public function is_file($file) { 239 297 if ( $this->is_dir($file) ) … … 244 302 } 245 303 304 /** 305 * @param string $path 306 * @return bool 307 */ 246 308 public function is_dir($path) { 247 309 $cwd = $this->cwd(); … … 253 315 } 254 316 317 /** 318 * @param string $file 319 * @return bool 320 */ 255 321 public function is_readable($file) { 256 322 return true; 257 323 } 258 324 325 /** 326 * @param string $file 327 * @return bool 328 */ 259 329 public function is_writable($file) { 260 330 return true; 261 331 } 262 332 333 /** 334 * @param string $file 335 * @return bool 336 */ 263 337 public function atime($file) { 264 338 return false; 265 339 } 266 340 341 /** 342 * @param string $file 343 * @return int 344 */ 267 345 public function mtime($file) { 268 346 return $this->ftp->mdtm($file); 269 347 } 270 348 349 /** 350 * @param string $file 351 * @return int 352 */ 271 353 public function size($file) { 272 354 return $this->ftp->filesize($file); 273 355 } 274 356 /** 357 * @param string $file 358 * @param int $time 359 * @param int $atime 360 * @return bool 361 */ 275 362 public function touch($file, $time = 0, $atime = 0 ) { 276 363 return false; 277 364 } 278 365 366 /** 367 * @param string $path 368 * @param mixed $chmod 369 * @param mixed $chown 370 * @param mixed $chgrp 371 * @return bool 372 */ 279 373 public function mkdir($path, $chmod = false, $chown = false, $chgrp = false ) { 280 374 $path = untrailingslashit($path); … … 294 388 } 295 389 390 /** 391 * @param sting $path 392 * @param bool $recursive 393 */ 296 394 public function rmdir($path, $recursive = false ) { 297 395 $this->delete($path, $recursive); 298 396 } 299 397 398 /** 399 * @param string $path 400 * @param bool $include_hidden 401 * @param bool $recursive 402 * @return bool|array 403 */ 300 404 public function dirlist($path = '.', $include_hidden = true, $recursive = false ) { 301 405 if ( $this->is_file($path) ) {
Note: See TracChangeset
for help on using the changeset viewer.