getTimestamp($path); $metadata['timestamp'] = $data !== false && isset($data['timestamp']) ? $data['timestamp'] : null; } return $metadata; } /** * @inheritdoc */ protected function normalizeListing(array $listing, $prefix = '') { $result = parent::normalizeListing($listing, $prefix); foreach ($result as &$item) { if ($item['type'] === 'dir') { $item['timestamp'] = null; // ftp_mdtm() does not work with directories. continue; } if (!isset($item['timestamp'])) { $data = $this->getTimestamp($item['path']); $item['timestamp'] = $data !== false && isset($data['timestamp']) ? $data['timestamp'] : null; } } return $result; } }