Skip to content

Commit

Permalink
league/flysystem v.3
Browse files Browse the repository at this point in the history
  • Loading branch information
pekral committed Feb 16, 2022
1 parent af49526 commit 9bf3002
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"ext-mbstring": "*",
"ext-simplexml": "*",
"ecomailcz/purl": "^2.0",
"league/flysystem": "^1.0",
"league/flysystem": "^3.0",
"rakit/validation": "^1.1",
"slevomat/consistence": "^2.1"
},
Expand Down
7 changes: 3 additions & 4 deletions src/Http/HttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

use EcomailFlexibee\Config;
use EcomailFlexibee\Http\Response\FlexibeeResponse;
use League\Flysystem\Adapter\Local;
use League\Flysystem\Filesystem;
use League\Flysystem\Local\LocalFilesystemAdapter;
use function basename;
use function curl_errno;
use function curl_error;
Expand All @@ -23,7 +23,6 @@
use function sprintf;
use function trim;
use const CURLINFO_HTTP_CODE;
use const FILE_APPEND;

final class HttpClient
{
Expand Down Expand Up @@ -78,7 +77,7 @@ public function request(
}

$rootDir = dirname($config->getLogFilePath());
$fileSystem = new Filesystem(new Local($rootDir, FILE_APPEND));
$fileSystem = new Filesystem(new LocalFilesystemAdapter($rootDir));
$logContent = sprintf(
'%s METHOD: %s URL:%s TIME:%s STATUS:%s HEADERS: %s',
date('Y-m-d H:i:s'),
Expand All @@ -94,7 +93,7 @@ public function request(
}

$logContent .= "\n";
$fileSystem->put(
$fileSystem->write(
basename($config->getLogFilePath()),
$logContent,
);
Expand Down

0 comments on commit 9bf3002

Please sign in to comment.