ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ForcedRename.php
Go to the documentation of this file.
1 <?php
2 
4 
6 
8 {
12  public function getMethod()
13  {
14  return 'forceRename';
15  }
16 
27  public function handle($path, $newpath)
28  {
29  try {
30  $deleted = $this->filesystem->delete($newpath);
31  } catch (FileNotFoundException $e) {
32  // The destination path does not exist. That's ok.
33  $deleted = true;
34  }
35 
36  if ($deleted) {
37  return $this->filesystem->rename($path, $newpath);
38  }
39 
40  return false;
41  }
42 }
$path
Definition: aliased.php:25
handle($path, $newpath)
Renames a file, overwriting the destination if it exists.
getMethod()
Get the method name.string