System update (painless update from previous version)

This commit is contained in:
markseu 2017-06-18 12:48:26 +02:00
parent e1d52bb878
commit fb2f5e4c90

View file

@ -23,6 +23,14 @@ class YellowUpdate
// Handle startup
function onStartup($update)
{
if(filesize("yellow.php")==591 || filesize("yellow.php")==609) //TODO: remove later, detects old version
{
$update = true;
$fileData = $this->yellow->toolbox->readFile($fileNameScript);
$fileData = preg_replace("#yellow->plugins->load\(\)#", "yellow->load()", $fileData);
$this->yellow->toolbox->createFile($fileNameScript, $fileData);
}
if($update) //TODO: remove later, converts old config file
{
$fileNameConfig = $this->yellow->config->get("configDir").$this->yellow->config->get("configFile");