FilesystemManager

class FilesystemManager implements Factory (View source)

Properties

protected Application $app The application instance.
protected array $disks The array of resolved filesystem drivers.
protected array $customCreators The registered custom driver creators.

Methods

void __construct(Application $app)

Create a new filesystem manager instance.

Filesystem drive(string|null $name = null)

Get a filesystem instance.

Filesystem disk(string|null $name = null)

Get a filesystem instance.

Filesystem cloud()

Get a default cloud filesystem instance.

Filesystem get(string $name)

Attempt to get the disk from the local cache.

Filesystem resolve(string $name)

Resolve the given disk.

Filesystem callCustomCreator(array $config)

Call a custom driver creator.

Filesystem createLocalDriver(array $config)

Create an instance of the local driver.

Filesystem createFtpDriver(array $config)

Create an instance of the ftp driver.

Filesystem createSftpDriver(array $config)

Create an instance of the sftp driver.

Cloud createS3Driver(array $config)

Create an instance of the Amazon S3 driver.

array formatS3Config(array $config)

Format the given S3 configuration with the default options.

FilesystemInterface createFlysystem(AdapterInterface $adapter, array $config)

Create a Flysystem instance with the given adapter.

CacheInterface createCacheStore(mixed $config)

Create a cache store instance.

Filesystem adapt(FilesystemInterface $filesystem)

Adapt the filesystem implementation.

$this set(string $name, mixed $disk)

Set the given disk instance.

array getConfig(string $name)

Get the filesystem connection configuration.

string getDefaultDriver()

Get the default driver name.

string getDefaultCloudDriver()

Get the default cloud driver name.

$this forgetDisk(array|string $disk)

Unset the given disk instances.

$this extend(string $driver, Closure $callback)

Register a custom driver creator Closure.

mixed __call(string $method, array $parameters)

Dynamically call the default driver instance.

Details

void __construct(Application $app)

Create a new filesystem manager instance.

Parameters

Application $app

Return Value

void

Filesystem drive(string|null $name = null)

Get a filesystem instance.

Parameters

string|null $name

Return Value

Filesystem

Filesystem disk(string|null $name = null)

Get a filesystem instance.

Parameters

string|null $name

Return Value

Filesystem

Filesystem cloud()

Get a default cloud filesystem instance.

Return Value

Filesystem

protected Filesystem get(string $name)

Attempt to get the disk from the local cache.

Parameters

string $name

Return Value

Filesystem

protected Filesystem resolve(string $name)

Resolve the given disk.

Parameters

string $name

Return Value

Filesystem

Exceptions

InvalidArgumentException

protected Filesystem callCustomCreator(array $config)

Call a custom driver creator.

Parameters

array $config

Return Value

Filesystem

Filesystem createLocalDriver(array $config)

Create an instance of the local driver.

Parameters

array $config

Return Value

Filesystem

Filesystem createFtpDriver(array $config)

Create an instance of the ftp driver.

Parameters

array $config

Return Value

Filesystem

Filesystem createSftpDriver(array $config)

Create an instance of the sftp driver.

Parameters

array $config

Return Value

Filesystem

Cloud createS3Driver(array $config)

Create an instance of the Amazon S3 driver.

Parameters

array $config

Return Value

Cloud

protected array formatS3Config(array $config)

Format the given S3 configuration with the default options.

Parameters

array $config

Return Value

array

protected FilesystemInterface createFlysystem(AdapterInterface $adapter, array $config)

Create a Flysystem instance with the given adapter.

Parameters

AdapterInterface $adapter
array $config

Return Value

FilesystemInterface

protected CacheInterface createCacheStore(mixed $config)

Create a cache store instance.

Parameters

mixed $config

Return Value

CacheInterface

Exceptions

InvalidArgumentException

protected Filesystem adapt(FilesystemInterface $filesystem)

Adapt the filesystem implementation.

Parameters

FilesystemInterface $filesystem

Return Value

Filesystem

$this set(string $name, mixed $disk)

Set the given disk instance.

Parameters

string $name
mixed $disk

Return Value

$this

protected array getConfig(string $name)

Get the filesystem connection configuration.

Parameters

string $name

Return Value

array

string getDefaultDriver()

Get the default driver name.

Return Value

string

string getDefaultCloudDriver()

Get the default cloud driver name.

Return Value

string

$this forgetDisk(array|string $disk)

Unset the given disk instances.

Parameters

array|string $disk

Return Value

$this

$this extend(string $driver, Closure $callback)

Register a custom driver creator Closure.

Parameters

string $driver
Closure $callback

Return Value

$this

mixed __call(string $method, array $parameters)

Dynamically call the default driver instance.

Parameters

string $method
array $parameters

Return Value

mixed

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/7.x/Illuminate/Filesystem/FilesystemManager.html