Also replace all other occurences

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
Morris Jobke 2017-12-15 11:31:13 +01:00 committed by Roeland Jago Douma
parent 5ce943aa85
commit d2d73f1ce8
No known key found for this signature in database
GPG Key ID: F941078878347C0C
14 changed files with 17 additions and 17 deletions

View File

@ -261,7 +261,7 @@ class Storage extends DAV implements ISharedStorage {
* @return bool * @return bool
*/ */
private function testRemoteUrl($url) { private function testRemoteUrl($url) {
$cache = $this->memcacheFactory->create('files_sharing_remote_url'); $cache = $this->memcacheFactory->createDistributed('files_sharing_remote_url');
if($cache->hasKey($url)) { if($cache->hasKey($url)) {
return (bool)$cache->get($url); return (bool)$cache->get($url);
} }

View File

@ -240,7 +240,7 @@ class ThemingDefaults extends \OC_Defaults {
* @return array scss variables to overwrite * @return array scss variables to overwrite
*/ */
public function getScssVariables() { public function getScssVariables() {
$cache = $this->cacheFactory->create('theming'); $cache = $this->cacheFactory->createDistributed('theming');
if ($value = $cache->get('getScssVariables')) { if ($value = $cache->get('getScssVariables')) {
return $value; return $value;
} }
@ -307,7 +307,7 @@ class ThemingDefaults extends \OC_Defaults {
* @return bool * @return bool
*/ */
public function shouldReplaceIcons() { public function shouldReplaceIcons() {
$cache = $this->cacheFactory->create('theming'); $cache = $this->cacheFactory->createDistributed('theming');
if($value = $cache->get('shouldReplaceIcons')) { if($value = $cache->get('shouldReplaceIcons')) {
return (bool)$value; return (bool)$value;
} }
@ -329,7 +329,7 @@ class ThemingDefaults extends \OC_Defaults {
private function increaseCacheBuster() { private function increaseCacheBuster() {
$cacheBusterKey = $this->config->getAppValue('theming', 'cachebuster', '0'); $cacheBusterKey = $this->config->getAppValue('theming', 'cachebuster', '0');
$this->config->setAppValue('theming', 'cachebuster', (int)$cacheBusterKey+1); $this->config->setAppValue('theming', 'cachebuster', (int)$cacheBusterKey+1);
$this->cacheFactory->create('theming')->clear('getScssVariables'); $this->cacheFactory->createDistributed('theming')->clear('getScssVariables');
} }
/** /**

View File

@ -50,7 +50,7 @@ abstract class Proxy {
$this->ldap = $ldap; $this->ldap = $ldap;
$memcache = \OC::$server->getMemCacheFactory(); $memcache = \OC::$server->getMemCacheFactory();
if($memcache->isAvailable()) { if($memcache->isAvailable()) {
$this->cache = $memcache->create(); $this->cache = $memcache->createDistributed();
} }
} }

View File

@ -57,7 +57,7 @@ class UpdateTheme extends UpdateJS {
parent::execute($input, $output); parent::execute($input, $output);
// cleanup image cache // cleanup image cache
$c = $this->cacheFactory->create('imagePath'); $c = $this->cacheFactory->createDistributed('imagePath');
$c->clear(''); $c->clear('');
$output->writeln('<info>Image cache cleared'); $output->writeln('<info>Image cache cleared');
} }

View File

@ -306,7 +306,7 @@ class AppManager implements IAppManager {
* Clear the cached list of apps when enabling/disabling an app * Clear the cached list of apps when enabling/disabling an app
*/ */
public function clearAppsCache() { public function clearAppsCache() {
$settingsMemCache = $this->memCacheFactory->create('settings'); $settingsMemCache = $this->memCacheFactory->createDistributed('settings');
$settingsMemCache->clear('listApps'); $settingsMemCache->clear('listApps');
} }

View File

@ -82,7 +82,7 @@ class Swift implements IObjectStore {
} }
$cacheFactory = \OC::$server->getMemCacheFactory(); $cacheFactory = \OC::$server->getMemCacheFactory();
$this->memcache = $cacheFactory->create('swift::' . $cacheKey); $this->memcache = $cacheFactory->createDistributed('swift::' . $cacheKey);
$this->params = $params; $this->params = $params;
} }

View File

@ -87,7 +87,7 @@ class Checker {
$this->fileAccessHelper = $fileAccessHelper; $this->fileAccessHelper = $fileAccessHelper;
$this->appLocator = $appLocator; $this->appLocator = $appLocator;
$this->config = $config; $this->config = $config;
$this->cache = $cacheFactory->create(self::CACHE_KEY); $this->cache = $cacheFactory->createDistributed(self::CACHE_KEY);
$this->appManager = $appManager; $this->appManager = $appManager;
$this->tempManager = $tempManager; $this->tempManager = $tempManager;
} }

View File

@ -46,7 +46,7 @@ class DiscoveryService implements IDiscoveryService {
public function __construct(ICacheFactory $cacheFactory, public function __construct(ICacheFactory $cacheFactory,
IClientService $clientService IClientService $clientService
) { ) {
$this->cache = $cacheFactory->create('ocs-discovery'); $this->cache = $cacheFactory->createDistributed('ocs-discovery');
$this->client = $clientService->newClient(); $this->client = $clientService->newClient();
} }

View File

@ -45,7 +45,7 @@ class MemoryCache implements IBackend {
*/ */
public function __construct(ICacheFactory $cacheFactory, public function __construct(ICacheFactory $cacheFactory,
ITimeFactory $timeFactory) { ITimeFactory $timeFactory) {
$this->cache = $cacheFactory->create(__CLASS__); $this->cache = $cacheFactory->createDistributed(__CLASS__);
$this->timeFactory = $timeFactory; $this->timeFactory = $timeFactory;
} }

View File

@ -952,7 +952,7 @@ class Server extends ServerContainer implements IServerContainer {
$c->getConfig(), $c->getConfig(),
$c->getThemingDefaults(), $c->getThemingDefaults(),
\OC::$SERVERROOT, \OC::$SERVERROOT,
$cacheFactory->create('SCSS') $cacheFactory->createDistributed('SCSS')
); );
}); });
$this->registerService(EventDispatcher::class, function () { $this->registerService(EventDispatcher::class, function () {

View File

@ -291,7 +291,7 @@ class TemplateLayout extends \OC_Template {
new JSCombiner( new JSCombiner(
\OC::$server->getAppDataDir('js'), \OC::$server->getAppDataDir('js'),
\OC::$server->getURLGenerator(), \OC::$server->getURLGenerator(),
\OC::$server->getMemCacheFactory()->create('JS'), \OC::$server->getMemCacheFactory()->createDistributed('JS'),
\OC::$server->getSystemConfig(), \OC::$server->getSystemConfig(),
\OC::$server->getLogger() \OC::$server->getLogger()
) )

View File

@ -151,7 +151,7 @@ class URLGenerator implements IURLGenerator {
* Returns the path to the image. * Returns the path to the image.
*/ */
public function imagePath($app, $image) { public function imagePath($app, $image) {
$cache = $this->cacheFactory->create('imagePath-'.md5($this->getBaseUrl()).'-'); $cache = $this->cacheFactory->createDistributed('imagePath-'.md5($this->getBaseUrl()).'-');
$cacheKey = $app.'-'.$image; $cacheKey = $app.'-'.$image;
if($key = $cache->get($cacheKey)) { if($key = $cache->get($cacheKey)) {
return $key; return $key;

View File

@ -497,7 +497,7 @@ class OC_Helper {
* @return null|string * @return null|string
*/ */
public static function findBinaryPath($program) { public static function findBinaryPath($program) {
$memcache = \OC::$server->getMemCacheFactory()->create('findBinaryPath'); $memcache = \OC::$server->getMemCacheFactory()->createDistributed('findBinaryPath');
if ($memcache->hasKey($program)) { if ($memcache->hasKey($program)) {
return $memcache->get($program); return $memcache->get($program);
} }

View File

@ -43,8 +43,8 @@ $appId = OC_App::cleanAppId($appId);
$result = OC_App::removeApp($appId); $result = OC_App::removeApp($appId);
if($result !== false) { if($result !== false) {
// FIXME: Clear the cache - move that into some sane helper method // FIXME: Clear the cache - move that into some sane helper method
\OC::$server->getMemCacheFactory()->create('settings')->remove('listApps-0'); \OC::$server->getMemCacheFactory()->createDistributed('settings')->remove('listApps-0');
\OC::$server->getMemCacheFactory()->create('settings')->remove('listApps-1'); \OC::$server->getMemCacheFactory()->createDistributed('settings')->remove('listApps-1');
OC_JSON::success(array('data' => array('appid' => $appId))); OC_JSON::success(array('data' => array('appid' => $appId)));
} else { } else {
$l = \OC::$server->getL10N('settings'); $l = \OC::$server->getL10N('settings');