ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
League\Flysystem\Handler Class Reference
+ Inheritance diagram for League\Flysystem\Handler:
+ Collaboration diagram for League\Flysystem\Handler:

Public Member Functions

 __construct (FilesystemInterface $filesystem=null, $path=null)
 Constructor. More...
 
 isDir ()
 Check whether the entree is a directory. More...
 
 isFile ()
 Check whether the entree is a file. More...
 
 getType ()
 Retrieve the entree type (file|dir). More...
 
 setFilesystem (FilesystemInterface $filesystem)
 Set the Filesystem object. More...
 
 getFilesystem ()
 Retrieve the Filesystem object. More...
 
 setPath ($path)
 Set the entree path. More...
 
 getPath ()
 Retrieve the entree path. More...
 
 __call ($method, array $arguments)
 Plugins pass-through. More...
 

Protected Attributes

 $path
 
 $filesystem
 

Detailed Description

Definition at line 7 of file Handler.php.

Constructor & Destructor Documentation

◆ __construct()

League\Flysystem\Handler::__construct ( FilesystemInterface  $filesystem = null,
  $path = null 
)

Constructor.

Parameters
FilesystemInterface$filesystem
string$path

Definition at line 25 of file Handler.php.

26 {
27 $this->path = $path;
28 $this->filesystem = $filesystem;
29 }

References League\Flysystem\Handler\$filesystem, and League\Flysystem\Handler\$path.

Member Function Documentation

◆ __call()

League\Flysystem\Handler::__call (   $method,
array  $arguments 
)

Plugins pass-through.

Parameters
string$method
array$arguments
Returns
mixed

Definition at line 119 of file Handler.php.

120 {
121 array_unshift($arguments, $this->path);
122 $callback = [$this->filesystem, $method];
123
124 try {
125 return call_user_func_array($callback, $arguments);
126 } catch (BadMethodCallException $e) {
127 throw new BadMethodCallException(
128 'Call to undefined method '
129 . get_called_class()
130 . '::' . $method
131 );
132 }
133 }

References League\Flysystem\Handler\$filesystem.

◆ getFilesystem()

League\Flysystem\Handler::getFilesystem ( )

Retrieve the Filesystem object.

Returns
FilesystemInterface

Definition at line 82 of file Handler.php.

83 {
84 return $this->filesystem;
85 }

References League\Flysystem\Handler\$filesystem.

◆ getPath()

League\Flysystem\Handler::getPath ( )

Retrieve the entree path.

Returns
string path

Definition at line 106 of file Handler.php.

107 {
108 return $this->path;
109 }

References League\Flysystem\Handler\$path.

◆ getType()

League\Flysystem\Handler::getType ( )

Retrieve the entree type (file|dir).

Returns
string file or dir

Definition at line 56 of file Handler.php.

57 {
58 $metadata = $this->filesystem->getMetadata($this->path);
59
60 return $metadata['type'];
61 }
$metadata['__DYNAMIC:1__']

References $metadata.

Referenced by League\Flysystem\Handler\isDir(), and League\Flysystem\Handler\isFile().

+ Here is the caller graph for this function:

◆ isDir()

League\Flysystem\Handler::isDir ( )

Check whether the entree is a directory.

Returns
bool

Definition at line 36 of file Handler.php.

37 {
38 return $this->getType() === 'dir';
39 }
getType()
Retrieve the entree type (file|dir).
Definition: Handler.php:56

References League\Flysystem\Handler\getType().

+ Here is the call graph for this function:

◆ isFile()

League\Flysystem\Handler::isFile ( )

Check whether the entree is a file.

Returns
bool

Definition at line 46 of file Handler.php.

47 {
48 return $this->getType() === 'file';
49 }

References League\Flysystem\Handler\getType().

+ Here is the call graph for this function:

◆ setFilesystem()

League\Flysystem\Handler::setFilesystem ( FilesystemInterface  $filesystem)

Set the Filesystem object.

Parameters
FilesystemInterface$filesystem
Returns
$this

Definition at line 70 of file Handler.php.

71 {
72 $this->filesystem = $filesystem;
73
74 return $this;
75 }

References League\Flysystem\Handler\$filesystem.

◆ setPath()

League\Flysystem\Handler::setPath (   $path)

Set the entree path.

Parameters
string$path
Returns
$this

Definition at line 94 of file Handler.php.

95 {
96 $this->path = $path;
97
98 return $this;
99 }

References League\Flysystem\Handler\$path.

Field Documentation

◆ $filesystem

◆ $path

League\Flysystem\Handler::$path
protected

The documentation for this class was generated from the following file: