| | 336 | |
| | 337 | /** |
| | 338 | * Change the ownership of a file / folder. |
| | 339 | * Default behavior is to do nothing, override this in your subclass, if desired |
| | 340 | * @param string $file Path to the file. |
| | 341 | * @param mixed $owner A user name or number. |
| | 342 | * @param bool $recursive (optional) If set True changes file owner recursivly. Defaults to False. |
| | 343 | * @return bool Returns true on success or false on failure. |
| | 344 | */ |
| | 345 | function chown($file, $owner, $recursive = false ) { |
| | 346 | return false; |
| | 347 | } |
| | 348 | |
| | 349 | /** |
| | 350 | * connect filesystem. |
| | 351 | * |
| | 352 | * @return bool Returns true on success or false on failure (always true for WP_Filesystem_Direct). |
| | 353 | */ |
| | 354 | function connect() { |
| | 355 | return true; |
| | 356 | } |
| | 357 | |
| | 358 | /** |
| | 359 | * Reads entire file into a string |
| | 360 | * |
| | 361 | * @param string $file Name of the file to read. |
| | 362 | * @return string|bool The function returns the read data or false on failure. |
| | 363 | */ |
| | 364 | function get_contents($file) { |
| | 365 | return false; |
| | 366 | } |
| | 367 | |
| | 368 | /** |
| | 369 | * Reads entire file into an array |
| | 370 | * |
| | 371 | * @param string $file Path to the file. |
| | 372 | * @return array|bool the file contents in an array or false on failure. |
| | 373 | */ |
| | 374 | function get_contents_array($file) { |
| | 375 | return false; |
| | 376 | } |
| | 377 | |
| | 378 | /** |
| | 379 | * Write a string to a file |
| | 380 | * |
| | 381 | * @param string $file Remote path to the file where to write the data. |
| | 382 | * @param string $contents The data to write. |
| | 383 | * @param int $mode (optional) The file permissions as octal number, usually 0644. |
| | 384 | * @return bool False upon failure. |
| | 385 | */ |
| | 386 | function put_contents($file, $contents, $mode = false ) { |
| | 387 | return false; |
| | 388 | } |
| | 389 | |
| | 390 | /** |
| | 391 | * Gets the current working directory |
| | 392 | * |
| | 393 | * @return string|bool the current working directory on success, or false on failure. |
| | 394 | */ |
| | 395 | function cwd() { |
| | 396 | return false; |
| | 397 | } |
| | 398 | |
| | 399 | /** |
| | 400 | * Change directory |
| | 401 | * |
| | 402 | * @param string $dir The new current directory. |
| | 403 | * @return bool Returns true on success or false on failure. |
| | 404 | */ |
| | 405 | function chdir($dir) { |
| | 406 | return false; |
| | 407 | } |
| | 408 | |
| | 409 | /** |
| | 410 | * Changes file group |
| | 411 | * |
| | 412 | * @param string $file Path to the file. |
| | 413 | * @param mixed $group A group name or number. |
| | 414 | * @param bool $recursive (optional) If set True changes file group recursivly. Defaults to False. |
| | 415 | * @return bool Returns true on success or false on failure. |
| | 416 | */ |
| | 417 | function chgrp($file, $group, $recursive = false) { |
| | 418 | return false; |
| | 419 | } |
| | 420 | |
| | 421 | /** |
| | 422 | * Changes filesystem permissions |
| | 423 | * |
| | 424 | * @param string $file Path to the file. |
| | 425 | * @param int $mode (optional) The permissions as octal number, usually 0644 for files, 0755 for dirs. |
| | 426 | * @param bool $recursive (optional) If set True changes file group recursivly. Defaults to False. |
| | 427 | * @return bool Returns true on success or false on failure. |
| | 428 | */ |
| | 429 | function chmod($file, $mode = false, $recursive = false) { |
| | 430 | return false; |
| | 431 | } |
| | 432 | |
| | 433 | /** |
| | 434 | * Gets file owner |
| | 435 | * |
| | 436 | * @param string $file Path to the file. |
| | 437 | * @return string|bool Username of the user or false on error. |
| | 438 | */ |
| | 439 | function owner($file) { |
| | 440 | return false; |
| | 441 | } |
| | 442 | |
| | 443 | /** |
| | 444 | * Gets file's group |
| | 445 | * |
| | 446 | * @param string $file |
| | 447 | * @return string|bool |
| | 448 | */ |
| | 449 | function group($file) { |
| | 450 | return false; |
| | 451 | } |
| | 452 | |
| | 453 | /** |
| | 454 | * Copy a file |
| | 455 | * |
| | 456 | * @param string $source |
| | 457 | * @param string $destination |
| | 458 | * @param bool $overwrite |
| | 459 | * @param int $mode |
| | 460 | * @return bool |
| | 461 | */ |
| | 462 | function copy($source, $destination, $overwrite = false, $mode = false) { |
| | 463 | return false; |
| | 464 | } |
| | 465 | |
| | 466 | /** |
| | 467 | * Move a file |
| | 468 | * |
| | 469 | * @param string $source |
| | 470 | * @param string $destination |
| | 471 | * @param bool $overwrite |
| | 472 | * @return bool |
| | 473 | */ |
| | 474 | function move($source, $destination, $overwrite = false) { |
| | 475 | return false; |
| | 476 | } |
| | 477 | |
| | 478 | /** |
| | 479 | * Delete a file / directory |
| | 480 | * |
| | 481 | * @param string $file |
| | 482 | * @param bool $recursive |
| | 483 | * @param type $type (f = file, other values = directory) |
| | 484 | * @return bool |
| | 485 | */ |
| | 486 | function delete($file, $recursive = false, $type = false) { |
| | 487 | return false; |
| | 488 | } |
| | 489 | |
| | 490 | /** |
| | 491 | * Check if a file exists |
| | 492 | * |
| | 493 | * @param string $file |
| | 494 | * @return bool |
| | 495 | */ |
| | 496 | function exists($file) { |
| | 497 | return false; |
| | 498 | } |
| | 499 | |
| | 500 | /** |
| | 501 | * Check if a file is a regular file |
| | 502 | * |
| | 503 | * @param string $file |
| | 504 | * @return bool |
| | 505 | */ |
| | 506 | function is_file($file) { |
| | 507 | return false; |
| | 508 | } |
| | 509 | |
| | 510 | /** |
| | 511 | * Check if a path is a directory |
| | 512 | * |
| | 513 | * @param string $path |
| | 514 | * @return bool |
| | 515 | */ |
| | 516 | function is_dir($path) { |
| | 517 | return false; |
| | 518 | } |
| | 519 | |
| | 520 | /** |
| | 521 | * Check if a file is readable |
| | 522 | * |
| | 523 | * @param string $file |
| | 524 | * @return bool |
| | 525 | */ |
| | 526 | function is_readable($file) { |
| | 527 | return false; |
| | 528 | } |
| | 529 | |
| | 530 | /** |
| | 531 | * Check if a file is writable |
| | 532 | * |
| | 533 | * @param string $file |
| | 534 | * @return bool |
| | 535 | */ |
| | 536 | function is_writable($file) { |
| | 537 | return false; |
| | 538 | } |
| | 539 | |
| | 540 | /** |
| | 541 | * Get a file's last access time |
| | 542 | * |
| | 543 | * @param string $file |
| | 544 | * @return int|bool |
| | 545 | */ |
| | 546 | function atime($file) { |
| | 547 | return false; |
| | 548 | } |
| | 549 | |
| | 550 | /** |
| | 551 | * Get a file's last modified time |
| | 552 | * |
| | 553 | * @param string $file |
| | 554 | * @return int|bool |
| | 555 | */ |
| | 556 | function mtime($file) { |
| | 557 | return false; |
| | 558 | } |
| | 559 | |
| | 560 | /** |
| | 561 | * Get a file's size |
| | 562 | * |
| | 563 | * @param string $file |
| | 564 | * @return int|bool |
| | 565 | */ |
| | 566 | function size($file) { |
| | 567 | return false; |
| | 568 | } |
| | 569 | |
| | 570 | /** |
| | 571 | * Update a file's access time and modified time |
| | 572 | * |
| | 573 | * @param string $file |
| | 574 | * @param int $time |
| | 575 | * @param int $atime |
| | 576 | * @return bool |
| | 577 | */ |
| | 578 | function touch($file, $time = 0, $atime = 0) { |
| | 579 | return false; |
| | 580 | } |
| | 581 | |
| | 582 | /** |
| | 583 | * Create a directory |
| | 584 | * |
| | 585 | * @param string $path |
| | 586 | * @param string|int|false $chmod |
| | 587 | * @param string|int|false $chown |
| | 588 | * @param string|int|false $chgrp |
| | 589 | * @return bool |
| | 590 | */ |
| | 591 | function mkdir($path, $chmod = false, $chown = false, $chgrp = false) { |
| | 592 | return false; |
| | 593 | } |
| | 594 | |
| | 595 | /** |
| | 596 | * Delete a directory |
| | 597 | * |
| | 598 | * @param string$path |
| | 599 | * @param bool $recursive |
| | 600 | * @return bool |
| | 601 | */ |
| | 602 | function rmdir($path, $recursive = false) { |
| | 603 | return false; |
| | 604 | } |
| | 605 | |
| | 606 | /** |
| | 607 | * Get a recursive directory listing |
| | 608 | * |
| | 609 | * @param string $path |
| | 610 | * @param bool $include_hidden |
| | 611 | * @param bool $recursive |
| | 612 | * @return array|bool |
| | 613 | */ |
| | 614 | function dirlist($path, $include_hidden = true, $recursive = false) { |
| | 615 | return false; |
| | 616 | } |