Lines Matching defs:path

15     static function exists(Path $path): bool
17 $scheme = $path->getScheme();
20 return LocalFileSystem::getOrCreate()->exists($path);
22 return WikiFileSystem::getOrCreate()->exists($path);
24 return MarkupFileSystem::getOrCreate()->exists($path);
33 public static function getContent(Path $path): string
35 $scheme = $path->getScheme();
38 return LocalFileSystem::getOrCreate()->getContent($path);
40 return WikiFileSystem::getOrCreate()->getContent($path);
48 public static function getModifiedTime(Path $path): \DateTime
50 $scheme = $path->getScheme();
54 return LocalFileSystem::getOrCreate()->getModifiedTime($path);
56 return WikiFileSystem::getOrCreate()->getModifiedTime($path);
66 public static function getCreationTime(Path $path)
68 $scheme = $path->getScheme();
71 return LocalFileSystem::getOrCreate()->getCreationTime($path);
73 return WikiFileSystem::getOrCreate()->getCreationTime($path);
80 public static function deleteIfExists(Path $path)
82 if (FileSystems::exists($path)) {
83 FileSystems::delete($path);
90 public static function delete(Path $path)
92 $scheme = $path->getScheme();
95 LocalFileSystem::getOrCreate()->delete($path);
98 WikiFileSystem::getOrCreate()->delete($path);
101 MarkupFileSystem::getOrCreate()->delete($path);
108 public static function getSize(Path $path)
111 $scheme = $path->getScheme();
114 return LocalFileSystem::getOrCreate()->getSize($path);
116 return WikiFileSystem::getOrCreate()->getSize($path);
139 public static function isDirectory(Path $path): bool
141 $scheme = $path->getScheme();
144 return LocalFileSystem::getOrCreate()->isDirectory($path);
146 return WikiFileSystem::getOrCreate()->isDirectory($path);
156 public static function getChildren(Path $path, string $type = null): array
158 $scheme = $path->getScheme();
161 return LocalFileSystem::getOrCreate()->getChildren($path, $type);
163 return WikiFileSystem::getOrCreate()->getChildren($path, $type);
165 return MarkupFileSystem::getOrCreate()->getChildren($path, $type);
189 // as we path the type, it should not happen
197 * Utility function to calculate a buster based on a path for the implementation of {@link FetchAbstract::getBuster()}
199 public static function getCacheBuster(Path $path): string
201 $time = FileSystems::getModifiedTime($path);
208 public static function closest(Path $path, string $name): Path
210 $scheme = $path->getScheme();
213 return LocalFileSystem::getOrCreate()->closest($path, $name);
215 return WikiFileSystem::getOrCreate()->closest($path, $name);
221 public static function createRegularFile(Path $path)
223 $scheme = $path->getScheme();
226 LocalFileSystem::getOrCreate()->createRegularFile($path);
229 WikiFileSystem::getOrCreate()->createRegularFile($path);
239 public static function getMime(Path $path): Mime
241 $extension = $path->getExtension();
245 $mime = mimetype($path->getLastName(), true)[1];
247 throw new ExceptionNotFound("No mime found for path ($path). The mime type of the media is <a href=\"https://www.dokuwiki.org/mime\">unknown (not in the configuration file)</a>");
253 public static function setContent(Path $path, string $content)
255 $scheme = $path->getScheme();
258 LocalFileSystem::getOrCreate()->setContent($path, $content);
261 WikiFileSystem::getOrCreate()->setContent($path, $content);
264 MarkupFileSystem::getOrCreate()->setContent($path, $content);
279 foreach ($paths as $path) {
280 if (FileSystems::exists($path)) {
281 return $path;
288 public static function getTree(Path $path): PathTreeNode
290 return PathTreeNode::buildTreeViaFileSystemChildren($path);
294 * @throws ExceptionBadArgument - if they are not local path
326 public static function clearStatCache(Path $path)
329 $pathString = $path->toLocalPath()->toCanonicalAbsolutePath()->toAbsoluteId();
332 throw new ExceptionRuntimeInternal("The cache can be clear only for local path");