Browse Source

Added support for long-term backwards compatibility

markseu 3 năm trước cách đây
mục cha
commit
e5fdb70302
2 tập tin đã thay đổi với 10 bổ sung10 xóa
  1. 3 3
      system/extensions/update-current.ini
  2. 7 7
      system/extensions/update.php

+ 3 - 3
system/extensions/update-current.ini

@@ -131,12 +131,12 @@ system/themes/stockholm-opensans-light.woff: stockholm-opensans-light.woff, crea
 system/themes/stockholm-opensans-regular.woff: stockholm-opensans-regular.woff, create, update, careful
 
 Extension: Update
-Version: 0.8.76
+Version: 0.8.77
 Description: Keep your website up to date.
 DocumentationUrl: https://github.com/datenstrom/yellow-extensions/tree/master/source/update
 DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/master/zip/update.zip
-Published: 2022-05-06 18:38:21
+Published: 2022-05-07 19:13:46
 Developer: Datenstrom
 Tag: feature
 system/extensions/update.php: update.php, create, update
-system/extensions/update-patch.bin: @base/source/patch/patch.php, create, additional
+system/extensions/updatepatch.bin: updatepatch.php, create, additional

+ 7 - 7
system/extensions/update.php

@@ -2,7 +2,7 @@
 // Update extension, https://github.com/datenstrom/yellow-extensions/tree/master/source/update
 
 class YellowUpdate {
-    const VERSION = "0.8.76";
+    const VERSION = "0.8.77";
     const PRIORITY = "2";
     public $yellow;                 // access to API
     public $extensions;             // number of extensions
@@ -351,19 +351,19 @@ class YellowUpdate {
 
     // Update pending patches
     public function updatePatchPending() {
-        $fileName = $this->yellow->system->get("coreExtensionDirectory")."update-patch.bin";
+        $fileName = $this->yellow->system->get("coreExtensionDirectory")."updatepatch.bin";
         if (is_file($fileName)) {
             if ($this->yellow->system->get("coreDebugMode")>=2) echo "YellowUpdate::updatePatchPending file:$fileName<br/>\n";
-            if (!$this->yellow->extension->isExisting("patch")) {
+            if (!$this->yellow->extension->isExisting("updatepatch")) {
                 require_once($fileName);
-                $this->yellow->extension->register("patch", "YellowPatch");
+                $this->yellow->extension->register("updatepatch", "YellowUpdatePatch");
             }
-            if ($this->yellow->extension->isExisting("patch")) {
-                $value = $this->yellow->extension->data["patch"];
+            if ($this->yellow->extension->isExisting("updatepatch")) {
+                $value = $this->yellow->extension->data["updatepatch"];
                 if (method_exists($value["object"], "onLoad")) $value["object"]->onLoad($this->yellow);
                 if (method_exists($value["object"], "onUpdate")) $value["object"]->onUpdate("update");
             }
-            unset($this->yellow->extension->data["patch"]);
+            unset($this->yellow->extension->data["updatepatch"]);
             if (function_exists("opcache_reset")) opcache_reset();
             if (!$this->yellow->toolbox->deleteFile($fileName)) {
                 $this->yellow->log("error", "Can't delete file '$fileName'!");