Fix workspace restore from 2.5.2 to 2.9/3.0

This commit is contained in:
Julio Cesar Laura
2015-05-10 17:16:34 -04:00
parent 5c82af6582
commit e2e45a38a4
6 changed files with 30 additions and 12 deletions

View File

@@ -275,7 +275,7 @@ function run_cacheview_upgrade($args, $opts) {
echo "Upgrading cache view for " . pakeColor::colorize($workspace->name, "INFO") . "\n";
$workspace->upgradeCacheView(true, false, $lang);
} catch (Exception $e) {
echo "Errors upgrading translation of workspace " . CLI::info($workspace->name) . ": " . CLI::error($e->getMessage()) . "\n";
echo "Errors upgrading cache view of workspace " . CLI::info($workspace->name) . ": " . CLI::error($e->getMessage()) . "\n";
}
}
}
@@ -579,7 +579,6 @@ function run_workspace_restore($args, $opts) {
return;
}
workspaceTools::restore($filename, $workspace, $dstWorkspace, $overwrite, $lang);
run_cacheview_upgrade($workspace, '');
}
}
}

View File

@@ -274,6 +274,10 @@ EOT;
call_user_func( $taskData['function'], $arguments, $taskOpts );
} catch (Exception $e) {
echo self::error( "\n Error executing '$taskName':\n\n {$e->getMessage()}\n" ) . "\n";
global $tempDirectory;
if (!empty($tempDirectory)) {
G::rm_dir($tempDirectory);
}
}
}

View File

@@ -56,7 +56,7 @@ class pmLicenseManager
$this->licensedfeatures = array();
$this->licensedfeaturesList = array();
if (in_array($this->result, $validStatus)) {
$this->serial="3ptta7Xko2prrptrZnSd356aqmPXvMrayNPFj6CLdaR1pWtrW6qPw9jV0OHjxrDGu8LVxtmSm9nP5kR23HRpdZWccpeui+bKkK<EFBFBD>DoqCt2Kqgpq6Vg37s";
$this->serial="3ptta7Xko2prrptrZnSd356aqmPXvMrayNPFj6CLdaR1pWtrW6qPw9jV0OHjxrDGu8LVxtmSm9nP5kR23HRpdZWccpeui+bKkK°DoqCt2Kqgpq6Vg37s";
$info['FIRST_NAME'] = $results['DATA']['FIRST_NAME'];
$info['LAST_NAME'] = $results['DATA']['LAST_NAME'];
$info['DOMAIN_WORKSPACE'] = $results['DATA']['DOMAIN_WORKSPACE'];

View File

@@ -1608,12 +1608,14 @@ class workspaceTools
$final = $stop - $start;
CLI::logging("<*> Verify took $final seconds.\n");
/*$start = microtime(true);
$workspace->checkMafeRequirements($workspaceName, $lang);
$start = microtime(true);
CLI::logging("> Updating cache view...\n");
$workspace->upgradeCacheView(true, false, $lang);
$stop = microtime(true);
$final = $stop - $start;
CLI::logging("<*> Updating cache view Process took $final seconds.\n");*/
CLI::logging("<*> Updating cache view Process took $final seconds.\n");
mysql_close($link);
}
@@ -1695,6 +1697,13 @@ class workspaceTools
$this->initPropel(true);
$pmRestClient = OauthClientsPeer::retrieveByPK('x-pm-local-client');
if (empty($pmRestClient)) {
if (!is_file(PATH_DATA . 'sites/' . $workspace . '/' . '.server_info')) {
$_CSERVER = $_SERVER;
unset($_CSERVER['REQUEST_TIME']);
unset($_CSERVER['REMOTE_PORT']);
$cput = serialize($_CSERVER);
file_put_contents(PATH_DATA . 'sites/' . $workspace . '/' . '.server_info', $cput);
}
if (is_file(PATH_DATA . 'sites/' . $workspace . '/' . '.server_info')) {
$SERVER_INFO = file_get_contents(PATH_DATA . 'sites/' . $workspace . '/'.'.server_info');
$SERVER_INFO = unserialize($SERVER_INFO);

View File

@@ -249,12 +249,12 @@ try {
unset($_CSERVER['REQUEST_TIME']);
unset($_CSERVER['REMOTE_PORT']);
$cput = serialize($_CSERVER);
if (!is_file(PATH_DATA_SITE . PATH_SEP . '.server_info')) {
file_put_contents(PATH_DATA_SITE . PATH_SEP . '.server_info', $cput);
if (!is_file(PATH_DATA_SITE . '.server_info')) {
file_put_contents(PATH_DATA_SITE . '.server_info', $cput);
} else {
$c = file_get_contents(PATH_DATA_SITE . PATH_SEP . '.server_info');
$c = file_get_contents(PATH_DATA_SITE . '.server_info');
if (G::encryptOld($c) != G::encryptOld($cput)) {
file_put_contents(PATH_DATA_SITE . PATH_SEP . '.server_info', $cput);
file_put_contents(PATH_DATA_SITE . '.server_info', $cput);
}
}