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

Method getPublicConfig

src/FileRise/Storage/SourcesConfig.php:289–311  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

287 }
288
289 public static function getPublicConfig(): array
290 {
291 if (self::proSourcesAvailable()) {
292 return self::withCapabilities(ProSources::getPublicConfig());
293 }
294
295 $cfg = self::coreConfigFromRaw(self::loadRaw());
296 $out = [
297 'enabled' => !empty($cfg['enabled']),
298 'sources' => [],
299 ];
300
301 foreach ($cfg['sources'] as $src) {
302 if (empty($src['enabled'])) {
303 continue;
304 }
305 $view = self::buildSourceView($src, false, false);
306 unset($view['config']);
307 $out['sources'][] = $view;
308 }
309
310 return self::withCapabilities($out);
311 }
312
313 public static function getAdminList(): array
314 {

Callers 2

visibleSourcesMethod · 0.80
buildPublicSubsetMethod · 0.80

Calls 5

proSourcesAvailableMethod · 0.95
withCapabilitiesMethod · 0.95
coreConfigFromRawMethod · 0.95
loadRawMethod · 0.95
buildSourceViewMethod · 0.95

Tested by

no test coverage detected