(array $src)
| 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 | { |
no test coverage detected