Lines Matching refs:path
28 function exists(Path $path): bool argument
30 return file_exists($path->toAbsolutePath()->toAbsoluteId());
38 public function getContent($path): string argument
44 $mime = FileSystems::getMime($path);
46 …LogUtility::error("This mime content ($mime) is not text based (for the path $path). We can't retu…
50 …LogUtility::error("The mime is unknown for the path ($path). Trying to returning the content as te…
52 $content = @file_get_contents($path->toAbsolutePath()->toAbsoluteId());
55 throw new ExceptionNotFound("The file ($path) does not exists");
61 * @param LocalPath $path
65 public function getModifiedTime($path): DateTime argument
67 if (!self::exists($path)) {
68 … throw new ExceptionNotFound("Local File System Modified Time: The file ($path) does not exist");
70 $timestamp = filemtime($path->toCanonicalAbsolutePath()->toAbsoluteId());
77 public function getCreationTime(Path $path) argument
79 if (!$this->exists($path)) {
80 throw new ExceptionNotFound("The path ($path) does not exists, no creation time");
82 $filePath = $path->toAbsolutePath()->toAbsoluteId();
90 public function delete(Path $path) argument
92 $absolutePath = $path->toAbsolutePath()->toAbsoluteId();
103 public function getSize(Path $path) argument
105 return filesize($path->toAbsolutePath()->toAbsoluteId());
120 public function isDirectory(Path $path): bool argument
122 return is_dir($path->toAbsolutePath());
126 * @param LocalPath $path
130 public function getChildren(Path $path, string $type = null): array argument
137 $directoryHandle = @opendir($path->toAbsolutePath());
145 $childPath = $path->resolve($fileName);
181 * @param LocalPath $path
186 public function closest(Path $path, string $lastFullName): Path argument
188 if (FileSystems::isDirectory($path)) {
189 $closest = $path->resolve($lastFullName);
194 $parent = $path;
206 … ExceptionNotFound("No closest was found for the file name ($lastFullName) from the path ($path)");
210 * @param LocalPath $path
213 public function createRegularFile(Path $path) argument
215 touch($path->toAbsoluteId());
218 public function setContent(Path $path, string $content) argument
221 $file = $path->toAbsoluteId();