thephpleague / flysystem-sftp

[READ-ONLY SUBSPLIT] Flysystem Adapter for SFTP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Calling `delete()` causes some phpseclib errors and does not delete the file

cgsmith opened this issue · comments

I receive the following error with this code.

Warning: Attempt to assign property of non-object in vendor\phpseclib\phpseclib\phpseclib\Net\SFTP.php on line 1152

Warning: Attempt to assign property of non-object in vendor\phpseclib\phpseclib\phpseclib\Net\SFTP.php on line 1155

$sftp = new Filesystem(new SftpAdapter([
            'host' => $this->config['ftpServer'],
            'port' => $this->config['ftpPort'],
            'username' => $this->config['ftpUser'],
            'password' => $this->config['ftpPass'],
            'timeout' => 10,
        ]));

$manager = new MountManager([
            'sftp' => $sftp,
        ]);

$contents = $manager->read('sftp://'.$file['path']); // Read contents
$manager->delete('sftp://'.$file['path']); // Delete file

The file does not delete from the remote SFTP site.

Versions
PHP: 7.0.11
Flysystem-SFTP: 1.0

It looks like a permission problem on your end tho, don't think we can remedy this from Flysystem's end.

Thank you! I will close the issue. Happy New Year!

@cgsmith happy new year to you too!