(string $path)
| 110 | } |
| 111 | |
| 112 | public function list(string $path): array |
| 113 | { |
| 114 | $props = $this->propFind($path, 1); |
| 115 | if (!$props) { |
| 116 | return []; |
| 117 | } |
| 118 | $parentRel = trim($this->relativePath($path), '/'); |
| 119 | $items = []; |
| 120 | $children = []; |
| 121 | foreach ($props as $href => $prop) { |
| 122 | $rel = trim($this->hrefToRelative((string)$href), '/'); |
| 123 | if ($rel === '' || $rel === $parentRel) { |
| 124 | continue; |
| 125 | } |
| 126 | $name = basename($rel); |
| 127 | if ($name === '' || $name === '.' || $name === '..') { |
| 128 | continue; |
| 129 | } |
| 130 | $items[] = $name; |
| 131 | $children[$name] = $this->propsToStat($prop); |
| 132 | } |
| 133 | $this->storeListCache($parentRel, $children); |
| 134 | return array_values(array_unique($items)); |
| 135 | } |
| 136 | |
| 137 | public function stat(string $path): ?array |
| 138 | { |
no test coverage detected