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

Method metaRootForSource

src/FileRise/Storage/SourceContext.php:191–204  ·  view source on GitHub ↗
(array $src)

Source from the content-addressed store, hash-verified

189 }
190
191 private static function metaRootForSource(array $src): string
192 {
193 $base = rtrim((string)META_DIR, "/\\") . DIRECTORY_SEPARATOR;
194 if (!self::sourcesEnabled()) {
195 return $base;
196 }
197 $id = (string)($src['id'] ?? self::DEFAULT_ID);
198 $type = strtolower((string)($src['type'] ?? ''));
199 if ($id === self::DEFAULT_ID && $type === 'local') {
200 return $base;
201 }
202 $safeId = self::safeId($id);
203 return $base . self::META_SOURCES_DIR . DIRECTORY_SEPARATOR . $safeId . DIRECTORY_SEPARATOR;
204 }
205
206 public static function ensureMetaDir(): void
207 {

Callers 2

metaRootMethod · 0.95
metaRootForIdMethod · 0.95

Calls 2

sourcesEnabledMethod · 0.95
safeIdMethod · 0.95

Tested by

no test coverage detected