Forráskód Böngészése

System update (painless update from previous version)

markseu 8 éve
szülő
commit
fb2f5e4c90
1 módosított fájl, 8 hozzáadás és 0 törlés
  1. 8 0
      system/plugins/update.php

+ 8 - 0
system/plugins/update.php

@@ -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");