Skip to content

Commit

Permalink
Update to amphp/file v2
Browse files Browse the repository at this point in the history
  • Loading branch information
trowski committed Dec 7, 2021
1 parent fe455ec commit 92e40c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions bin/cluster
Expand Up @@ -176,13 +176,13 @@ Loop::run(static function () use ($argc, $argv, $flags, $arguments): \Generator
$level = $arguments->get("log");

if ($arguments->defined("file", $argv)) {
if (!\interface_exists(File\Driver::class)) {
if (!\interface_exists(File\Filesystem::class)) {
throw new Exception("amphp/file must be installed to log to a file");
}

$path = \str_replace('*', \getmypid(), $arguments->get("file"));

$logHandler = new StreamHandler(yield File\open($path, "a"), $level);
$logHandler = new StreamHandler(yield File\openFile($path, "a"), $level);
$formatter = new LineFormatter;
} else {
$logHandler = new StreamHandler(ByteStream\getStdout(), $level);
Expand Down
7 changes: 3 additions & 4 deletions composer.json
Expand Up @@ -40,12 +40,11 @@
"psr/log": "^1"
},
"require-dev": {
"amphp/file": "^1 || ^0.3",
"amphp/file": "^2",
"amphp/http-server": "^2-RC",
"amphp/phpunit-util": "^1.1",
"amphp/php-cs-fixer-config": "dev-master",
"phpunit/phpunit": "^8 || ^7",
"infection/infection": "^0.7.1"
"phpunit/phpunit": "^8 || ^7"
},
"autoload": {
"psr-4": {
Expand All @@ -65,7 +64,7 @@
"amphp/file": "Required for logging to a file"
},
"conflict": {
"amphp/file": "<0.2 || >=2"
"amphp/file": "<2 || >=3"
},
"bin": [
"bin/cluster"
Expand Down

0 comments on commit 92e40c9

Please sign in to comment.