Skip to content

Commit

Permalink
Merge branch '3.0' into 3
Browse files Browse the repository at this point in the history
emteknetnz committed Jan 8, 2025
2 parents 09d284a + d1f1cea commit 5b399b6
Showing 2 changed files with 2 additions and 31 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -11,6 +11,8 @@ is blocked from web-access by default.

For example, given the below module composer.json:

(note there is no need to explicitly add `silverstripe/vendor-plugin` as a dependency when `silverstripe/framework` is included)

```json
{
"name": "tractorcow/anothermodule",
@@ -22,7 +24,6 @@ For example, given the below module composer.json:
]
},
"require": {
"silverstripe/vendor-plugin": "^1.0",
"silverstripe/framework": "^4.0"
}
}
30 changes: 0 additions & 30 deletions src/Methods/CopyMethod.php
Original file line number Diff line number Diff line change
@@ -34,34 +34,4 @@ public function exposeDirectory($source, $target)
throw new RuntimeException("Could not write to directory $target");
}
}

/**
* Copies a file or directory from $source to $target.
*
*
* @param string $source
* @param string $target
* @deprecated 5.2 Use Filesystem::copy instead
* @return bool
*/
public function copy($source, $target)
{
if (!is_dir($source ?? '')) {
return copy($source ?? '', $target ?? '');
}
$it = new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS);
/** @var RecursiveDirectoryIterator $ri */
$ri = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::SELF_FIRST);
$this->filesystem->ensureDirectoryExists($target);
$result = true;
foreach ($ri as $file) {
$targetPath = $target . DIRECTORY_SEPARATOR . $ri->getSubPathName();
if ($file->isDir()) {
$this->filesystem->ensureDirectoryExists($targetPath);
} else {
$result = $result && copy($file->getPathname() ?? '', $targetPath ?? '');
}
}
return $result;
}
}

0 comments on commit 5b399b6

Please sign in to comment.