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

Method getAdapter

src/FileRise/Storage/StorageRegistry.php:36–52  ·  view source on GitHub ↗
(?string $sourceId = null)

Source from the content-addressed store, hash-verified

34 }
35
36 public static function getAdapter(?string $sourceId = null): StorageAdapterInterface
37 {
38 if (self::$legacyAdapter !== null) {
39 if (!class_exists('SourceContext') || !SourceContext::sourcesEnabled()) {
40 return self::$legacyAdapter;
41 }
42 }
43
44 $sourceId = $sourceId ?? (class_exists('SourceContext') ? SourceContext::getActiveId() : 'local');
45 if (isset(self::$adapters[$sourceId])) {
46 return self::$adapters[$sourceId];
47 }
48
49 $adapter = StorageFactory::createAdapterForSource($sourceId);
50 self::$adapters[$sourceId] = $adapter;
51 return $adapter;
52 }
53}

Callers 15

configMethod · 0.80
callbackMethod · 0.80
signedDownloadMethod · 0.80
downloadSharedFileMethod · 0.80
downloadSharedFolderMethod · 0.80
shareFolderMethod · 0.80
saveFileMethod · 0.80
downloadFileMethod · 0.80
videoThumbnailMethod · 0.80
downloadZipMethod · 0.80
extractZipMethod · 0.80
snippetMethod · 0.80

Calls 3

getActiveIdMethod · 0.80
sourcesEnabledMethod · 0.45

Tested by

no test coverage detected