mirror of
https://github.com/nextcloud/documentation.git
synced 2026-01-02 17:59:36 +07:00
fixed call on null errors in cache docs code blocks
some code blocks referenced an undefined $this->cache variable instead of the defined $cache Signed-off-by: Jonathan Treffler <mail@jonathan-treffler.de>
This commit is contained in:
committed by
GitHub
parent
a32086d104
commit
af4d58c0fd
@@ -121,7 +121,7 @@ A local cache instance can be acquired through the ``\OCP\ICacheFactory`` servic
|
||||
|
||||
public function getPicture(string $url): void {
|
||||
$cache = $this->cacheFactory->createLocal('my-app-pictures');
|
||||
$cachedPicture = $this->cache->get($url);
|
||||
$cachedPicture = $cache->get($url);
|
||||
if ($cachedPicture !== null) {
|
||||
return $cachedPicture;
|
||||
}
|
||||
@@ -157,7 +157,7 @@ A distributed cache instance can be acquired through the ``\OCP\ICacheFactory``
|
||||
|
||||
public function getPicture(string $url): void {
|
||||
$cache = $this->cacheFactory->createDistributed('my-app-pictures');
|
||||
$cachedPicture = $this->cache->get($url);
|
||||
$cachedPicture = $cache->get($url);
|
||||
if ($cachedPicture !== null) {
|
||||
return $cachedPicture;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user