ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
Ftpd.php
Go to the documentation of this file.
1<?php
2
4
5class 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}
An exception for terminatinating execution or to throw for unit testing.
normalizeListing(array $listing, $prefix='')
Normalize a directory listing.
normalizeObject($item, $base)
Normalize a file entry.
listDirectoryContents($directory, $recursive=true)
Definition: Ftpd.php:26
getMetadata($path)
Get all the meta data of a file or directory.array|false
Definition: Ftpd.php:10