From 6d4168c224b09f7b8e9e4e0967ff605a5fd4afc3 Mon Sep 17 00:00:00 2001 From: Ronald Q Date: Mon, 29 Aug 2016 11:06:44 -0400 Subject: [PATCH 1/2] HOR-1726 --- workflow/engine/classes/class.wsTools.php | 159 ++++++++++++---------- 1 file changed, 89 insertions(+), 70 deletions(-) diff --git a/workflow/engine/classes/class.wsTools.php b/workflow/engine/classes/class.wsTools.php index e487aa9c9..8e1e510e3 100755 --- a/workflow/engine/classes/class.wsTools.php +++ b/workflow/engine/classes/class.wsTools.php @@ -62,79 +62,85 @@ class workspaceTools */ public function upgrade($first = false, $buildCacheView = false, $workSpace = SYS_SYS, $onedb = false, $lang = 'en') { - $start = microtime(true); - CLI::logging("> Updating database...\n"); - $this->upgradeDatabase($onedb); - $stop = microtime(true); - CLI::logging("<*> Database Upgrade Process took " . ($stop - $start) . " seconds.\n"); +// $start = microtime(true); +// CLI::logging("> Updating database...\n"); +// $this->upgradeDatabase($onedb); +// $stop = microtime(true); +// CLI::logging("<*> Database Upgrade Process took " . ($stop - $start) . " seconds.\n"); +// +// $start = microtime(true); +// CLI::logging("> Check Intermediate Email Event...\n"); +// $this->checkIntermediateEmailEvent(); +// $stop = microtime(true); +// CLI::logging("<*> Database Upgrade Process took " . ($stop - $start) . " seconds.\n"); +// +// $start = microtime(true); +// CLI::logging("> Verify enterprise old...\n"); +// $this->verifyFilesOldEnterprise($workSpace); +// $stop = microtime(true); +// CLI::logging("<*> Verify took " . ($stop - $start) . " seconds.\n"); +// +// $start = microtime(true); +// CLI::logging("> Updating translations...\n"); +// $this->upgradeTranslation($first); +// $stop = microtime(true); +// $final = $stop - $start; +// CLI::logging("<*> Updating Translations Process took $final seconds.\n"); +// +// $start = microtime(true); +// CLI::logging("> Updating Content...\n"); +// $this->upgradeContent($workSpace); +// $stop = microtime(true); +// $final = $stop - $start; +// CLI::logging("<*> Updating Content Process took $final seconds.\n"); +// +// $start = microtime(true); +// CLI::logging("> Check Mafe Requirements...\n"); +// $this->checkMafeRequirements($workSpace, $lang); +// $stop = microtime(true); +// $final = $stop - $start; +// CLI::logging("<*> Check Mafe Requirements Process took $final seconds.\n"); +// +// $start = microtime(true); +// CLI::logging("> Updating cache view...\n"); +// $this->upgradeCacheView($buildCacheView, true, $lang); +// $stop = microtime(true); +// $final = $stop - $start; +// CLI::logging("<*> Updating cache view Process took $final seconds.\n"); +// +// $start = microtime(true); +// CLI::logging("> Backup log files...\n"); +// $this->backupLogFiles(); +// $stop = microtime(true); +// $final = $stop - $start; +// CLI::logging("<*> Backup log files Process took $final seconds.\n"); +// +// /*----------------------------------********---------------------------------*/ +// $start = microtime(true); +// CLI::logging("> Migrate new lists...\n"); +// $this->migrateList($workSpace, false, $lang); +// $stop = microtime(true); +// $final = $stop - $start; +// CLI::logging("<*> Migrate new lists Process took $final seconds.\n"); +// /*----------------------------------********---------------------------------*/ +// +// $start = microtime(true); +// CLI::logging("> Updating Files Manager...\n"); +// $this->processFilesUpgrade(); +// $stop = microtime(true); +// CLI::logging("<*> Updating Files Manager took " . ($stop - $start) . " seconds.\n"); +// +// $start = microtime(true); +// CLI::logging("> Optimizing content data...\n"); +// $this->migrateContent($workSpace, $lang); +// $stop = microtime(true); +// CLI::logging("<*> Optimizing content data took " . ($stop - $start) . " seconds.\n"); $start = microtime(true); - CLI::logging("> Check Intermediate Email Event...\n"); - $this->checkIntermediateEmailEvent(); + CLI::logging("> Clean access and refresh tokens...\n"); + $this->cleanTokens($workSpace); $stop = microtime(true); - CLI::logging("<*> Database Upgrade Process took " . ($stop - $start) . " seconds.\n"); - - $start = microtime(true); - CLI::logging("> Verify enterprise old...\n"); - $this->verifyFilesOldEnterprise($workSpace); - $stop = microtime(true); - CLI::logging("<*> Verify took " . ($stop - $start) . " seconds.\n"); - - $start = microtime(true); - CLI::logging("> Updating translations...\n"); - $this->upgradeTranslation($first); - $stop = microtime(true); - $final = $stop - $start; - CLI::logging("<*> Updating Translations Process took $final seconds.\n"); - - $start = microtime(true); - CLI::logging("> Updating Content...\n"); - $this->upgradeContent($workSpace); - $stop = microtime(true); - $final = $stop - $start; - CLI::logging("<*> Updating Content Process took $final seconds.\n"); - - $start = microtime(true); - CLI::logging("> Check Mafe Requirements...\n"); - $this->checkMafeRequirements($workSpace, $lang); - $stop = microtime(true); - $final = $stop - $start; - CLI::logging("<*> Check Mafe Requirements Process took $final seconds.\n"); - - $start = microtime(true); - CLI::logging("> Updating cache view...\n"); - $this->upgradeCacheView($buildCacheView, true, $lang); - $stop = microtime(true); - $final = $stop - $start; - CLI::logging("<*> Updating cache view Process took $final seconds.\n"); - - $start = microtime(true); - CLI::logging("> Backup log files...\n"); - $this->backupLogFiles(); - $stop = microtime(true); - $final = $stop - $start; - CLI::logging("<*> Backup log files Process took $final seconds.\n"); - - /*----------------------------------********---------------------------------*/ - $start = microtime(true); - CLI::logging("> Migrate new lists...\n"); - $this->migrateList($workSpace, false, $lang); - $stop = microtime(true); - $final = $stop - $start; - CLI::logging("<*> Migrate new lists Process took $final seconds.\n"); - /*----------------------------------********---------------------------------*/ - - $start = microtime(true); - CLI::logging("> Updating Files Manager...\n"); - $this->processFilesUpgrade(); - $stop = microtime(true); - CLI::logging("<*> Updating Files Manager took " . ($stop - $start) . " seconds.\n"); - - $start = microtime(true); - CLI::logging("> Optimizing content data...\n"); - $this->migrateContent($workSpace, $lang); - $stop = microtime(true); - CLI::logging("<*> Optimizing content data took " . ($stop - $start) . " seconds.\n"); + CLI::logging("<*> Clean access and refresh tokens took " . ($stop - $start) . " seconds.\n"); } /** @@ -3221,6 +3227,19 @@ class workspaceTools } } + public function cleanTokens($workspace, $lang = SYS_LANG) + { + $this->initPropel(true); + $oCriteria = new Criteria(); + $oCriteria->add(OauthAccessTokensPeer::ACCESS_TOKEN, 0, Criteria::NOT_EQUAL); + $accessToken = OauthAccessTokensPeer::doDelete($oCriteria); + CLI::logging("|--> Clean data in table " . OauthAccessTokensPeer::TABLE_NAME . " rows ".$accessToken."\n"); + $oCriteria = new Criteria(); + $oCriteria->add(OauthRefreshTokensPeer::REFRESH_TOKEN, 0, Criteria::NOT_EQUAL); + $refreshToken = OauthRefreshTokensPeer::doDelete($oCriteria); + CLI::logging("|--> Clean data in table " . OauthRefreshTokensPeer::TABLE_NAME . " rows ".$refreshToken."\n"); + } + public function migrateIteeToDummytask($workspaceName){ $this->initPropel(true); if (!defined("SYS_SYS")) { From 8a779bf400f8b6dfcb75d4a341413f89a4ff3be9 Mon Sep 17 00:00:00 2001 From: Ronald Q Date: Mon, 29 Aug 2016 11:08:27 -0400 Subject: [PATCH 2/2] HOR-1726 remove comment --- workflow/engine/classes/class.wsTools.php | 146 +++++++++++----------- 1 file changed, 73 insertions(+), 73 deletions(-) diff --git a/workflow/engine/classes/class.wsTools.php b/workflow/engine/classes/class.wsTools.php index 8e1e510e3..b3c485630 100755 --- a/workflow/engine/classes/class.wsTools.php +++ b/workflow/engine/classes/class.wsTools.php @@ -62,79 +62,79 @@ class workspaceTools */ public function upgrade($first = false, $buildCacheView = false, $workSpace = SYS_SYS, $onedb = false, $lang = 'en') { -// $start = microtime(true); -// CLI::logging("> Updating database...\n"); -// $this->upgradeDatabase($onedb); -// $stop = microtime(true); -// CLI::logging("<*> Database Upgrade Process took " . ($stop - $start) . " seconds.\n"); -// -// $start = microtime(true); -// CLI::logging("> Check Intermediate Email Event...\n"); -// $this->checkIntermediateEmailEvent(); -// $stop = microtime(true); -// CLI::logging("<*> Database Upgrade Process took " . ($stop - $start) . " seconds.\n"); -// -// $start = microtime(true); -// CLI::logging("> Verify enterprise old...\n"); -// $this->verifyFilesOldEnterprise($workSpace); -// $stop = microtime(true); -// CLI::logging("<*> Verify took " . ($stop - $start) . " seconds.\n"); -// -// $start = microtime(true); -// CLI::logging("> Updating translations...\n"); -// $this->upgradeTranslation($first); -// $stop = microtime(true); -// $final = $stop - $start; -// CLI::logging("<*> Updating Translations Process took $final seconds.\n"); -// -// $start = microtime(true); -// CLI::logging("> Updating Content...\n"); -// $this->upgradeContent($workSpace); -// $stop = microtime(true); -// $final = $stop - $start; -// CLI::logging("<*> Updating Content Process took $final seconds.\n"); -// -// $start = microtime(true); -// CLI::logging("> Check Mafe Requirements...\n"); -// $this->checkMafeRequirements($workSpace, $lang); -// $stop = microtime(true); -// $final = $stop - $start; -// CLI::logging("<*> Check Mafe Requirements Process took $final seconds.\n"); -// -// $start = microtime(true); -// CLI::logging("> Updating cache view...\n"); -// $this->upgradeCacheView($buildCacheView, true, $lang); -// $stop = microtime(true); -// $final = $stop - $start; -// CLI::logging("<*> Updating cache view Process took $final seconds.\n"); -// -// $start = microtime(true); -// CLI::logging("> Backup log files...\n"); -// $this->backupLogFiles(); -// $stop = microtime(true); -// $final = $stop - $start; -// CLI::logging("<*> Backup log files Process took $final seconds.\n"); -// -// /*----------------------------------********---------------------------------*/ -// $start = microtime(true); -// CLI::logging("> Migrate new lists...\n"); -// $this->migrateList($workSpace, false, $lang); -// $stop = microtime(true); -// $final = $stop - $start; -// CLI::logging("<*> Migrate new lists Process took $final seconds.\n"); -// /*----------------------------------********---------------------------------*/ -// -// $start = microtime(true); -// CLI::logging("> Updating Files Manager...\n"); -// $this->processFilesUpgrade(); -// $stop = microtime(true); -// CLI::logging("<*> Updating Files Manager took " . ($stop - $start) . " seconds.\n"); -// -// $start = microtime(true); -// CLI::logging("> Optimizing content data...\n"); -// $this->migrateContent($workSpace, $lang); -// $stop = microtime(true); -// CLI::logging("<*> Optimizing content data took " . ($stop - $start) . " seconds.\n"); + $start = microtime(true); + CLI::logging("> Updating database...\n"); + $this->upgradeDatabase($onedb); + $stop = microtime(true); + CLI::logging("<*> Database Upgrade Process took " . ($stop - $start) . " seconds.\n"); + + $start = microtime(true); + CLI::logging("> Check Intermediate Email Event...\n"); + $this->checkIntermediateEmailEvent(); + $stop = microtime(true); + CLI::logging("<*> Database Upgrade Process took " . ($stop - $start) . " seconds.\n"); + + $start = microtime(true); + CLI::logging("> Verify enterprise old...\n"); + $this->verifyFilesOldEnterprise($workSpace); + $stop = microtime(true); + CLI::logging("<*> Verify took " . ($stop - $start) . " seconds.\n"); + + $start = microtime(true); + CLI::logging("> Updating translations...\n"); + $this->upgradeTranslation($first); + $stop = microtime(true); + $final = $stop - $start; + CLI::logging("<*> Updating Translations Process took $final seconds.\n"); + + $start = microtime(true); + CLI::logging("> Updating Content...\n"); + $this->upgradeContent($workSpace); + $stop = microtime(true); + $final = $stop - $start; + CLI::logging("<*> Updating Content Process took $final seconds.\n"); + + $start = microtime(true); + CLI::logging("> Check Mafe Requirements...\n"); + $this->checkMafeRequirements($workSpace, $lang); + $stop = microtime(true); + $final = $stop - $start; + CLI::logging("<*> Check Mafe Requirements Process took $final seconds.\n"); + + $start = microtime(true); + CLI::logging("> Updating cache view...\n"); + $this->upgradeCacheView($buildCacheView, true, $lang); + $stop = microtime(true); + $final = $stop - $start; + CLI::logging("<*> Updating cache view Process took $final seconds.\n"); + + $start = microtime(true); + CLI::logging("> Backup log files...\n"); + $this->backupLogFiles(); + $stop = microtime(true); + $final = $stop - $start; + CLI::logging("<*> Backup log files Process took $final seconds.\n"); + + /*----------------------------------********---------------------------------*/ + $start = microtime(true); + CLI::logging("> Migrate new lists...\n"); + $this->migrateList($workSpace, false, $lang); + $stop = microtime(true); + $final = $stop - $start; + CLI::logging("<*> Migrate new lists Process took $final seconds.\n"); + /*----------------------------------********---------------------------------*/ + + $start = microtime(true); + CLI::logging("> Updating Files Manager...\n"); + $this->processFilesUpgrade(); + $stop = microtime(true); + CLI::logging("<*> Updating Files Manager took " . ($stop - $start) . " seconds.\n"); + + $start = microtime(true); + CLI::logging("> Optimizing content data...\n"); + $this->migrateContent($workSpace, $lang); + $stop = microtime(true); + CLI::logging("<*> Optimizing content data took " . ($stop - $start) . " seconds.\n"); $start = microtime(true); CLI::logging("> Clean access and refresh tokens...\n");