Skip to content
Permalink
Browse files

don't use xcache in case admin auth is enabled in php.ini this can ca…

…use issues
  • Loading branch information
DeepDiver1975 committed Aug 9, 2013
1 parent 82f34f8 commit e406e95bb2de8bec5d2b6c289184e01f4fda2f8b
Showing with 18 additions and 2 deletions.
  1. +2 −2 lib/cache.php
  2. +16 −0 lib/cache/xcache.php
@@ -32,7 +32,7 @@ class OC_Cache {
static public function getGlobalCache($fast=false) {
if (!self::$global_cache) {
self::$global_cache_fast = null;
if (!self::$global_cache_fast && function_exists('xcache_set')) {
if (!self::$global_cache_fast && OC_Cache_XCache::available()) {
self::$global_cache_fast = new OC_Cache_XCache(true);
}
if (!self::$global_cache_fast && function_exists('apc_store')) {
@@ -61,7 +61,7 @@ static public function getGlobalCache($fast=false) {
static public function getUserCache($fast=false) {
if (!self::$user_cache) {
self::$user_cache_fast = null;
if (!self::$user_cache_fast && function_exists('xcache_set')) {
if (!self::$user_cache_fast && OC_Cache_XCache::available()) {
self::$user_cache_fast = new OC_Cache_XCache();
}
if (!self::$user_cache_fast && function_exists('apc_store')) {
@@ -16,6 +16,22 @@ public function __construct($global = false) {
}
}

public static function available()
{
if (!extension_loaded('xcache')) {
return false;
}
if (\OC::$CLI) {
return false;
}
// as soon as admin auth is enabled we can run into issues with admin ops like xcache_clear_cache
if (ini_get('xcache.admin.enable_auth')) {
return false;
}

return true;
}

/**
* entries in XCache gets namespaced to prevent collisions between owncloud instances and users
*/

1 comment on commit e406e95

@Soeldner

This comment has been minimized.

Copy link

@Soeldner Soeldner commented on e406e95 Sep 30, 2013

Thanks

Please sign in to comment.
You can’t perform that action at this time.