mirror of
https://github.com/nextcloud/server.git
synced 2026-04-20 22:00:39 -04:00
reuse dependencies from wrapped cache
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
1e8a067b93
commit
5ebceaa54c
1 changed files with 11 additions and 3 deletions
|
|
@ -33,8 +33,10 @@ use OC\Files\Cache\Cache;
|
|||
use OC\Files\Cache\QuerySearchHelper;
|
||||
use OCP\Files\Cache\ICache;
|
||||
use OCP\Files\Cache\ICacheEntry;
|
||||
use OCP\Files\IMimeTypeLoader;
|
||||
use OCP\Files\Search\ISearchOperator;
|
||||
use OCP\Files\Search\ISearchQuery;
|
||||
use OCP\IDBConnection;
|
||||
|
||||
class CacheWrapper extends Cache {
|
||||
/**
|
||||
|
|
@ -47,9 +49,15 @@ class CacheWrapper extends Cache {
|
|||
*/
|
||||
public function __construct($cache) {
|
||||
$this->cache = $cache;
|
||||
$this->mimetypeLoader = \OC::$server->getMimeTypeLoader();
|
||||
$this->connection = \OC::$server->getDatabaseConnection();
|
||||
$this->querySearchHelper = \OC::$server->get(QuerySearchHelper::class);
|
||||
if ($cache instanceof Cache) {
|
||||
$this->mimetypeLoader = $cache->mimetypeLoader;
|
||||
$this->connection = $cache->connection;
|
||||
$this->querySearchHelper = $cache->querySearchHelper;
|
||||
} else {
|
||||
$this->mimetypeLoader = \OC::$server->get(IMimeTypeLoader::class);
|
||||
$this->connection = \OC::$server->get(IDBConnection::class);
|
||||
$this->querySearchHelper = \OC::$server->get(QuerySearchHelper::class);
|
||||
}
|
||||
}
|
||||
|
||||
protected function getCache() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue