318
318
if ( isset($files[ $key ]) ){
320
// Lets try that folder:
320
// Let's try that folder:
321
321
$newdir = trailingslashit(path_join($base, $key));
322
322
if ( $this->verbose )
323
323
printf( "\n" . __('Changing to %s') . "<br/>\n", $newdir );
480
480
* Read entire file into a string.
484
484
* @param string $file Name of the file to read.
485
* @return string|bool Returns the read data or false on failure.
485
* @return mixed|bool Returns the read data or false on failure.
487
487
public function get_contents( $file ) {
504
504
* Write a string to a file.
508
508
* @param string $file Remote path to the file where to write the data.
509
509
* @param string $contents The data to write.
510
510
* @param int $mode Optional. The file permissions as octal number, usually 0644.
555
555
* Change filesystem permissions.
559
559
* @param string $file Path to the file.
560
560
* @param int $mode Optional. The permissions as octal number, usually 0644 for files, 0755 for dirs.
561
561
* @param bool $recursive Optional. If set True changes file group recursively. Defaults to False.
701
700
* Gets the file's last access time.
705
704
* @param string $file Path to file.
706
* @return int Unix timestamp representing last access time.
705
* @return int|bool Unix timestamp representing last access time.
708
707
public function atime( $file ) {
713
712
* Gets the file modification time.
717
716
* @param string $file Path to file.
718
* @return int Unix timestamp representing modification time.
717
* @return int|bool Unix timestamp representing modification time.
720
719
public function mtime( $file ) {
725
724
* Gets the file size (in bytes).
729
728
* @param string $file Path to file.
730
* @return int Size of the file in bytes.
729
* @return int|bool Size of the file in bytes.
732
731
public function size( $file ) {
796
796
* @return array|bool {
797
797
* Array of files. False if unable to list directory contents.
799
* @type string 'name' Name of the file/directory.
800
* @type string 'perms' *nix representation of permissions.
801
* @type int 'permsn' Octal representation of permissions.
802
* @type string 'owner' Owner name or ID.
803
* @type int 'size' Size of file in bytes.
804
* @type int 'lastmodunix' Last modified unix timestamp.
805
* @type mixed 'lastmod' Last modified month (3 letter) and day (without leading 0).
806
* @type int 'time' Last modified time.
807
* @type string 'type' Type of resource. 'f' for file, 'd' for directory.
808
* @type mixed 'files' If a directory and $recursive is true, contains another array of files.
799
* @type string $name Name of the file/directory.
800
* @type string $perms *nix representation of permissions.
801
* @type int $permsn Octal representation of permissions.
802
* @type string $owner Owner name or ID.
803
* @type int $size Size of file in bytes.
804
* @type int $lastmodunix Last modified unix timestamp.
805
* @type mixed $lastmod Last modified month (3 letter) and day (without leading 0).
806
* @type int $time Last modified time.
807
* @type string $type Type of resource. 'f' for file, 'd' for directory.
808
* @type mixed $files If a directory and $recursive is true, contains another array of files.
811
811
public function dirlist( $path, $include_hidden = true, $recursive = false ) {