Lines Matching refs:WikiPath

19  * Dokuwiki knows only two drives ({@link WikiPath::MARKUP_DRIVE} and {@link WikiPath::MEDIA_DRIVE}
20 * but we have added a couple more such as the {@link WikiPath::COMBO_DRIVE combo resources}
21 * and the {@link WikiPath::CACHE_DRIVE} to be able to serve resources
28 class WikiPath extends PathAbs
58 * For now, there is only one value: {@link WikiPath::COMBO_DRIVE}
64 * combo resources directory ie {@link WikiPath::COMBO_DRIVE}
106 * The separator from the {@link WikiPath::getDrive()}
124 * that ends with the {@link WikiPath::NAMESPACE_SEPARATOR_DOUBLE_POINT} points to a start page
145 $path = WikiPath::getContextPath()->toAbsoluteId();
156 if ($drive === self::MARKUP_DRIVE && $firstCharacter !== WikiPath::NAMESPACE_SEPARATOR_DOUBLE_POINT) {
157 $parts = preg_split('/' . WikiPath::NAMESPACE_SEPARATOR_DOUBLE_POINT . '/', $path);
159 case WikiPath::CURRENT_PATH_CHARACTER:
168 $rootRelativePath = WikiPath::createMarkupPathFromPath(WikiPath::NAMESPACE_SEPARATOR_DOUBLE_POINT);
171 case WikiPath::CURRENT_PARENT_PATH_CHARACTER:
204 if ($isRelativeDirectoryPath && !WikiPath::isNamespacePath($absolutePathString)) {
205 $absolutePathString = $absolutePathString . WikiPath::NAMESPACE_SEPARATOR_DOUBLE_POINT;
240 WikiPath::addRootSeparatorIfNotPresent($this->absolutePath);
258 * @return WikiPath - the wiki path
261 public static function createMarkupPathFromPath(string $parameterPath, string $rev = null): WikiPath
268 if (WikiPath::isNamespacePath($parameterPath)) {
274 return new WikiPath($parameterPath, self::MARKUP_DRIVE, $rev);
323 $defaultWikiPath = new WikiPath($defaultPath, self::MARKUP_DRIVE, $rev);
336 $markupWikiPath = new WikiPath($parameterPath . '.' . $markupExtension, self::MARKUP_DRIVE, $rev);
352 static function createMediaPathFromPath($path, $rev = null): WikiPath
354 return new WikiPath($path, WikiPath::MEDIA_DRIVE, $rev);
365 * @return WikiPath
368 static function createFromUnknownRoot($id): WikiPath
370 return new WikiPath($id, WikiPath::UNKNOWN_DRIVE);
375 * @return WikiPath - a dokuwiki Id hello:my:lord
379 static function createFromUrl($url): WikiPath
405 $endSeparatorLocation = StringUtility::lastIndexOf($pathId, WikiPath::NAMESPACE_SEPARATOR_DOUBLE_POINT);
407 $endSeparatorLocation = StringUtility::lastIndexOf($pathId, WikiPath::NAMESPACE_SEPARATOR_SLASH);
428 return WikiPath::NAMESPACE_SEPARATOR_DOUBLE_POINT . $id;
449 static function createMediaPathFromId($id, $rev = null): WikiPath
451 WikiPath::addRootSeparatorIfNotPresent($id);
455 public static function getComboCustomThemeHomeDirectory(): WikiPath
457 return new WikiPath(self::NAMESPACE_SEPARATOR_DOUBLE_POINT, self::COMBO_DATA_THEME_DRIVE);
464 static function createFromUri(string $uri): WikiPath
490 $drive = WikiPath::MARKUP_DRIVE;
493 if (in_array($extension, WikiPath::ALL_MARKUP_EXTENSIONS)) {
494 $drive = WikiPath::MARKUP_DRIVE;
496 $drive = WikiPath::MEDIA_DRIVE;
503 return new WikiPath(":$path", $drive, $rev);
508 static function createMarkupPathFromId($id, $rev = null): WikiPath
511 return WikiPath::createFromUri($id);
513 WikiPath::addRootSeparatorIfNotPresent($id);
526 if (!in_array($firstCharacter, [WikiPath::NAMESPACE_SEPARATOR_DOUBLE_POINT, WikiPath::CURRENT_PATH_CHARACTER])) {
527 $path = WikiPath::NAMESPACE_SEPARATOR_DOUBLE_POINT . $path;
550 WikiPath::addRootSeparatorIfNotPresent($path);
557 static function createComboResource($stringPath): WikiPath
559 return new WikiPath($stringPath, self::COMBO_DRIVE);
567 * @return WikiPath
570 static function createWikiPath($path, $drive, string $rev = ''): WikiPath
572 return new WikiPath($path, $drive, $rev);
580 static function createExecutingMarkupWikiPath(): WikiPath
592 static function createRequestedPagePathFromRequest(): WikiPath
601 static function createFromPathObject(Path $path): WikiPath
603 if ($path instanceof WikiPath) {
609 $driveRoots = WikiPath::getDriveRoots();
633 WikiPath::addNamespaceEndSeparatorIfNotPresent($wikiId);
635 WikiPath::addRootSeparatorIfNotPresent($wikiId);
636 return WikiPath::createWikiPath($wikiId, $driveRoot);
670 * Also related {@link WikiPath::addNamespaceEndSeparatorIfNotPresent()}
678 if (substr($namespacePath, -1) !== WikiPath::NAMESPACE_SEPARATOR_DOUBLE_POINT) {
698 * See {@link WikiPath::isNamespacePath()} for more info
706 if (substr($namespaceAttribute, -1) !== WikiPath::NAMESPACE_SEPARATOR_DOUBLE_POINT) {
707 $namespaceAttribute = $namespaceAttribute . WikiPath::NAMESPACE_SEPARATOR_DOUBLE_POINT;
715 * @return WikiPath
718 static function createFromPath(string $path, string $drive, string $rev = null): WikiPath
720 return new WikiPath($path, $drive, $rev);
725 static function getContextPath(): WikiPath
740 * as an {@link WikiPath::getWikiId() id} is a validated absolute path without root character
745 return str_replace(WikiPath::NAMESPACE_SEPARATOR_SLASH, WikiPath::NAMESPACE_SEPARATOR_DOUBLE_POINT, $id);
749 static function createRootNamespacePathOnMarkupDrive(): WikiPath
751 return WikiPath::createMarkupPathFromPath(self::NAMESPACE_SEPARATOR_DOUBLE_POINT);
762 if ($id[0] === WikiPath::NAMESPACE_SEPARATOR_DOUBLE_POINT) {
939 * Otherwise everywhere in Dokuwiki, they use the {@link WikiPath::getWikiId()} absolute value that does not have any root separator
1024 return new WikiPath($this->absolutePath, $this->drive, $this->rev);
1031 * @return WikiPath
1044 return new WikiPath(WikiPath::NAMESPACE_SEPARATOR_DOUBLE_POINT, $this->drive, $this->rev);
1047 $path = implode(WikiPath::NAMESPACE_SEPARATOR_DOUBLE_POINT, $names);
1055 return new WikiPath($path, $this->drive, $this->rev);
1080 function resolve(string $name): WikiPath
1084 if ($this->absolutePath[strlen($this->absolutePath) - 1] !== WikiPath::NAMESPACE_SEPARATOR_DOUBLE_POINT) {
1085 $path = $this->absolutePath . WikiPath::NAMESPACE_SEPARATOR_DOUBLE_POINT . $name;
1089 return new WikiPath($path, $this->getDrive());
1117 function resolveId($markupId): WikiPath
1122 if (!WikiPath::isNamespacePath($this->absolutePath)) {
1131 return WikiPath::createMarkupPathFromId($contextId . $markupId);
1163 $localPath = WikiPath::getDriveRoots()[$this->drive];
1213 $baseDirectory = WikiPath::getDriveRoots()[$this->drive];