diff --git a/lib/BlockingDriver.php b/lib/BlockingDriver.php index 2aa7fc4..7fcde5c 100644 --- a/lib/BlockingDriver.php +++ b/lib/BlockingDriver.php @@ -24,7 +24,9 @@ class BlockingDriver implements Driver { * {@inheritdoc} */ public function stat($path) { - if ($stat = @\stat($path)) { + if ($stat = StatCache::get($path)) { + return new Success($stat); + } elseif ($stat = @\stat($path)) { StatCache::set($path, $stat); \clearstatcache(true, $path); } else { diff --git a/lib/UvDriver.php b/lib/UvDriver.php index 5f8b4ab..c3252cb 100644 --- a/lib/UvDriver.php +++ b/lib/UvDriver.php @@ -94,6 +94,10 @@ class UvDriver implements Driver { * {@inheritdoc} */ public function stat($path) { + if ($stat = StatCache::get($path)) { + return new Success($stat); + } + $this->reactor->addRef(); $promisor = new Deferred; \uv_fs_stat($this->loop, $path, function($fh, $stat) use ($promisor, $path) {