Added support for long-term backwards compatibility

This commit is contained in:
markseu 2022-05-07 20:42:46 +02:00
parent 76f4815d4e
commit e5fdb70302
2 changed files with 10 additions and 10 deletions

View file

@ -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

View file

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