浏览代码

System update (detect old version)

markseu 8 年之前
父节点
当前提交
0df26874fa
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      system/plugins/update.php

+ 3 - 2
system/plugins/update.php

@@ -23,11 +23,12 @@ class YellowUpdate
 	// Handle startup
 	// Handle startup
 	function onStartup($update)
 	function onStartup($update)
 	{
 	{
-		if(filesize("yellow.php")==591) //TODO: remove later, detects old version
+		if(!$this->yellow->config->isExisting("startupUpdateNotification")) //TODO: remove later, detects old version
 		{
 		{
 			$update = true;
 			$update = true;
+			$fileNameConfig = $this->yellow->config->get("configDir").$this->yellow->config->get("configFile");
+			$this->yellow->config->update($fileNameConfig, array("startupUpdateNotification" => "none"));
 			$fileData = $this->yellow->toolbox->readFile("yellow.php");
 			$fileData = $this->yellow->toolbox->readFile("yellow.php");
-			$fileData = preg_replace("#Yellow requires#", "Datenstrom Yellow requires", $fileData);
 			$fileData = preg_replace("#yellow->plugins->load\(\)#", "yellow->load()", $fileData);
 			$fileData = preg_replace("#yellow->plugins->load\(\)#", "yellow->load()", $fileData);
 			$this->yellow->toolbox->createFile("yellow.php", $fileData);
 			$this->yellow->toolbox->createFile("yellow.php", $fileData);
 		}
 		}