diff --git a/README.md b/README.md index 875c9ee..4b09bd2 100644 --- a/README.md +++ b/README.md @@ -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" } } diff --git a/src/Methods/CopyMethod.php b/src/Methods/CopyMethod.php index 0184733..31b9d1a 100644 --- a/src/Methods/CopyMethod.php +++ b/src/Methods/CopyMethod.php @@ -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; - } }