PluginProbe
WPIDE – File Manager & Code Editor / 3.5.9
WPIDE – File Manager & Code Editor v3.5.9
3.5.9 3.5.8 3.5.7 2.0.14 2.0.15 2.0.16 2.0.2 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1 2.2 2.3 2.3.1 2.3.2 2.4.0 2.5 2.6 3.0 3.1 3.2 3.3 All 55 releases
wpide / vendor / league / flysystem / src / Adapter / Ftpd.php

Ftpd.php in WPIDE – File Manager & Code Editor 3.5.9, at vendor/league/flysystem/src/Adapter/Ftpd.php

49 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace League\Flysystem\Adapter;
4
5 class Ftpd extends Ftp
6 {
7 /**
8 * @inheritdoc
9 */
10 public function getMetadata($path)
11 {
12 if ($path === '') {
13 return ['type' => 'dir', 'path' => ''];
14 }
15
16 if (@ftp_chdir($this->getConnection(), $path) === true) {
17 $this->setConnectionRoot();
18
19 return ['type' => 'dir', 'path' => $path];
20 }
21
22 $object = ftp_raw($this->getConnection(), 'STAT ' . $this->escapePath($path));
23
24 if ( ! $object || count($object) < 3) {
25 return false;
26 }
27
28 if (substr($object[1], 0, 5) === "ftpd:") {
29 return false;
30 }
31
32 return $this->normalizeObject($object[1], '');
33 }
34
35 /**
36 * @inheritdoc
37 */
38 protected function listDirectoryContents($directory, $recursive = true)
39 {
40 $listing = ftp_rawlist($this->getConnection(), $this->escapePath($directory), $recursive);
41
42 if ($listing === false || ( ! empty($listing) && substr($listing[0], 0, 5) === "ftpd:")) {
43 return [];
44 }
45
46 return $this->normalizeListing($listing, $directory);
47 }
48 }
49