ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ListFiles.php
Go to the documentation of this file.
1 <?php
2 
4 
5 class ListFiles extends AbstractPlugin
6 {
12  public function getMethod()
13  {
14  return 'listFiles';
15  }
16 
25  public function handle($directory = '', $recursive = false)
26  {
27  $contents = $this->filesystem->listContents($directory, $recursive);
28 
29  $filter = function ($object) {
30  return $object['type'] === 'file';
31  };
32 
33  return array_values(array_filter($contents, $filter));
34  }
35 }
getMethod()
Get the method name.
Definition: ListFiles.php:12
handle($directory='', $recursive=false)
List all files in the directory.
Definition: ListFiles.php:25