@ -136,6 +136,7 @@ var_dump (
)
```
#### Filesystem::getDirectoryPathByUri
#### Filesystem::getPagePathByUri
Return absolute path to stored page file
@ -148,6 +149,7 @@ var_dump (
#### Filesystem::getDirectoryUriByPath
#### Filesystem::getPageUriByPath
Return page URI in `dokuwiki:format`
@ -68,7 +68,7 @@ class Filesystem
'%s/pages/',
$this->_path
),
null,
'',
$path
);
@ -93,9 +93,68 @@ class Filesystem
return urlencode(
return $path;
}
public function getDirectoryPathByUri(string $uri = ''): ?string
{
$path = rtrim(
sprintf(
'%s/pages/%s',
$this->_path,
str_replace(
':',
'/',
mb_strtolower(
urldecode(
$uri
'/'
if (!isset($this->_tree[$path]) || !is_dir($path) || !is_readable($path))
return null;
public function getDirectoryUriByPath(string $path): ?string
$path = str_replace(
$path = trim(
$path,
[
],
':'
private function _index(string $path): void