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

Method uploadRootForSource

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

Source from the content-addressed store, hash-verified

155 }
156
157 private static function uploadRootForSource(array $src): string
158 {
159 $type = strtolower((string)($src['type'] ?? 'local'));
160 $cfg = is_array($src['config'] ?? null) ? $src['config'] : [];
161
162 if ($type === 'local') {
163 $path = (string)($cfg['path'] ?? '');
164 if ($path !== '') {
165 return rtrim($path, "/\\") . DIRECTORY_SEPARATOR;
166 }
167 }
168
169 return rtrim((string)UPLOAD_DIR, "/\\") . DIRECTORY_SEPARATOR;
170 }
171
172 public static function trashRoot(): string
173 {

Callers 2

uploadRootMethod · 0.95
uploadRootForIdMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected