mirror of
https://github.com/YGGverse/gemini-php.git
synced 2026-03-31 17:05:29 +00:00
add getPagePathsByPath method
This commit is contained in:
parent
30e55ac8d5
commit
d5b1f09dbb
2 changed files with 22 additions and 0 deletions
12
README.md
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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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…
Add table
Add a link
Reference in a new issue