ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Ftpd.php
Go to the documentation of this file.
1 <?php
2 
4 
5 class Ftpd extends Ftp
6 {
10  public function getMetadata($path)
11  {
12  if (empty($path) || ! ($object = ftp_raw($this->getConnection(), 'STAT ' . $path)) || count($object) < 3) {
13  return false;
14  }
15 
16  if (substr($object[1], 0, 5) === "ftpd:") {
17  return false;
18  }
19 
20  return $this->normalizeObject($object[1], '');
21  }
22 
26  protected function listDirectoryContents($directory, $recursive = true)
27  {
28  $listing = ftp_rawlist($this->getConnection(), $directory, $recursive);
29 
30  if ($listing === false || ( ! empty($listing) && substr($listing[0], 0, 5) === "ftpd:")) {
31  return [];
32  }
33 
34  return $this->normalizeListing($listing, $directory);
35  }
36 }
$path
Definition: aliased.php:25
normalizeObject($item, $base)
Normalize a file entry.
getMetadata($path)
Get all the meta data of a file or directory.array|false
Definition: Ftpd.php:10
normalizeListing(array $listing, $prefix='')
Normalize a directory listing.
listDirectoryContents($directory, $recursive=true)
Definition: Ftpd.php:26