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: solve issue with checking folder existence using FTP #1838

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Ftp/FtpAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -592,12 +592,14 @@
$dirPath = '';
$parts = explode('/', trim($dirname, '/'));
$mode = $visibility ? $this->visibilityConverter->forDirectory($visibility) : false;
$original_directory = @ftp_pwd($connection);

Check failure on line 595 in src/Ftp/FtpAdapter.php

View workflow job for this annotation

GitHub Actions / PHPUnit tests on 8.1

Parameter #1 $ftp of function ftp_pwd expects FTP\Connection, resource given.

foreach ($parts as $part) {
$dirPath .= '/' . $part;
$location = $this->prefixer()->prefixPath($dirPath);

if (@ftp_chdir($connection, $location)) {

Check failure on line 601 in src/Ftp/FtpAdapter.php

View workflow job for this annotation

GitHub Actions / PHPUnit tests on 8.1

Ignored error pattern #^Parameter \#1 \$ftp of function ftp_chdir expects FTP\\Connection, resource given\.$# in path /home/runner/work/flysystem/flysystem/src/Ftp/FtpAdapter.php is expected to occur 2 times, but occurred 3 times.
@ftp_chdir($connection, $original_directory);
continue;
}

Expand Down Expand Up @@ -636,7 +638,7 @@
$location = $this->prefixer()->prefixPath($path);
$connection = $this->connection();

return @ftp_chdir($connection, $location) === true;

Check failure on line 641 in src/Ftp/FtpAdapter.php

View workflow job for this annotation

GitHub Actions / PHPUnit tests on 8.1

Parameter #1 $ftp of function ftp_chdir expects FTP\Connection, resource given.
}

/**
Expand Down
Loading