Download the PHP package bayfrontmedia/multi-filesystem without Composer
On this page you can find all versions of the php package bayfrontmedia/multi-filesystem. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bayfrontmedia/multi-filesystem
More information about bayfrontmedia/multi-filesystem
Files in bayfrontmedia/multi-filesystem
Package multi-filesystem
Short Description An easy-to-use library used to manage multiple Flysystem adapters from a single class.
License MIT
Homepage https://github.com/bayfrontmedia/multi-filesystem
Informations about the package multi-filesystem
Multi-Filesystem
An easy-to-use library used to manage multiple Flysystem adapters from a single class.
- License
- Author
- Requirements
- Installation
- Usage
License
This project is open source and available under the MIT License.
Author
Requirements
- PHP
^8.0
(Tested up to8.4
)
Installation
Usage
NOTE: All exceptions thrown by Multi-Filesystem extend Bayfront\MultiFilesytstem\Exceptions\MultiFilesystemException
, so you can choose to catch exceptions as narrowly or broadly as you like.
A disk name and a League\Flysystem\Filesystem
instance must be passed to the constructor, and will automatically be set as the default disk.
To aid in consistency when referencing disks, the Bayfront\MultiFilesystem\DiskName
class contains constants for each of the supported Flysystem adapters.
Example:
Public methods
- getNames
- getDefaultName
- add
- exists
- get
getNames
Description:
Return array of disk names.
Parameters:
- (None)
Returns:
- (array)
getDefaultName
Description:
Return name of default disk.
Parameters:
- (None)
Returns:
- (string)
add
Description:
Add a League\Flysystem\Filesystem
instance as a new disk.
If a disk exists with the same name, it will be overwritten.
Parameters:
$name
(string): Name of disk$filesystem
(object):League\Flysystem\Filesystem
object
Returns:
- (self)
Example:
exists
Description:
Does disk name exist?
Parameters:
$disk
(string)
Returns:
- (bool)
Example:
get
Description:
Returns League\Flysystem\Filesystem
instance for a given disk.
Parameters:
$disk = ''
(string): Name of disk to return. If empty string, the default disk will be returned.
Returns:
- (object):
League\Flysystem\Filesystem
object
Throws:
Bayfront\MultiFilesystem\Exceptions\DiskNotFoundException
Example: