ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
EmptyDir.php
Go to the documentation of this file.
1<?php
2
4
6{
12 public function getMethod()
13 {
14 return 'emptyDir';
15 }
16
22 public function handle($dirname)
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 }
34}
An exception for terminatinating execution or to throw for unit testing.
getMethod()
Get the method name.
Definition: EmptyDir.php:12
handle($dirname)
Empty a directory's contents.
Definition: EmptyDir.php:22