Browse Source

add getPagePathsByPath method

main
ghost 9 months ago
parent
commit
d5b1f09dbb
  1. 12
      README.md
  2. 10
      src/Dokuwiki/Filesystem.php

12
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::getDirectoryPathByUri
#### Filesystem::getPagePathByUri #### Filesystem::getPagePathByUri

10
src/Dokuwiki/Filesystem.php

@ -32,6 +32,16 @@ class Filesystem
return $this->_list; 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 public function getPagePathByUri(string $uri): ?string
{ {
$path = sprintf( $path = sprintf(

Loading…
Cancel
Save