Harden watcher
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
2111963304
commit
9a64759af5
|
@ -85,7 +85,7 @@ class Watcher implements IWatcher {
|
||||||
if (is_null($cachedEntry)) {
|
if (is_null($cachedEntry)) {
|
||||||
$cachedEntry = $this->cache->get($path);
|
$cachedEntry = $this->cache->get($path);
|
||||||
}
|
}
|
||||||
if ($this->needsUpdate($path, $cachedEntry)) {
|
if ($cachedEntry === false || $this->needsUpdate($path, $cachedEntry)) {
|
||||||
$this->update($path, $cachedEntry);
|
$this->update($path, $cachedEntry);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -105,7 +105,7 @@ class Watcher implements IWatcher {
|
||||||
} else {
|
} else {
|
||||||
$this->scanner->scanFile($path);
|
$this->scanner->scanFile($path);
|
||||||
}
|
}
|
||||||
if ($cachedData['mimetype'] === 'httpd/unix-directory') {
|
if (is_array($cachedData) && $cachedData['mimetype'] === 'httpd/unix-directory') {
|
||||||
$this->cleanFolder($path);
|
$this->cleanFolder($path);
|
||||||
}
|
}
|
||||||
if ($this->cache instanceof Cache) {
|
if ($this->cache instanceof Cache) {
|
||||||
|
|
Loading…
Reference in New Issue