Properties

$plugins

$plugins : array

Type

array

$adapter

$adapter : \League\Flysystem\AdapterInterface

Type

AdapterInterface

Methods

addPlugin()

addPlugin(\League\Flysystem\PluginInterface  $plugin) : $this

Register a plugin.

Parameters

\League\Flysystem\PluginInterface $plugin

Throws

\LogicException

Returns

$this —

__call()

__call(string  $method, array  $arguments) : mixed

Plugins pass-through.

Parameters

string $method
array $arguments

Throws

\BadMethodCallException

Returns

mixed —

__construct()

__construct(\League\Flysystem\AdapterInterface  $adapter, \League\Flysystem\Config|array  $config = null) : mixed

Constructor.

Parameters

\League\Flysystem\AdapterInterface $adapter
\League\Flysystem\Config|array $config

Returns

mixed —

getAdapter()

getAdapter() : \League\Flysystem\AdapterInterface

Get the Adapter.

Returns

\League\Flysystem\AdapterInterface —

adapter

has()

has(mixed  $path) : bool

Check whether a file exists.

Parameters

mixed $path

Returns

bool —

write()

write(mixed  $path, mixed  $contents, array  $config = []) : bool

Write a new file.

Parameters

mixed $path

The path of the new file.

mixed $contents

The file contents.

array $config

An optional configuration array.

Returns

bool —

True on success, false on failure.

writeStream()

writeStream(mixed  $path, mixed  $resource, array  $config = []) : bool

Write a new file using a stream.

Parameters

mixed $path

The path of the new file.

mixed $resource

The file handle.

array $config

An optional configuration array.

Returns

bool —

True on success, false on failure.

put()

put(mixed  $path, mixed  $contents, array  $config = []) : bool

Create a file or update if exists.

Parameters

mixed $path

The path to the file.

mixed $contents

The file contents.

array $config

An optional configuration array.

Returns

bool —

True on success, false on failure.

putStream()

putStream(mixed  $path, mixed  $resource, array  $config = []) : bool

Create a file or update if exists.

Parameters

mixed $path

The path to the file.

mixed $resource

The file handle.

array $config

An optional configuration array.

Returns

bool —

True on success, false on failure.

readAndDelete()

readAndDelete(mixed  $path) : string|false

Read and delete a file.

Parameters

mixed $path

The path to the file.

Returns

string|false —

The file contents, or false on failure.

update()

update(mixed  $path, mixed  $contents, array  $config = []) : bool

Update an existing file.

Parameters

mixed $path

The path of the existing file.

mixed $contents

The file contents.

array $config

An optional configuration array.

Returns

bool —

True on success, false on failure.

updateStream()

updateStream(mixed  $path, mixed  $resource, array  $config = []) : bool

Update an existing file using a stream.

Parameters

mixed $path

The path of the existing file.

mixed $resource

The file handle.

array $config

An optional configuration array.

Returns

bool —

True on success, false on failure.

read()

read(mixed  $path) : string|false

Read a file.

Parameters

mixed $path

The path to the file.

Returns

string|false —

The file contents or false on failure.

readStream()

readStream(mixed  $path) : resource|false

Retrieves a read-stream for a path.

Parameters

mixed $path

The path to the file.

Returns

resource|false —

The path resource or false on failure.

rename()

rename(mixed  $path, mixed  $newpath) : bool

Rename a file.

Parameters

mixed $path

Path to the existing file.

mixed $newpath

The new path of the file.

Returns

bool —

True on success, false on failure.

copy()

copy(mixed  $path, mixed  $newpath) : bool

Copy a file.

Parameters

mixed $path

Path to the existing file.

mixed $newpath

The new path of the file.

Returns

bool —

True on success, false on failure.

delete()

delete(mixed  $path) : bool

Delete a file.

Parameters

mixed $path

Returns

bool —

True on success, false on failure.

deleteDir()

deleteDir(mixed  $dirname) : bool

