diff --git a/README.md b/README.md index 7419e44..dfff35d 100644 --- a/README.md +++ b/README.md @@ -136,6 +136,18 @@ var_dump ( ) ``` +#### Filesystem::getPagePathsByPath + +Return pages under the given data directory + +``` +var_dump ( + $filesystem->getPagePathsByPath( + // absolute path to target data directory (e.g. Filesystem::getDirectoryPathByUri) + ) +) +``` + #### Filesystem::getDirectoryPathByUri #### Filesystem::getPagePathByUri diff --git a/src/Dokuwiki/Filesystem.php b/src/Dokuwiki/Filesystem.php index 1f02170..407684a 100644 --- a/src/Dokuwiki/Filesystem.php +++ b/src/Dokuwiki/Filesystem.php @@ -32,6 +32,16 @@ class Filesystem return $this->_list; } + public function getPagePathsByPath(string $path): ?array + { + if (isset($this->_tree[$path])) + { + return $this->_tree[$path]; + } + + return null; + } + public function getPagePathByUri(string $uri): ?string { $path = sprintf(