From: Alexander Ebert Date: Sun, 2 Jun 2013 18:54:50 +0000 (+0200) Subject: Added more performance logging during WCFSetup X-Git-Tag: 2.0.0_Beta_3~29 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=475b6fb6c11bd5caa377a70e4345a48d0e70f3b3;p=GitHub%2FWoltLab%2FWCF.git Added more performance logging during WCFSetup --- diff --git a/wcfsetup/install/files/lib/system/WCFSetup.class.php b/wcfsetup/install/files/lib/system/WCFSetup.class.php index d260beecad..8ee2ef5390 100644 --- a/wcfsetup/install/files/lib/system/WCFSetup.class.php +++ b/wcfsetup/install/files/lib/system/WCFSetup.class.php @@ -614,6 +614,9 @@ class WCFSetup extends WCF { $db = new $dbClass($dbHost, $dbUser, $dbPassword, $dbName, $dbPort); $db->connect(); + $start = microtime(true); + file_put_contents(WCF_DIR.'__wcfSetupPerformance.log', "Validating database ...", FILE_APPEND); + // check sql version if (!empty($availableDBClasses[$dbClass]['minversion'])) { $sqlVersion = $db->getVersion(); @@ -625,9 +628,16 @@ class WCFSetup extends WCF { } } + $end = microtime(true); + file_put_contents(WCF_DIR.'__wcfSetupPerformance.log', round($end - $start, 3)."\nChecking for table conflicts ...", FILE_APPEND); + $start = $end; + // check for table conflicts $conflictedTables = $this->getConflictedTables($db, $dbNumber); + $end = microtime(true); + file_put_contents(WCF_DIR.'__wcfSetupPerformance.log', round($end - $start, 3)."\n\n", FILE_APPEND); + // write config.inc if (empty($conflictedTables)) { // connection successfully established @@ -708,6 +718,9 @@ class WCFSetup extends WCF { protected function createDB() { $this->initDB(); + $start = microtime(true); + file_put_contents(WCF_DIR.'__wcfSetupPerformance.log', "Creating database ...", FILE_APPEND); + // get content of the sql structure file $sql = file_get_contents(TMP_DIR.'setup/db/install.sql'); @@ -746,6 +759,9 @@ class WCFSetup extends WCF { )); $this->gotoNextStep('logFiles'); + + $end = microtime(true); + file_put_contents(WCF_DIR.'__wcfSetupPerformance.log', round($end - $start, 3) . "\n\n", FILE_APPEND); } /** @@ -756,7 +772,7 @@ class WCFSetup extends WCF { $this->getInstalledFiles(WCF_DIR); $acpTemplateInserts = $fileInserts = array(); - file_put_contents(WCF_DIR.'__wcfSetupPerformance.log', "Logging files:\n"); + file_put_contents(WCF_DIR.'__wcfSetupPerformance.log', "Logging files:\n", FILE_APPEND); $start = microtime(true); foreach (self::$installedFiles as $file) { $match = array();