]> _ Git - cubist_net.git/commitdiff
wait #6843
authorsoufiane <soufiane@cubedesigners.com>
Wed, 3 Apr 2024 10:00:30 +0000 (12:00 +0200)
committersoufiane <soufiane@cubedesigners.com>
Wed, 3 Apr 2024 10:00:30 +0000 (12:00 +0200)
src/Transfer/SFTP.php

index a1160ad9d848650bfae6f1152e70536262ef8ca6..83adc2d19f7a4ac883c7d16a21aa5b5851e9e029 100644 (file)
@@ -62,10 +62,11 @@ class SFTP extends Driver {
             }
 
             try {
-                $filename = $this->getTestFilename($tmp);
+                $filename = "cubistzsuruz"; //$this->getTestFilename($tmp);
                 $sftp = ssh2_sftp($connection);
-                fopen("ssh2.sftp://".intval($sftp).$this->getServer()->getBasePath().$filename, 'r'); //on vĂ©rifie l'existance du fichier distant
-                ssh2_sftp_unlink($sftp, $this->getServer()->getBasePath().$filename); //on supprime le fichier distant
+                $basepath = '/'.trim($this->getServer()->getBasePath(), '/').'/';
+                $f = @ssh2_sftp_stat($sftp, $basepath.$filename);
+                ssh2_sftp_unlink($sftp, $basepath.$filename); //on supprime le fichier distant
                 ssh2_disconnect($connection); //on quitte la connexion
                 unlink($tmp); //on supprime le fichier temporaire en local
                 return true;