Added logic to update old configuration versions
This commit is contained in:
parent
38c2b90e80
commit
fdeaf9c754
|
@ -72,6 +72,25 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->Configuration = json_decode(file_get_contents($this->MasterConfigurationPath), true);
|
$this->Configuration = json_decode(file_get_contents($this->MasterConfigurationPath), true);
|
||||||
|
|
||||||
|
// Preform an upgrade
|
||||||
|
if($this->Configuration['file_version'] == '1.0.0.0')
|
||||||
|
{
|
||||||
|
$this->Configuration['file_version'] = '2.0.0.0.0';
|
||||||
|
|
||||||
|
if(isset($this->Configuration['configurations']))
|
||||||
|
{
|
||||||
|
$this->Configuration['configuration'] = $this->Configuration['configurations'];
|
||||||
|
unset($this->Configuration['configurations']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($this->Configuration['schemas']))
|
||||||
|
{
|
||||||
|
unset($this->Configuration['schemas']);
|
||||||
|
}
|
||||||
|
|
||||||
|
file_put_contents($this->MasterConfigurationPath, json_encode($this->Configuration, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"package": {
|
"package": {
|
||||||
"package_name": "net.intellivoid.acm2",
|
"package_name": "net.intellivoid.acm2",
|
||||||
"name": "Advanced Configuration Manager v2",
|
"name": "Advanced Configuration Manager v2",
|
||||||
"version": "1.0.0.2",
|
"version": "1.0.0.3",
|
||||||
"author": "Zi Xing Narrakas",
|
"author": "Zi Xing Narrakas",
|
||||||
"organization": "Intellivoid Technologies",
|
"organization": "Intellivoid Technologies",
|
||||||
"description": "Stores and manages configuration files on the system using ACM File Format",
|
"description": "Stores and manages configuration files on the system using ACM File Format",
|
||||||
|
|
Loading…
Reference in New Issue