Skip to content

Commit

Permalink
Update FtpAdapter.php
Browse files Browse the repository at this point in the history
fix: solve issue with checking folder existence using FTP
  • Loading branch information
mhmmdtech authored Dec 11, 2024
1 parent 704c10b commit 387c6e5
Showing 1 changed file with 2 additions and 0 deletions.
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 @@ private function ensureDirectoryExists(string $dirname, ?string $visibility): vo
$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

0 comments on commit 387c6e5

Please sign in to comment.