From f6aca853533ae3d66d6fbc79c694de7ea2f8cc35 Mon Sep 17 00:00:00 2001 From: upsite4k Date: Tue, 12 May 2020 11:08:38 +0200 Subject: [PATCH 1/8] Laravel 7 Support --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 1d07d54..955a37c 100644 --- a/composer.json +++ b/composer.json @@ -20,8 +20,8 @@ "cboden/ratchet": "^0.4.1", "clue/buzz-react": "^2.5", "guzzlehttp/guzzle": "^6.3", - "illuminate/console": "5.6.*|5.7.*|5.8.*|6.*", - "illuminate/support": "5.6.*|5.7.*|5.8.*|6.*", + "illuminate/console": "5.6.*|5.7.*|5.8.*|6.*|7.*", + "illuminate/support": "5.6.*|5.7.*|5.8.*|6.*|7.*", "laravel/dusk": "^4.0|^5.0|^6.0", "yosymfony/resource-watcher": "^1.2" }, From ecca3b5d52567dea43aca42ffea27472d0366aab Mon Sep 17 00:00:00 2001 From: upsite4k Date: Tue, 12 May 2020 11:42:00 +0200 Subject: [PATCH 2/8] Laravel 7 Support --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 955a37c..4da63ed 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "illuminate/console": "5.6.*|5.7.*|5.8.*|6.*|7.*", "illuminate/support": "5.6.*|5.7.*|5.8.*|6.*|7.*", "laravel/dusk": "^4.0|^5.0|^6.0", - "yosymfony/resource-watcher": "^1.2" + "yosymfony/resource-watcher": "^1.2|^2.0" }, "require-dev": { "larapack/dd": "^1.0", From aa85c02590c326555df121282f57eb0053eae4d6 Mon Sep 17 00:00:00 2001 From: upsite4k Date: Tue, 12 May 2020 12:19:13 +0200 Subject: [PATCH 3/8] implement ResourceWatcher 2.0 --- src/Watcher.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Watcher.php b/src/Watcher.php index 9f4d237..66b6602 100644 --- a/src/Watcher.php +++ b/src/Watcher.php @@ -24,9 +24,8 @@ public function __construct(Finder $finder, LoopInterface $loop) public function startWatching(Closure $callback) { - $watcher = new ResourceWatcher(new ResourceCacheMemory()); - - $watcher->setFinder($this->finder); + $hashContent = new Crc32ContentHash(); + $watcher = new ResourceWatcher(new ResourceCacheMemory(), $this->finder, $hashContent); $this->loop->addPeriodicTimer(1 / 2, function () use ($watcher, $callback) { $watcher->findChanges(); From c2e1593422e4b97b07b32f416dd50bd452363931 Mon Sep 17 00:00:00 2001 From: upsite4k Date: Tue, 12 May 2020 12:20:10 +0200 Subject: [PATCH 4/8] breaking change with ResourceWatch 2.0 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 4da63ed..9cadc55 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "illuminate/console": "5.6.*|5.7.*|5.8.*|6.*|7.*", "illuminate/support": "5.6.*|5.7.*|5.8.*|6.*|7.*", "laravel/dusk": "^4.0|^5.0|^6.0", - "yosymfony/resource-watcher": "^1.2|^2.0" + "yosymfony/resource-watcher": "^2.0" }, "require-dev": { "larapack/dd": "^1.0", From a927bf545c8b5f9dd8996ae56952cdcb16826507 Mon Sep 17 00:00:00 2001 From: upsite4k Date: Tue, 12 May 2020 12:21:58 +0200 Subject: [PATCH 5/8] RW 2.0 --- src/Watcher.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Watcher.php b/src/Watcher.php index 66b6602..9b5bc10 100644 --- a/src/Watcher.php +++ b/src/Watcher.php @@ -7,6 +7,7 @@ use Symfony\Component\Finder\Finder; use Yosymfony\ResourceWatcher\ResourceCacheMemory; use Yosymfony\ResourceWatcher\ResourceWatcher; +use Yosymfony\ResourceWatcher\Crc32ContentHash; class Watcher { From 791714fa5f53df0f24fd90ce3089a104ec1115e7 Mon Sep 17 00:00:00 2001 From: upsite4k Date: Tue, 12 May 2020 12:55:45 +0200 Subject: [PATCH 6/8] RW2.0 --- src/Watcher.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Watcher.php b/src/Watcher.php index 9b5bc10..385364c 100644 --- a/src/Watcher.php +++ b/src/Watcher.php @@ -29,9 +29,9 @@ public function startWatching(Closure $callback) $watcher = new ResourceWatcher(new ResourceCacheMemory(), $this->finder, $hashContent); $this->loop->addPeriodicTimer(1 / 2, function () use ($watcher, $callback) { - $watcher->findChanges(); + $watcher_result = $watcher->findChanges(); - if ($watcher->hasChanges()) { + if ($watcher_result->hasChanges()) { call_user_func($callback); } }); From c07828bb92c8bce356c8d335e1dac4f5b26e59f1 Mon Sep 17 00:00:00 2001 From: upsite4k Date: Tue, 12 May 2020 14:39:40 +0200 Subject: [PATCH 7/8] StyleCI fixes --- src/Watcher.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Watcher.php b/src/Watcher.php index 385364c..134ffa4 100644 --- a/src/Watcher.php +++ b/src/Watcher.php @@ -5,9 +5,10 @@ use Closure; use React\EventLoop\LoopInterface; use Symfony\Component\Finder\Finder; +use Yosymfony\ResourceWatcher\Crc32ContentHash; use Yosymfony\ResourceWatcher\ResourceCacheMemory; use Yosymfony\ResourceWatcher\ResourceWatcher; -use Yosymfony\ResourceWatcher\Crc32ContentHash; + class Watcher { @@ -29,7 +30,7 @@ public function startWatching(Closure $callback) $watcher = new ResourceWatcher(new ResourceCacheMemory(), $this->finder, $hashContent); $this->loop->addPeriodicTimer(1 / 2, function () use ($watcher, $callback) { - $watcher_result = $watcher->findChanges(); + $watcher_result = $watcher->findChanges(); if ($watcher_result->hasChanges()) { call_user_func($callback); From 67468924e29fe3c8b85577f765d7d10f28121894 Mon Sep 17 00:00:00 2001 From: upsite4k Date: Tue, 12 May 2020 14:41:17 +0200 Subject: [PATCH 8/8] StyleCI fixes --- src/Watcher.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Watcher.php b/src/Watcher.php index 134ffa4..72f837f 100644 --- a/src/Watcher.php +++ b/src/Watcher.php @@ -9,7 +9,6 @@ use Yosymfony\ResourceWatcher\ResourceCacheMemory; use Yosymfony\ResourceWatcher\ResourceWatcher; - class Watcher { /** @var \Symfony\Component\Finder\Finder */