Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SftpAdapter not overwriting on move #1682

Open
wants to merge 4 commits into
base: 3.x
Choose a base branch
from

Conversation

kynx
Copy link

@kynx kynx commented Jul 14, 2023

Currently the SftpAdapter doesn't overwrite existing files when moving, unlike other adapters. This PR adds that ability.

@kynx
Copy link
Author

kynx commented Jul 14, 2023

Moving and copying are both deterministic operations. This means they will always overwrite the target location, and parent directories are always created (if and when needed).

(from https://flysystem.thephpleague.com/docs/usage/filesystem-api/ )

Judging by the failing tests this is based on some alternative facts 😉 But fixing the other adapters should probably be done in separate PRs.

@kynx
Copy link
Author

kynx commented Jul 17, 2023

OK, I've moved the moving_a_file_and_overwriting() and moving_a_directory_and_overwriting() tests to SftpAdapterTest so that the other adapter tests no longer fail and this will stand a chance of getting merged. Once the other adapters are fixed these tests should be added back to FilesystemAdapterTestCase

@kynx kynx changed the title Sftp move and overwrite Fix SftpAdapter not overwriting on move Jul 18, 2023
@kynx
Copy link
Author

kynx commented Aug 15, 2023

@frankdejonge Apologies, I totally missed that this had conflicts. Those are resolved now.

kynx pushed a commit to kynx/flysystem-sftp-v3 that referenced this pull request Aug 30, 2023
# Conflicts:
#	src/PhpseclibV3/SftpAdapterTest.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant