78 foreach ($filesystems as $prefix => $filesystem) {
97 if ( ! is_string($prefix)) {
135 if (empty($arguments)) {
139 $path = array_shift($arguments);
141 if ( ! is_string(
$path)) {
146 array_unshift($arguments,
$path);
148 return [$prefix, $arguments];
164 $result = $filesystem->listContents($directory, $recursive);
167 $file[
'filesystem'] = $prefix;
184 public function __call($method, $arguments)
186 list($prefix, $arguments) = $this->
filterPrefix($arguments);
207 if ($buffer ===
false) {
215 if (is_resource($buffer)) {
234 public function listWith(array
$keys = [], $directory =
'', $recursive =
false)
237 $arguments = [
$keys, $directory, $recursive];
259 return $this->
delete(
$from);
281 return $this->
invokePlugin($method, $arguments, $filesystem);
286 $callback = [$filesystem, $method];
288 return call_user_func_array($callback, $arguments);
300 if (strpos(
$path,
'://') < 1) {
304 return explode(
'://',
$path, 2);
listContents($directory='', $recursive=false)
invokePlugin($method, array $arguments, FilesystemInterface $filesystem)
Invoke a plugin by method name.
copy($from, $to, array $config=[])
Thrown when the MountManager cannot find a filesystem.
mountFilesystems(array $filesystems)
Mount filesystems.
filterPrefix(array $arguments)
Retrieve the prefix from an arguments array.
listWith(array $keys=[], $directory='', $recursive=false)
List with plugin adapter.
static filesystems()
Returns the loaded filesystems.
invokePluginOnFilesystem($method, $arguments, $prefix)
Invoke a plugin on a filesystem mounted on a given prefix.
move($from, $to, array $config=[])
Move a file.
__construct(array $filesystems=[])
Constructor.
mountFilesystem($prefix, FilesystemInterface $filesystem)
Mount filesystems.
__call($method, $arguments)
Call forwarder.
getFilesystem($prefix)
Get the filesystem with the corresponding prefix.