[Pkg-owncloud-commits] [owncloud] 20/121: Add registerAutoloaderCache().

David Prévot taffit at moszumanska.debian.org
Thu Aug 21 16:44:26 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 12c7ddc18fcbfe803ba7f00ff2ce1cb83027d512
Author: Andreas Fischer <bantu at owncloud.com>
Date:   Tue Jul 29 11:18:40 2014 +0200

    Add registerAutoloaderCache().
---
 lib/base.php | 33 ++++++++++++++++++---------------
 1 file changed, 18 insertions(+), 15 deletions(-)

diff --git a/lib/base.php b/lib/base.php
index 240ac6c..1e6d5cf 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -473,23 +473,9 @@ class OC {
 		@ini_set('file_uploads', '50');
 
 		self::handleAuthHeaders();
-
 		self::initPaths();
+		self::registerAutoloaderCache();
 
-		// The class loader takes an optional low-latency cache, which MUST be
-		// namespaced. The instanceid is used for namespacing, but might be
-		// unavailable at this point. Futhermore, it might not be possible to
-		// generate an instanceid via \OC_Util::getInstanceId() because the
-		// config file may not be writable. As such, we only register a class
-		// loader cache if instanceid is available without trying to create one.
-		$instanceId = OC_Config::getValue('instanceid', null);
-		if ($instanceId) {
-			try {
-				$memcacheFactory = new \OC\Memcache\Factory($instanceId);
-				self::$loader->setMemoryCache($memcacheFactory->createLowLatency('Autoloader'));
-			} catch (\Exception $ex) {
-			}
-		}
 		OC_Util::isSetLocaleWorking();
 
 		// setup 3rdparty autoloader
@@ -649,6 +635,23 @@ class OC {
 		}
 	}
 
+	protected static function registerAutoloaderCache() {
+		// The class loader takes an optional low-latency cache, which MUST be
+		// namespaced. The instanceid is used for namespacing, but might be
+		// unavailable at this point. Futhermore, it might not be possible to
+		// generate an instanceid via \OC_Util::getInstanceId() because the
+		// config file may not be writable. As such, we only register a class
+		// loader cache if instanceid is available without trying to create one.
+		$instanceId = OC_Config::getValue('instanceid', null);
+		if ($instanceId) {
+			try {
+				$memcacheFactory = new \OC\Memcache\Factory($instanceId);
+				self::$loader->setMemoryCache($memcacheFactory->createLowLatency('Autoloader'));
+			} catch (\Exception $ex) {
+			}
+		}
+	}
+
 	/**
 	 * Handle the request
 	 */

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list