ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
StreamedCopyTrait.php
Go to the documentation of this file.
1<?php
2
4
6
8{
17 public function copy($path, $newpath)
18 {
19 $response = $this->readStream($path);
20
21 if ($response === false || ! is_resource($response['stream'])) {
22 return false;
23 }
24
25 $result = $this->writeStream($newpath, $response['stream'], new Config());
26
27 if ($result !== false && is_resource($response['stream'])) {
28 fclose($response['stream']);
29 }
30
31 return $result !== false;
32 }
33
34 // Required abstract method
35
40 abstract public function readStream($path);
41
48 abstract public function writeStream($path, $resource, Config $config);
49}
$result
$path
Definition: aliased.php:25
An exception for terminatinating execution or to throw for unit testing.
$config
Definition: bootstrap.php:15
writeStream($path, $resource, Config $config)
$response