try {
$stat = [];
if ($this->is_dir($path)) {
- //folders don't really exist
- $stat['size'] = -1; //unknown
- $stat['mtime'] = time();
$cacheEntry = $this->getCache()->get($path);
- if ($cacheEntry instanceof CacheEntry && $this->getMountOption('filesystem_check_changes', 1) !== 1) {
+ if ($cacheEntry instanceof CacheEntry) {
$stat['size'] = $cacheEntry->getSize();
$stat['mtime'] = $cacheEntry->getMTime();
+ } else {
+ // Use dummy values
+ $stat['size'] = -1; // Pending
+ $stat['mtime'] = time();
}
} else {
$stat['size'] = $this->getContentLength($path);
}
}
+ public function hasUpdated($path, $time) {
+ return $this->getMountOption('filesystem_check_changes', 1) === 1 || parent::hasUpdated($path, $time);
+ }
+
/**
* Return content length for object
*