Merged in ronald-quentaprocessmaker/processmaker/HOR-1726 (pull request #4829)

Hor 1726
This commit is contained in:
Julio Cesar Laura Avendaño
2016-08-29 16:16:11 -04:00

View File

@@ -135,6 +135,12 @@ class workspaceTools
$this->migrateContent($workSpace, $lang); $this->migrateContent($workSpace, $lang);
$stop = microtime(true); $stop = microtime(true);
CLI::logging("<*> Optimizing content data took " . ($stop - $start) . " seconds.\n"); CLI::logging("<*> Optimizing content data took " . ($stop - $start) . " seconds.\n");
$start = microtime(true);
CLI::logging("> Clean access and refresh tokens...\n");
$this->cleanTokens($workSpace);
$stop = microtime(true);
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){ public function migrateIteeToDummytask($workspaceName){
$this->initPropel(true); $this->initPropel(true);
if (!defined("SYS_SYS")) { if (!defined("SYS_SYS")) {