Skip to content

FilesystemDriverRegistry

Process-global registry mapping short driver aliases (e.g.

“local”, “s3”) to the FilesystemAdapterInterface class that implements them. Mirrors QueueDriverRegistry exactly.

Only local ships in core. Cloud backends register their own alias from their own plugin (e.g. quioteframework/filesystem-s3’s S3FilesystemPlugin).

final class FilesystemDriverRegistry

SourceFilesystemDriverRegistry.php
MethodDescription
aliases(): array<string, class-string<FilesystemAdapterInterface>>
has(string $alias): boolWhether $alias has been registered as a driver alias.
instantiateClassFor(string $aliasOrClass): stringResolves an alias (or a fully-qualified class name) to the adapter class to instantiate.
register(string $alias, class-string<FilesystemAdapterInterface> $driverClass): void
reset(): voidTest isolation: restore the built-in alias only.
resolve(string $aliasOrClass): stringA string that is not a registered alias is returned unchanged, so a fully-qualified class name passes through.

public static function aliases(): array<string, class-string<FilesystemAdapterInterface>>

Returns array``<``string``, ``class-string``<FilesystemAdapterInterface>``>

public static function has(string $alias): bool

Whether $alias has been registered as a driver alias.

Fully-qualified class names are not aliases, so this is false for them.

ParameterTypeDescription
$aliasstring

Returns bool

public static function instantiateClassFor(string $aliasOrClass): string

Resolves an alias (or a fully-qualified class name) to the adapter class to instantiate.

Returns the class name only; it does not construct anything. The message distinguishes a registered alias whose class is missing — the package is not installed — from a name that was never registered at all.

ParameterTypeDescription
$aliasOrClassstring

Returns string

ThrowsWhen
RuntimeExceptionwhen the resolved class does not exist, or does not implement FilesystemAdapterInterface

public static function register(string $alias, class-string<FilesystemAdapterInterface> $driverClass): void

ParameterTypeDescription
$aliasstring
$driverClassclass-string``<FilesystemAdapterInterface>

public static function reset(): void

Test isolation: restore the built-in alias only.

public static function resolve(string $aliasOrClass): string

A string that is not a registered alias is returned unchanged, so a fully-qualified class name passes through.

ParameterTypeDescription
$aliasOrClassstring

Returns string