MCPcopy Create free account
hub / github.com/error311/FileRise / path

Method path

src/FileRise/Support/MetadataPath.php:18–38  ·  view source on GitHub ↗
(string $metaRoot, string $folder)

Source from the content-addressed store, hash-verified

16 }
17
18 public static function path(string $metaRoot, string $folder): string
19 {
20 $metaRoot = rtrim($metaRoot, '/\\') . DIRECTORY_SEPARATOR;
21 $folder = self::folderKey($folder);
22
23 if ($folder === 'root') {
24 return $metaRoot . self::ROOT_FILE;
25 }
26
27 $legacyPath = $metaRoot . self::legacyFileName($folder);
28 if (!self::isCollisionSensitive($folder)) {
29 return $legacyPath;
30 }
31
32 $encodedPath = $metaRoot . self::encodedFileName($folder);
33 if (!is_file($encodedPath) && is_file($legacyPath)) {
34 self::copyLegacyMetadata($legacyPath, $encodedPath);
35 }
36
37 return $encodedPath;
38 }
39
40 public static function encodedFileName(string $folder): string
41 {

Callers

nothing calls this directly

Calls 5

folderKeyMethod · 0.95
legacyFileNameMethod · 0.95
isCollisionSensitiveMethod · 0.95
encodedFileNameMethod · 0.95
copyLegacyMetadataMethod · 0.95

Tested by

no test coverage detected