function Filesystem::copyThenRemove
Copy then delete is a non-atomic version of {@link rename}.
Some systems can't rename and also don't have proc_open, which requires this solution.
Return value
void
1 call to Filesystem::copyThenRemove()
- Filesystem::rename in vendor/
composer/ composer/ src/ Composer/ Util/ Filesystem.php
File
-
vendor/
composer/ composer/ src/ Composer/ Util/ Filesystem.php, line 348
Class
- Filesystem
- @author Jordi Boggiano <j.boggiano@seld.be> @author Johannes M. Schmitt <schmittjoh@gmail.com>
Namespace
Composer\UtilCode
public function copyThenRemove(string $source, string $target) {
$this->copy($source, $target);
if (!is_dir($source)) {
$this->unlink($source);
return;
}
$this->removeDirectoryPhp($source);
}