Delete a directory.

Parameters

mixed $dirname

Returns

bool —

True on success, false on failure.

createDir()

createDir(mixed  $dirname, array  $config = []) : bool

Create a directory.

Parameters

mixed $dirname

The name of the new directory.

array $config

An optional configuration array.

Returns

bool —

True on success, false on failure.

listContents()

listContents(mixed  $directory = '', mixed  $recursive = false) : array

List contents of a directory.

Parameters

mixed $directory

The directory to list.

mixed $recursive

Whether to list recursively.

Returns

array —

A list of file metadata.

getMimetype()

getMimetype(mixed  $path) : string|false

Get a file's mime-type.

Parameters

mixed $path

The path to the file.

Returns

string|false —

The file mime-type or false on failure.

getTimestamp()

getTimestamp(mixed  $path) : string|false

Get a file's timestamp.

Parameters

mixed $path

The path to the file.

Returns

string|false —

The timestamp or false on failure.

getVisibility()

getVisibility(mixed  $path) : string|false

Get a file's visibility.

Parameters

mixed $path

The path to the file.

Returns

string|false —

The visibility (public|private) or false on failure.

getSize()

getSize(mixed  $path) : int|false

Get a file's size.

Parameters

mixed $path

The path to the file.

Returns

int|false —

The file size or false on failure.

setVisibility()

setVisibility(mixed  $path, mixed  $visibility) : bool

Set the visibility for a file.

Parameters

mixed $path

The path to the file.

mixed $visibility

One of 'public' or 'private'.

Returns

bool —

True on success, false on failure.

getMetadata()

getMetadata(mixed  $path) : array|false

Get a file's metadata.

Parameters

mixed $path

The path to the file.

Returns

array|false —

The file metadata or false on failure.

get()

get(mixed  $path, \League\Flysystem\Handler  $handler = null) : \League\Flysystem\Handler

Get a file/directory handler.

Parameters

mixed $path

The path to the file.

\League\Flysystem\Handler $handler

An optional existing handler to populate.

Returns

\League\Flysystem\Handler —

Either a file or directory handler.

assertPresent()

assertPresent(string  $path) : void

Assert a file is present.

Parameters

string $path

path to file

Throws

\League\Flysystem\FileNotFoundException

assertAbsent()

assertAbsent(string  $path) : void

Assert a file is absent.

Parameters

string $path

path to file

Throws

\League\Flysystem\FileExistsException

getWithMetadata()

getWithMetadata(string  $path, array  $metadata) : array

Parameters

string $path
array $metadata

Returns

array —

forceCopy()

forceCopy(string  $path, string  $newpath) : bool

Parameters

string $path
string $newpath

Returns

bool —

forceRename()

forceRename(string  $path, string  $newpath) : bool

Parameters

string $path
string $newpath

Returns

bool —

listFiles()

listFiles(string  $path = '', bool  $recursive = false) : array

Parameters

string $path = ''
bool $recursive = false

Returns

array —

listPaths()

listPaths(string  $path = '', bool  $recursive = false) : array

Parameters

string $path = ''
bool $recursive = false

Returns

array —

listWith()

listWith(array  $keys = [], mixed  $directory, mixed  $recursive) : array

Parameters

array $keys = []
mixed $directory
mixed $recursive

Returns

array —

findPlugin()

findPlugin(string  $method) : \League\Flysystem\PluginInterface

Find a specific plugin.

Parameters

string $method

Throws

\League\Flysystem\Plugin\PluginNotFoundException

Returns

\League\Flysystem\PluginInterface —

invokePlugin()

invokePlugin(string  $method, array  $arguments, \League\Flysystem\FilesystemInterface  $filesystem) : mixed

Invoke a plugin by method name.

Parameters

string $method
array $arguments
\League\Flysystem\FilesystemInterface $filesystem

Throws

\League\Flysystem\Plugin\PluginNotFoundException

Returns

mixed —