diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/base.php | 3 | ||||
-rw-r--r-- | lib/private/app.php | 37 | ||||
-rw-r--r-- | lib/private/memcache/factory.php | 22 | ||||
-rw-r--r-- | lib/private/server.php | 3 | ||||
-rw-r--r-- | lib/public/activity/iextension.php | 2 |
5 files changed, 32 insertions, 35 deletions
diff --git a/lib/base.php b/lib/base.php index 8a79d4624d8..db758958577 100644 --- a/lib/base.php +++ b/lib/base.php @@ -708,7 +708,8 @@ class OC { $instanceId = \OC::$server->getSystemConfig()->getValue('instanceid', null); if ($instanceId) { try { - $memcacheFactory = new \OC\Memcache\Factory($instanceId); + $memcacheFactory = new \OC\Memcache\Factory($instanceId, + \OC::$server->getLogger()); self::$loader->setMemoryCache($memcacheFactory->createLowLatency('Autoloader')); } catch (\Exception $ex) { } diff --git a/lib/private/app.php b/lib/private/app.php index a92ddd40e6f..f41cb82c36b 100644 --- a/lib/private/app.php +++ b/lib/private/app.php @@ -35,13 +35,11 @@ use OC\App\Platform; */ class OC_App { static private $appVersion = []; - static private $settingsForms = array(); static private $adminForms = array(); static private $personalForms = array(); static private $appInfo = array(); static private $appTypes = array(); static private $loadedApps = array(); - static private $checkedApps = array(); static private $altLogin = array(); /** @@ -320,6 +318,7 @@ class OC_App { /** * This function set an app as disabled in appconfig. * @param string $app app + * @throws Exception */ public static function disable($app) { if($app === 'files') { @@ -431,18 +430,6 @@ class OC_App { "icon" => OC_Helper::imagePath("settings", "personal.svg") ); - // if there are some settings forms - if (!empty(self::$settingsForms)) { - // settings menu - $settings[] = array( - "id" => "settings", - "order" => 1000, - "href" => OC_Helper::linkToRoute("settings_settings"), - "name" => $l->t("Settings"), - "icon" => OC_Helper::imagePath("settings", "settings.svg") - ); - } - //SubAdmins are also allowed to access user management if (OC_SubAdmin::isSubAdmin(OC_User::getUser())) { // admin users menu @@ -455,7 +442,6 @@ class OC_App { ); } - // if the user is an admin if (OC_User::isAdminUser(OC_User::getUser())) { // admin settings @@ -696,14 +682,12 @@ class OC_App { } /** - * get the forms for either settings, admin or personal + * @param string $type + * @return array */ public static function getForms($type) { $forms = array(); switch ($type) { - case 'settings': - $source = self::$settingsForms; - break; case 'admin': $source = self::$adminForms; break; @@ -720,13 +704,6 @@ class OC_App { } /** - * register a settings form to be shown - */ - public static function registerSettings($app, $page) { - self::$settingsForms[] = $app . '/' . $page . '.php'; - } - - /** * register an admin form to be shown * * @param string $app @@ -743,10 +720,16 @@ class OC_App { self::$personalForms[] = $app . '/' . $page . '.php'; } - public static function registerLogIn($entry) { + /** + * @param array $entry + */ + public static function registerLogIn(array $entry) { self::$altLogin[] = $entry; } + /** + * @return array + */ public static function getAlternativeLogIns() { return self::$altLogin; } diff --git a/lib/private/memcache/factory.php b/lib/private/memcache/factory.php index e8a91c52269..537054a30f6 100644 --- a/lib/private/memcache/factory.php +++ b/lib/private/memcache/factory.php @@ -11,16 +11,19 @@ namespace OC\Memcache; use \OCP\ICacheFactory; class Factory implements ICacheFactory { - /** - * @var string $globalPrefix - */ + /** @var string $globalPrefix */ private $globalPrefix; + /** @var \OCP\ILogger */ + private $logger; + /** * @param string $globalPrefix + * @param \OCP\ILogger $logger */ - public function __construct($globalPrefix) { + public function __construct($globalPrefix, $logger) { $this->globalPrefix = $globalPrefix; + $this->logger = $logger; } /** @@ -32,16 +35,22 @@ class Factory implements ICacheFactory { function create($prefix = '') { $prefix = $this->globalPrefix . '/' . $prefix; if (XCache::isAvailable()) { + $this->logger->debug("creating XCache instance", array('app' => 'memcache')); return new XCache($prefix); } elseif (APCu::isAvailable()) { + $this->logger->debug('creating APCu instance', array('app'=>'memcache')); return new APCu($prefix); } elseif (APC::isAvailable()) { + $this->logger->debug('creating APC instance', array('app'=>'memcache')); return new APC($prefix); } elseif (Redis::isAvailable()) { + $this->logger->debug('creating redis instance', array('app'=>'memcache')); return new Redis($prefix); } elseif (Memcached::isAvailable()) { + $this->logger->debug('creating memcached instance', array('app'=>'memcache')); return new Memcached($prefix); } else { + $this->logger->debug('no cache available instance', array('app'=>'memcache')); return new ArrayCache($prefix); } } @@ -64,12 +73,16 @@ class Factory implements ICacheFactory { public function createLowLatency($prefix = '') { $prefix = $this->globalPrefix . '/' . $prefix; if (XCache::isAvailable()) { + $this->logger->debug('creating xcache instance for low latency', array('app'=>'memcache')); return new XCache($prefix); } elseif (APCu::isAvailable()) { + $this->logger->debug('creating APCu instance for low latency', array('app'=>'memcache')); return new APCu($prefix); } elseif (APC::isAvailable()) { + $this->logger->debug('creating APC instance for low latency', array('app'=>'memcache')); return new APC($prefix); } else { + $this->logger->debug('no low latency cache available', array('app'=>'memcache')); return null; } } @@ -83,5 +96,4 @@ class Factory implements ICacheFactory { return XCache::isAvailable() || APCu::isAvailable() || APC::isAvailable(); } - } diff --git a/lib/private/server.php b/lib/private/server.php index b023534ae21..9660597b39d 100644 --- a/lib/private/server.php +++ b/lib/private/server.php @@ -193,7 +193,8 @@ class Server extends SimpleContainer implements IServerContainer { }); $this->registerService('MemCacheFactory', function ($c) { $instanceId = \OC_Util::getInstanceId(); - return new \OC\Memcache\Factory($instanceId); + $logger = $c['Logger']; + return new \OC\Memcache\Factory($instanceId, $logger); }); $this->registerService('ActivityManager', function ($c) { return new ActivityManager(); diff --git a/lib/public/activity/iextension.php b/lib/public/activity/iextension.php index 1b405ad8d3d..6f30f4eb9c2 100644 --- a/lib/public/activity/iextension.php +++ b/lib/public/activity/iextension.php @@ -90,7 +90,7 @@ interface IExtension { * @param string $text * @return array|false */ - function getSpecialParameterList($app, $text); + public function getSpecialParameterList($app, $text); /** * A string naming the css class for the icon to be used can be returned. |