mirror of
https://github.com/Chouchen/Shikiryu_Backup.git
synced 2021-06-30 16:02:14 +02:00
Add some PHPCS corrections
This commit is contained in:
@@ -6,7 +6,7 @@ use phpseclib\Net\SFTP as LibSFTP;
|
||||
|
||||
class Sftp extends TransportAbstract
|
||||
{
|
||||
/** @var string */
|
||||
/** @var string */
|
||||
protected $host;
|
||||
/** @var int */
|
||||
protected $port = 22;
|
||||
@@ -16,7 +16,7 @@ class Sftp extends TransportAbstract
|
||||
protected $password;
|
||||
/** @var string */
|
||||
protected $folder;
|
||||
/** @var LibSFTP */
|
||||
/** @var LibSFTP */
|
||||
private $connection;
|
||||
|
||||
/**
|
||||
@@ -36,29 +36,29 @@ class Sftp extends TransportAbstract
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function send()
|
||||
{
|
||||
$sent = true;
|
||||
$files = $this->backup->getFilesToBackup();
|
||||
if (!empty($files)){
|
||||
$files = $this->backup->getFilesTobackup();
|
||||
if (!empty($files)) {
|
||||
foreach ($files as $file => $name) {
|
||||
$upload = $this->connection->put($this->folder.'/'.$name, $file, LibSFTP::SOURCE_LOCAL_FILE);
|
||||
if (!$upload) {
|
||||
$sent = false;
|
||||
echo 'SFTP upload manqu<71>e de '.$file.' vers '.$this->folder.$name;
|
||||
echo 'SFTP upload manqu<71>e de '.$file.' vers '.$this->folder.$name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$streams = $this->backup->getStreamsToBackup();
|
||||
if (!empty($streams)){
|
||||
$streams = $this->backup->getStreamsTobackup();
|
||||
if (!empty($streams)) {
|
||||
foreach ($streams as $name => $stream) {
|
||||
$upload = $this->connection->put($this->folder.'/'.$name, $stream);
|
||||
if (!$upload) {
|
||||
echo 'SFTP upload manqu<71>e de '.$name.' vers '.$this->folder.$name;
|
||||
echo 'SFTP upload manqu<71>e de '.$name.' vers '.$this->folder.$name;
|
||||
$sent = false;
|
||||
}
|
||||
}
|
||||
@@ -69,4 +69,4 @@ class Sftp extends TransportAbstract
|
||||
}
|
||||
return $sent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user