From: Alexander Ebert Date: Wed, 15 May 2013 16:40:47 +0000 (+0200) Subject: Added performance log for WCFSetup X-Git-Tag: 2.0.0_Beta_1~179 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9a9b2f97512cf2fdfb7e366b26d6db9ed6f8b8f5;p=GitHub%2FWoltLab%2FWCF.git Added performance log for WCFSetup --- diff --git a/wcfsetup/install/files/lib/system/WCFSetup.class.php b/wcfsetup/install/files/lib/system/WCFSetup.class.php index c5162472ca..593061cc46 100644 --- a/wcfsetup/install/files/lib/system/WCFSetup.class.php +++ b/wcfsetup/install/files/lib/system/WCFSetup.class.php @@ -768,6 +768,8 @@ class WCFSetup extends WCF { $this->getInstalledFiles(WCF_DIR); $acpTemplateInserts = $fileInserts = array(); + file_put_contents(WCF_DIR.'__wcfSetupPerformance.log', "Logging files:\n"); + $start = microtime(true); foreach (self::$installedFiles as $file) { $match = array(); if (preg_match('!/acp/templates/([^/]+)\.tpl$!', $file, $match)) { @@ -779,7 +781,8 @@ class WCFSetup extends WCF { $fileInserts[] = StringUtil::replace(WCF_DIR, '', $file); } } - + file_put_contents(WCF_DIR.'__wcfSetupPerformance.log', "\tRead files: " . round(microtime(true) - $start, 3) . "\n", FILE_APPEND); + $start = microtime(true); // save acp template log if (!empty($acpTemplateInserts)) { $sql = "INSERT INTO wcf".WCF_N."_acp_template @@ -793,7 +796,8 @@ class WCFSetup extends WCF { } self::getDB()->commitTransaction(); } - + file_put_contents(WCF_DIR.'__wcfSetupPerformance.log', "\tRegistered ACP templates: " . round(microtime(true) - $start, 3) . "\n", FILE_APPEND); + $start = microtime(true); // save file log if (!empty($fileInserts)) { $sql = "INSERT INTO wcf".WCF_N."_package_installation_file_log @@ -807,7 +811,7 @@ class WCFSetup extends WCF { } self::getDB()->commitTransaction(); } - + file_put_contents(WCF_DIR.'__wcfSetupPerformance.log', "\tRegistered files: " . round(microtime(true) - $start, 3) . "\n", FILE_APPEND); $this->gotoNextStep('installLanguage'); } @@ -835,6 +839,7 @@ class WCFSetup extends WCF { protected function installLanguage() { $this->initDB(); + $start = microtime(true); foreach (self::$selectedLanguages as $language) { // get language.xml file name $filename = TMP_DIR.'install/lang/'.$language.'.xml'; @@ -851,7 +856,7 @@ class WCFSetup extends WCF { // import xml LanguageEditor::importFromXML($xml, 0); } - + file_put_contents(WCF_DIR.'__wcfSetupPerformance.log', "\nInstalled languages: " . round(microtime(true) - $start, 3) . "\n", FILE_APPEND); // set default language $language = LanguageFactory::getInstance()->getLanguageByCode(in_array(self::$selectedLanguageCode, self::$selectedLanguages) ? self::$selectedLanguageCode : self::$selectedLanguages[0]); LanguageFactory::getInstance()->makeDefault($language->languageID);