WP_Filesystem_SSH2::copy( string $source, string $destination, bool $overwrite = false, int|bool $mode = false )
Parameters
- $source
-
(Required)
- $destination
-
(Required)
- $overwrite
-
(Optional)
Default value: false
- $mode
-
(Optional)
Default value: false
Return
(bool)
Source
File: wp-admin/includes/class-wp-filesystem-ssh2.php
public function copy($source, $destination, $overwrite = false, $mode = false) {
if ( ! $overwrite && $this->exists($destination) )
return false;
$content = $this->get_contents($source);
if ( false === $content)
return false;
return $this->put_contents($destination, $content, $mode);
}