ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
ForcedCopy.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
ForcedCopy
extends
AbstractPlugin
8
{
12
public
function
getMethod
()
13
{
14
return
'forceCopy'
;
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->copy(
$path
, $newpath);
38
}
39
40
return
false
;
41
}
42
}
League\Flysystem\Plugin\ForcedCopy\handle
handle($path, $newpath)
Copies a file, overwriting any existing files.
Definition:
ForcedCopy.php:27
$path
$path
Definition:
aliased.php:25
FileNotFoundException
League\Flysystem\Plugin\ForcedCopy
Definition:
ForcedCopy.php:7
League\Flysystem\Plugin\AbstractPlugin
Definition:
AbstractPlugin.php:8
League\Flysystem\Plugin
Definition:
AbstractPlugin.php:3
League\Flysystem\FileNotFoundException
Definition:
FileNotFoundException.php:7
php
League\Flysystem\Plugin\ForcedCopy\getMethod
getMethod()
Get the method name.string
Definition:
ForcedCopy.php:12
libs
composer
vendor
league
flysystem
src
Plugin
ForcedCopy.php
Generated on Thu Jan 16 2025 19:01:43 for ILIAS by
1.8.13 (using
Doxyfile
)