ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
League\Flysystem\Plugin\EmptyDir Class Reference
+ Inheritance diagram for League\Flysystem\Plugin\EmptyDir:
+ Collaboration diagram for League\Flysystem\Plugin\EmptyDir:

Public Member Functions

 getMethod ()
 Get the method name. More...
 
 handle ($dirname)
 Empty a directory's contents. More...
 
- Public Member Functions inherited from League\Flysystem\Plugin\AbstractPlugin
 setFilesystem (FilesystemInterface $filesystem)
 Set the Filesystem object. More...
 

Additional Inherited Members

- Protected Attributes inherited from League\Flysystem\Plugin\AbstractPlugin
 $filesystem
 

Detailed Description

Definition at line 5 of file EmptyDir.php.

Member Function Documentation

◆ getMethod()

League\Flysystem\Plugin\EmptyDir::getMethod ( )

Get the method name.

Returns
string

Implements League\Flysystem\PluginInterface.

Definition at line 12 of file EmptyDir.php.

13  {
14  return 'emptyDir';
15  }

◆ handle()

League\Flysystem\Plugin\EmptyDir::handle (   $dirname)

Empty a directory's contents.

Parameters
$dirname

Definition at line 22 of file EmptyDir.php.

23  {
24  $listing = $this->filesystem->listContents($dirname, false);
25 
26  foreach ($listing as $item) {
27  if ($item['type'] === 'dir') {
28  $this->filesystem->deleteDir($item['path']);
29  } else {
30  $this->filesystem->delete($item['path']);
31  }
32  }
33  }

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