|
@@ 274-281 (lines=8) @@
|
| 271 |
|
protected function addToCache($path, $data, $fileId = -1) { |
| 272 |
|
\OC_Hook::emit('Scanner', 'addToCache', ['file' => $path, 'data' => $data]); |
| 273 |
|
$this->emit('\OC\Files\Cache\Scanner', 'addToCache', [$path, $this->storageId, $data]); |
| 274 |
|
if ($this->cacheActive) { |
| 275 |
|
if ($fileId !== -1) { |
| 276 |
|
$this->cache->update($fileId, $data); |
| 277 |
|
return $fileId; |
| 278 |
|
} |
| 279 |
|
|
| 280 |
|
return $this->cache->put($path, $data); |
| 281 |
|
} |
| 282 |
|
|
| 283 |
|
return -1; |
| 284 |
|
} |
|
@@ 296-302 (lines=7) @@
|
| 293 |
|
protected function updateCache($path, $data, $fileId = -1) { |
| 294 |
|
\OC_Hook::emit('Scanner', 'addToCache', ['file' => $path, 'data' => $data]); |
| 295 |
|
$this->emit('\OC\Files\Cache\Scanner', 'updateCache', [$path, $this->storageId, $data]); |
| 296 |
|
if ($this->cacheActive) { |
| 297 |
|
if ($fileId !== -1) { |
| 298 |
|
$this->cache->update($fileId, $data); |
| 299 |
|
} else { |
| 300 |
|
$this->cache->put($path, $data); |
| 301 |
|
} |
| 302 |
|
} |
| 303 |
|
} |
| 304 |
|
|
| 305 |
|
/** |