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

@@ -919,7 +919,8 @@ var r2=new leimnud.module.rpc.xmlhttp({url:this.options.dataServer,args:"action=
else{var msg=_("ID_TASK_CANT_DELETE");msg=msg.replace("{0}",data.label);msg=msg.replace("{1}",casesNumRec);new this.parent.module.app.info().make({label:msg});}}.extend(this);r.make();return;if(confirm(G_STRINGS.ID_PROCESSMAP_CONFIRM_DELETE_TASK+" "+data.label)) else{var msg=_("ID_TASK_CANT_DELETE");msg=msg.replace("{0}",data.label);msg=msg.replace("{1}",casesNumRec);new this.parent.module.app.info().make({label:msg});}}.extend(this);r.make();return;if(confirm(G_STRINGS.ID_PROCESSMAP_CONFIRM_DELETE_TASK+" "+data.label))
{data.object.drag.flush();this.dropables.derivation.unregister(data.object.dropIndex);this.data.render.deleteDerivation(data.uid);this.parent.dom.remove(data.object.elements);var r=new leimnud.module.rpc.xmlhttp({url:this.options.dataServer,args:"action=deleteTask&data="+{pro_uid:this.options.uid,tas_uid:data.uid}.toJSONString()});r.make();}},args:index})},{simage:"/images/properties.png",text:G_STRINGS.ID_PROCESSMAP_PROPERTIES,launch:this.parent.closure({instance:this,method:function(index){var panel;var iForm=function(panel,index,ifo){if(typeof(panel.flag)=='undefined'){if(!saveDataTaskTemporal(ifo)){var tabPass=panel.tabSelected;panel.tabSelected=panel.tabLastSelected;panel.tabLastSelected=tabPass;panel.flag=true;panel.makeTab();return false;}} {data.object.drag.flush();this.dropables.derivation.unregister(data.object.dropIndex);this.data.render.deleteDerivation(data.uid);this.parent.dom.remove(data.object.elements);var r=new leimnud.module.rpc.xmlhttp({url:this.options.dataServer,args:"action=deleteTask&data="+{pro_uid:this.options.uid,tas_uid:data.uid}.toJSONString()});r.make();}},args:index})},{simage:"/images/properties.png",text:G_STRINGS.ID_PROCESSMAP_PROPERTIES,launch:this.parent.closure({instance:this,method:function(index){var panel;var iForm=function(panel,index,ifo){if(typeof(panel.flag)=='undefined'){if(!saveDataTaskTemporal(ifo)){var tabPass=panel.tabSelected;panel.tabSelected=panel.tabLastSelected;panel.tabLastSelected=tabPass;panel.flag=true;panel.makeTab();return false;}}
delete panel.flag;panel.command(panel.loader.show);var r=new this.parent.module.rpc.xmlhttp({url:this.options.dataServer,args:"action=editTaskProperties&data="+{uid:data.uid,iForm:ifo,index:index}.toJSONString()});r.callback=this.parent.closure({instance:this,method:function(index,rpc,panel){panel.command(panel.loader.hide);panel.clearContent();var scs=rpc.xmlhttp.responseText.extractScript();panel.addContent(rpc.xmlhttp.responseText.stripScript());scs.evalScript();},args:[index,r,panel]});r.make();} delete panel.flag;panel.command(panel.loader.show);var r=new this.parent.module.rpc.xmlhttp({url:this.options.dataServer,args:"action=editTaskProperties&data="+{uid:data.uid,iForm:ifo,index:index}.toJSONString()});r.callback=this.parent.closure({instance:this,method:function(index,rpc,panel){panel.command(panel.loader.hide);panel.clearContent();var scs=rpc.xmlhttp.responseText.extractScript();panel.addContent(rpc.xmlhttp.responseText.stripScript());scs.evalScript();},args:[index,r,panel]});r.make();}
this.tmp.propertiesPanel=panel=new leimnud.module.panel();var data=this.data.db.task[index];panel.options={limit:true,size:{w:600,h:430},position:{x:50,y:50,center:true},title:G_STRINGS.ID_PROCESSMAP_TASK+": "+data.label.substr(0,75)+(data.label.length>=75?"...":""),theme:this.options.theme,statusBar:true,statusBarButtons:[{type:"button",value:G_STRINGS.ID_PROCESSMAP_SUBMIT},{type:"button",value:G_STRINGS.ID_PROCESSMAP_CANCEL}],control:{close:true,resize:false},fx:{modal:true}};panel.tab={width:170,optWidth:160,widthFixed:false,step:(this.parent.browser.isIE?3:4),options:[{title:G_STRINGS.ID_PROCESSMAP_TASK_PROPERTIES_DEFINITION,content:this.parent.closure({instance:this,method:iForm,args:[panel,index,1]}),noClear:true,selected:true},{title:G_STRINGS.ID_PROCESSMAP_TASK_PROPERTIES_ASSIGNMENTS,content:this.parent.closure({instance:this,method:iForm,args:[panel,index,2]}),noClear:true},{title:G_STRINGS.ID_PROCESSMAP_TASK_PROPERTIES_TIMING,content:this.parent.closure({instance:this,method:iForm,args:[panel,index,3]}),noClear:true},{title:G_STRINGS.ID_PROCESSMAP_TASK_PROPERTIES_PERMISSIONS,content:this.parent.closure({instance:this,method:iForm,args:[panel,index,5]}),noClear:true},{title:G_STRINGS.ID_PROCESSMAP_TASK_PROPERTIES_LABELS,content:this.parent.closure({instance:this,method:iForm,args:[panel,index,6]}),noClear:true},{title:G_STRINGS.ID_PROCESSMAP_TASK_PROPERTIES_NOTIFICATIONS,content:this.parent.closure({instance:this,method:iForm,args:[panel,index,7]}),noClear:true}]};var taskOptions=this.data.db.taskOptions;this.loadExtendedProperties=function(){for(i=0;i<taskOptions.length;i++){anElement={title:taskOptions[i].title,content:this.parent.closure({instance:this,method:iForm,args:[panel,index,taskOptions[i].id]}),noClear:true};panel.tab.options.push(anElement);}};this.loadExtendedProperties();panel.make();},args:index})}]:[{image:"/images/rules.png",text:G_STRINGS.ID_PROCESSMAP_WORKFLOW_PATTERNS,launch:this.patternPanel.args(index)},{image:"/images/delete_rules.png",text:G_STRINGS.ID_PROCESSMAP_WORKFLOW_DELETE_PATTERNS,launch:this.parent.closure({instance:this,method:function(){var data=this.data.db.task[index];if(typeof(data.derivation.type)!='undefined'){new this.parent.module.app.confirm().make({label:G_STRINGS.ID_PROCESSMAP_WORKFLOW_CONFIRM_DELETE_PATTERNS+'"'+data.label+'"?',action:function(){var db=this.data.db,task=db.task[index];var vars={tas_uid:task.uid,pro_uid:this.options.uid};var aData={};aData.tas_uid=vars.tas_uid;aData.data=[];this.data.build.derivation(aData);var r=new leimnud.module.rpc.xmlhttp({url:this.options.dataServer,args:'action=deleteAllRoutes&data='+vars.toJSONString()});r.make();}.extend(this)});} this.tmp.propertiesPanel=panel=new leimnud.module.panel();var data=this.data.db.task[index];panel.options={limit:true,size:{w:600,h:430},position:{x:50,y:50,center:true},title:G_STRINGS.ID_PROCESSMAP_TASK+": "+data.label.substr(0,75)+(data.label.length>=75?"...":""),theme:this.options.theme,statusBar:true,statusBarButtons:[{type:"button",value:G_STRINGS.ID_PROCESSMAP_SUBMIT},{type:"button",value:G_STRINGS.ID_PROCESSMAP_CANCEL}],control:{close:true,resize:false},fx:{modal:true}};panel.tab={width:170,optWidth:160,widthFixed:false,step:(this.parent.browser.isIE?3:4),options:[{title:G_STRINGS.ID_PROCESSMAP_TASK_PROPERTIES_DEFINITION,content:this.parent.closure({instance:this,method:iForm,args:[panel,index,1]}),noClear:true,selected:true},{title:G_STRINGS.ID_PROCESSMAP_TASK_PROPERTIES_ASSIGNMENTS,content:this.parent.closure({instance:this,method:iForm,args:[panel,index,2]}),noClear:true},{title:G_STRINGS.ID_PROCESSMAP_TASK_PROPERTIES_TIMING,content:this.parent.closure({instance:this,method:iForm,args:[panel,index,3]}),noClear:true},{title:G_STRINGS.ID_PROCESSMAP_TASK_PROPERTIES_PERMISSIONS,content:this.parent.closure({instance:this,method:iForm,args:[panel,index,5]}),noClear:true},{title:G_STRINGS.ID_PROCESSMAP_TASK_PROPERTIES_LABELS,content:this.parent.closure({instance:this,method:iForm,args:[panel,index,6]}),noClear:true},{title:G_STRINGS.ID_PROCESSMAP_TASK_PROPERTIES_NOTIFICATIONS,content:this.parent.closure({instance:this,method:iForm,args:[panel,index,7]}),noClear:true}]};if(this.options.consolidated=='1'){panel.tab.options.push({title:_('ID_CONSOLIDATED_CASE_LIST'),content:this.parent.closure({instance:this,method:iForm,args:[panel,index,8]}),noClear:true});}
var taskOptions=this.data.db.taskOptions;this.loadExtendedProperties=function(){for(i=0;i<taskOptions.length;i++){anElement={title:taskOptions[i].title,content:this.parent.closure({instance:this,method:iForm,args:[panel,index,taskOptions[i].id]}),noClear:true};panel.tab.options.push(anElement);}};this.loadExtendedProperties();panel.make();},args:index})}]:[{image:"/images/rules.png",text:G_STRINGS.ID_PROCESSMAP_WORKFLOW_PATTERNS,launch:this.patternPanel.args(index)},{image:"/images/delete_rules.png",text:G_STRINGS.ID_PROCESSMAP_WORKFLOW_DELETE_PATTERNS,launch:this.parent.closure({instance:this,method:function(){var data=this.data.db.task[index];if(typeof(data.derivation.type)!='undefined'){new this.parent.module.app.confirm().make({label:G_STRINGS.ID_PROCESSMAP_WORKFLOW_CONFIRM_DELETE_PATTERNS+'"'+data.label+'"?',action:function(){var db=this.data.db,task=db.task[index];var vars={tas_uid:task.uid,pro_uid:this.options.uid};var aData={};aData.tas_uid=vars.tas_uid;aData.data=[];this.data.build.derivation(aData);var r=new leimnud.module.rpc.xmlhttp({url:this.options.dataServer,args:'action=deleteAllRoutes&data='+vars.toJSONString()});r.make();}.extend(this)});}
else{new leimnud.module.app.alert().make({label:G_STRINGS.ID_NO_DERIVATIONS_DEFINED});}},args:index})},{image:"/images/delete.png",text:G_STRINGS.ID_PROCESSMAP_DELETE_SUBPROCESS,launch:this.parent.closure({instance:this,method:function(index){var data=this.data.db.task[index];new this.parent.module.app.confirm().make({label:G_STRINGS.ID_PROCESSMAP_CONFIRM_DELETE_SUBPROCESS+data.label,action:function() else{new leimnud.module.app.alert().make({label:G_STRINGS.ID_NO_DERIVATIONS_DEFINED});}},args:index})},{image:"/images/delete.png",text:G_STRINGS.ID_PROCESSMAP_DELETE_SUBPROCESS,launch:this.parent.closure({instance:this,method:function(index){var data=this.data.db.task[index];new this.parent.module.app.confirm().make({label:G_STRINGS.ID_PROCESSMAP_CONFIRM_DELETE_SUBPROCESS+data.label,action:function()
{data.object.drag.flush();this.dropables.derivation.unregister(data.object.dropIndex);this.data.render.deleteDerivation(data.uid,true);this.parent.dom.remove(data.object.elements);var r=new leimnud.module.rpc.xmlhttp({url:this.options.dataServer,args:"action=deleteSubProcess&data="+{pro_uid:this.options.uid,tas_uid:data.uid}.toJSONString()});r.make();}.extend(this)});return;if(confirm(G_STRINGS.ID_PROCESSMAP_CONFIRM_DELETE_TASK+data.label)) {data.object.drag.flush();this.dropables.derivation.unregister(data.object.dropIndex);this.data.render.deleteDerivation(data.uid,true);this.parent.dom.remove(data.object.elements);var r=new leimnud.module.rpc.xmlhttp({url:this.options.dataServer,args:"action=deleteSubProcess&data="+{pro_uid:this.options.uid,tas_uid:data.uid}.toJSONString()});r.make();}.extend(this)});return;if(confirm(G_STRINGS.ID_PROCESSMAP_CONFIRM_DELETE_TASK+data.label))
{data.object.drag.flush();this.dropables.derivation.unregister(data.object.dropIndex);this.data.render.deleteDerivation(data.uid);this.parent.dom.remove(data.object.elements);var r=new leimnud.module.rpc.xmlhttp({url:this.options.dataServer,args:"action=deleteSubProcess="+{pro_uid:this.options.uid,tas_uid:data.uid}.toJSONString()});r.make();}},args:index})},{simage:"/images/properties.png",text:G_STRINGS.ID_PROCESSMAP_PROPERTIES,launch:function(event,index){var panel;this.tmp.subProcessPanel=panel=new leimnud.module.panel();panel.options={limit:true,size:{w:700,h:550},position:{x:50,y:50,center:true},title:G_STRINGS.ID_PROCESSMAP_PROPERTIES,theme:this.options.theme,control:{close:true,resize:false},fx:{modal:true},statusBar:false,fx:{modal:true}};panel.make();panel.loader.show();var r;panel.currentRPC=r=new leimnud.module.rpc.xmlhttp({url:this.options.dataServer,args:"action=subProcess_Properties&data="+{tas_uid:task.uid,pro_uid:this.options.uid,index:index}.toJSONString()});r.callback=function(rpc,panel) {data.object.drag.flush();this.dropables.derivation.unregister(data.object.dropIndex);this.data.render.deleteDerivation(data.uid);this.parent.dom.remove(data.object.elements);var r=new leimnud.module.rpc.xmlhttp({url:this.options.dataServer,args:"action=deleteSubProcess="+{pro_uid:this.options.uid,tas_uid:data.uid}.toJSONString()});r.make();}},args:index})},{simage:"/images/properties.png",text:G_STRINGS.ID_PROCESSMAP_PROPERTIES,launch:function(event,index){var panel;this.tmp.subProcessPanel=panel=new leimnud.module.panel();panel.options={limit:true,size:{w:700,h:550},position:{x:50,y:50,center:true},title:G_STRINGS.ID_PROCESSMAP_PROPERTIES,theme:this.options.theme,control:{close:true,resize:false},fx:{modal:true},statusBar:false,fx:{modal:true}};panel.make();panel.loader.show();var r;panel.currentRPC=r=new leimnud.module.rpc.xmlhttp({url:this.options.dataServer,args:"action=subProcess_Properties&data="+{tas_uid:task.uid,pro_uid:this.options.uid,index:index}.toJSONString()});r.callback=function(rpc,panel)
@@ -952,10 +953,15 @@ var text=this.data.db.text[index];var pos=this.parent.dom.position(text.object.e
this.data.render.lineDerivation(index);}},save:function() this.data.render.lineDerivation(index);}},save:function()
{}}.expand(this,true);this.patternPanel=function(event,index,din){var options=this.data.db.task[index];var db=this.data.db,task=db.task[index];var derivation=task.derivation.to;var vars={tas_uid:task.uid,pro_uid:this.options.uid}.concatMaborak((din)?{type:din.type,next_task:this.data.db.task[din.to].uid}:{});if(event===0||typeof(event)==='undefined'){event=window.event;} {}}.expand(this,true);this.patternPanel=function(event,index,din){var options=this.data.db.task[index];var db=this.data.db,task=db.task[index];var derivation=task.derivation.to;var vars={tas_uid:task.uid,pro_uid:this.options.uid}.concatMaborak((din)?{type:din.type,next_task:this.data.db.task[din.to].uid}:{});if(event===0||typeof(event)==='undefined'){event=window.event;}
if(event) if(event)
{if(typeof(this.data.db.task[index].derivation.type)=='undefined') {if(typeof(this.data.db.task[index].derivation.type.length)=='undefined')
{var derivationFlag='1';}
else
{if(this.data.db.task[index].derivation.type.length=='0')
{var derivationFlag='0';}}
if(typeof(this.data.db.task[index].derivation.type)=='undefined'||derivationFlag=='0')
{new leimnud.module.app.alert().make({label:G_STRINGS.ID_NO_DERIVATIONS_DEFINED});return false;} {new leimnud.module.app.alert().make({label:G_STRINGS.ID_NO_DERIVATIONS_DEFINED});return false;}
var iWidth,iHeight;switch(this.data.db.task[index].derivation.type) var iWidth,iHeight;switch(this.data.db.task[index].derivation.type)
{case 0:iWidth=450;iHeight=205;break;case 1:iWidth=700;iHeight=350;break;case 2:iWidth=700;iHeight=350;break;case 3:iWidth=350;iHeight=350;break;case 4:iWidth=600;iHeight=350;break;case 5:iWidth=450;iHeight=205;break;case 8:iWidth=550;iHeight=300;break;} {case 0:iWidth=450;iHeight=205;break;case 1:iWidth=700;iHeight=350;break;case 2:iWidth=700;iHeight=350;break;case 3:iWidth=350;iHeight=350;break;case 4:iWidth=600;iHeight=350;break;case 5:iWidth=450;iHeight=205;break;case 8:iWidth=550;iHeight=300;break;default:iWidth=400;iHeight=110;}
this.tmp.derivationsPanel=panel=new leimnud.module.panel();panel.options={limit:true,size:{w:iWidth,h:iHeight},position:{x:50,y:50,center:true},title:G_STRINGS.ID_PROCESSMAP_WORKFLOW_PATTERNS+": "+task.label,theme:this.options.theme,control:{close:true,resize:true},fx:{modal:true}};panel.make();panel.loader.show();var r=new leimnud.module.rpc.xmlhttp({url:this.options.dataServer,args:"action=derivations&data="+vars.toJSONString()});r.callback=function(rpc,panel) this.tmp.derivationsPanel=panel=new leimnud.module.panel();panel.options={limit:true,size:{w:iWidth,h:iHeight},position:{x:50,y:50,center:true},title:G_STRINGS.ID_PROCESSMAP_WORKFLOW_PATTERNS+": "+task.label,theme:this.options.theme,control:{close:true,resize:true},fx:{modal:true}};panel.make();panel.loader.show();var r=new leimnud.module.rpc.xmlhttp({url:this.options.dataServer,args:"action=derivations&data="+vars.toJSONString()});r.callback=function(rpc,panel)
{panel.loader.hide();var scs=rpc.xmlhttp.responseText.extractScript();panel.addContent(rpc.xmlhttp.responseText);scs.evalScript();}.extend(this,panel);r.make();} {panel.loader.hide();var scs=rpc.xmlhttp.responseText.extractScript();panel.addContent(rpc.xmlhttp.responseText);scs.evalScript();}.extend(this,panel);r.make();}
else else

View File

@@ -275,7 +275,7 @@ function run_cacheview_upgrade($args, $opts) {
echo "Upgrading cache view for " . pakeColor::colorize($workspace->name, "INFO") . "\n"; echo "Upgrading cache view for " . pakeColor::colorize($workspace->name, "INFO") . "\n";
$workspace->upgradeCacheView(true, false, $lang); $workspace->upgradeCacheView(true, false, $lang);
} catch (Exception $e) { } 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; return;
} }
workspaceTools::restore($filename, $workspace, $dstWorkspace, $overwrite, $lang); 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 ); call_user_func( $taskData['function'], $arguments, $taskOpts );
} catch (Exception $e) { } catch (Exception $e) {
echo self::error( "\n Error executing '$taskName':\n\n {$e->getMessage()}\n" ) . "\n"; 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->licensedfeatures = array();
$this->licensedfeaturesList = array(); $this->licensedfeaturesList = array();
if (in_array($this->result, $validStatus)) { 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['FIRST_NAME'] = $results['DATA']['FIRST_NAME'];
$info['LAST_NAME'] = $results['DATA']['LAST_NAME']; $info['LAST_NAME'] = $results['DATA']['LAST_NAME'];
$info['DOMAIN_WORKSPACE'] = $results['DATA']['DOMAIN_WORKSPACE']; $info['DOMAIN_WORKSPACE'] = $results['DATA']['DOMAIN_WORKSPACE'];

View File

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

View File

@@ -249,12 +249,12 @@ try {
unset($_CSERVER['REQUEST_TIME']); unset($_CSERVER['REQUEST_TIME']);
unset($_CSERVER['REMOTE_PORT']); unset($_CSERVER['REMOTE_PORT']);
$cput = serialize($_CSERVER); $cput = serialize($_CSERVER);
if (!is_file(PATH_DATA_SITE . PATH_SEP . '.server_info')) { if (!is_file(PATH_DATA_SITE . '.server_info')) {
file_put_contents(PATH_DATA_SITE . PATH_SEP . '.server_info', $cput); file_put_contents(PATH_DATA_SITE . '.server_info', $cput);
} else { } 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)) { 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);
} }
} }