ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
ForcedRename.php
Go to the documentation of this file.
1
<?
php
2
3
namespace
League\Flysystem\Plugin
;
4
5
use
League\Flysystem\FileNotFoundException
;
6
7
class
ForcedRename
extends
AbstractPlugin
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
$path
Definition:
aliased.php:25
FileNotFoundException
League\Flysystem\Plugin\ForcedRename\handle
handle($path, $newpath)
Renames a file, overwriting the destination if it exists.
Definition:
ForcedRename.php:27
League\Flysystem\Plugin\ForcedRename
Definition:
ForcedRename.php:7
League\Flysystem\Plugin\AbstractPlugin
Definition:
AbstractPlugin.php:8
League\Flysystem\Plugin\ForcedRename\getMethod
getMethod()
Get the method name.string
Definition:
ForcedRename.php:12
League\Flysystem\Plugin
Definition:
AbstractPlugin.php:3
League\Flysystem\FileNotFoundException
Definition:
FileNotFoundException.php:7
php
libs
composer
vendor
league
flysystem
src
Plugin
ForcedRename.php
Generated on Thu Jan 16 2025 19:01:43 for ILIAS by
1.8.13 (using
Doxyfile
)