Interfaces
6 days ago
trait-bufferedwritestreamviaputcontents.php
6 days ago
trait-copydirectoryrecursive.php
6 days ago
trait-copyfileviastreaming.php
6 days ago
trait-copyrecursiveviastreaming.php
6 days ago
trait-getcontentsviareadstream.php
6 days ago
trait-internalizewritestream.php
6 days ago
trait-mkdirrecursive.php
6 days ago
trait-putcontentsviawritestream.php
6 days ago
trait-readonlyfilesystem.php
6 days ago
trait-renamefileviacopyandrm.php
6 days ago
trait-rmdirrecursive.php
6 days ago
trait-copydirectoryrecursive.php
23 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WordPress\Filesystem\Mixin; |
| 4 | |
| 5 | use function WordPress\Filesystem\copy_between_filesystems; |
| 6 | |
| 7 | trait CopyDirectoryRecursive { |
| 8 | |
| 9 | public function copy( $from_path, $to_path, $options = array() ) { |
| 10 | copy_between_filesystems( |
| 11 | array( |
| 12 | 'source_filesystem' => $this, |
| 13 | 'source_path' => $from_path, |
| 14 | 'target_filesystem' => $this, |
| 15 | 'target_path' => $to_path, |
| 16 | 'recursive' => $options['recursive'] ?? true, |
| 17 | ) |
| 18 | ); |
| 19 | } |
| 20 | |
| 21 | abstract public function copy_file( $from_path, $to_path, $options ); |
| 22 | } |
| 23 |