diff options
author | Morris Jobke <hey@morrisjobke.de> | 2014-10-22 11:18:26 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2014-10-22 11:18:26 +0200 |
commit | e2ff18052176278a5801e4e6638d64bc076798f1 (patch) | |
tree | b7c33c0492bb80edab1f2399dacbccfa84bebbd9 /lib/base.php | |
parent | 916e710ece8ee99c634551701d0b79d5398882de (diff) | |
parent | 2814a294c8a80b179c1087eb5a09ced555c3aca3 (diff) | |
download | nextcloud-server-e2ff18052176278a5801e4e6638d64bc076798f1.tar.gz nextcloud-server-e2ff18052176278a5801e4e6638d64bc076798f1.zip |
Merge pull request #11416 from owncloud/eventlogger
Allow apps to gather performance diagnistics
Diffstat (limited to 'lib/base.php')
-rw-r--r-- | lib/base.php | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/base.php b/lib/base.php index 5ba8d3829ca..23f0e594510 100644 --- a/lib/base.php +++ b/lib/base.php @@ -444,6 +444,7 @@ class OC { public static function init() { // register autoloader + $loaderStart = microtime(true); require_once __DIR__ . '/autoloader.php'; self::$loader = new \OC\Autoloader(); self::$loader->registerPrefix('Doctrine\\Common', 'doctrine/common/lib'); @@ -453,6 +454,13 @@ class OC { self::$loader->registerPrefix('Patchwork', '3rdparty'); self::$loader->registerPrefix('Pimple', '3rdparty/Pimple'); spl_autoload_register(array(self::$loader, 'load')); + $loaderEnd = microtime(true); + + // setup the basic server + self::initPaths(); + self::$server = new \OC\Server(); + \OC::$server->getEventLogger()->log('autoloader', 'Autoloader', $loaderStart, $loaderEnd); + \OC::$server->getEventLogger()->start('boot', 'Initialize'); // set some stuff //ob_start(); @@ -469,7 +477,6 @@ class OC { if (get_magic_quotes_gpc() == 1) { ini_set('magic_quotes_runtime', 0); } - //try to configure php to enable big file uploads. //this doesn´t work always depending on the webserver and php configuration. //Let´s try to overwrite some defaults anyways @@ -485,9 +492,9 @@ class OC { @ini_set('file_uploads', '50'); self::handleAuthHeaders(); - self::initPaths(); self::registerAutoloaderCache(); + OC_Util::isSetLocaleWorking(); // setup 3rdparty autoloader @@ -516,9 +523,8 @@ class OC { stream_wrapper_register('quota', 'OC\Files\Stream\Quota'); stream_wrapper_register('oc', 'OC\Files\Stream\OC'); - // setup the basic server - self::$server = new \OC\Server(); + \OC::$server->getEventLogger()->start('init_session', 'Initialize session'); self::initTemplateEngine(); OC_App::loadApps(array('session')); if (self::$CLI) { @@ -526,6 +532,7 @@ class OC { } else { self::initSession(); } + \OC::$server->getEventLogger()->end('init_session'); self::checkConfig(); self::checkInstalled(); self::checkSSL(); @@ -612,6 +619,7 @@ class OC { exit(); } + \OC::$server->getEventLogger()->end('boot'); } private static function registerLocalAddressBook() { @@ -701,6 +709,7 @@ class OC { * Handle the request */ public static function handleRequest() { + \OC::$server->getEventLogger()->start('handle_request', 'Handle request'); // load all the classpaths from the enabled apps so they are available // in the routing files of each app OC::loadAppClassPaths(); |