commit b3ebd0d921860a2f9841c1271e585e0353dd2a97
parent f7d7108033f37b781e5a04cbec63a2cfb6a1ada7
Author: markseu <mark2011@mayberg.se>
Date: Tue, 26 Mar 2024 22:37:39 +0100
Updated code, spring cleanup
Diffstat:
4 files changed, 16 insertions(+), 28 deletions(-)
diff --git a/system/extensions/generate.php b/system/extensions/generate.php
@@ -2,7 +2,7 @@
// Generate extension, https://github.com/annaesvensson/yellow-generate
class YellowGenerate {
- const VERSION = "0.8.52";
+ const VERSION = "0.8.53";
public $yellow; // access to API
public $files; // number of files
public $errors; // number of errors
@@ -18,24 +18,6 @@ class YellowGenerate {
$this->yellow->system->setDefault("generateStaticErrorFile", "404.html");
}
- // Handle update
- public function onUpdate($action) {
- if ($action=="install") {
- if ($this->yellow->system->isExisting("commandStaticUrl")) { //TODO: remove later, for backwards compatibility
- $fileName = $this->yellow->system->get("coreExtensionDirectory").$this->yellow->system->get("coreSystemFile");
- $settings = array(
- "generateStaticUrl" => $this->yellow->system->get("commandStaticUrl"),
- "generateStaticDirectory" => $this->yellow->system->get("commandStaticDirectory"),
- "generateStaticDefaultFile" => $this->yellow->system->get("commandStaticDefaultFile"),
- "generateStaticErrorFile" => $this->yellow->system->get("commandStaticErrorFile"));
- if (!$this->yellow->system->save($fileName, $settings)) {
- $this->yellow->toolbox->log("error", "Can't write file '$fileName'!");
- }
- $this->yellow->toolbox->log("info", "Import settings for 'Generate ".YellowGenerate::VERSION."'");
- }
- }
- }
-
// Handle request
public function onRequest($scheme, $address, $base, $location, $fileName) {
return $this->processRequestCache($scheme, $address, $base, $location, $fileName);
diff --git a/system/extensions/update-available.ini b/system/extensions/update-available.ini
@@ -304,14 +304,14 @@ system/extensions/gallery-default-skin.svg: gallery-default-skin.svg, create, up
system/extensions/gallery-preloader.gif: gallery-preloader.gif, create, update
Extension: Generate
-Version: 0.8.52
+Version: 0.8.53
Description: Generate a static website.
Developer: Anna Svensson
Tag: feature
DownloadUrl: https://github.com/annaesvensson/yellow-generate/archive/refs/heads/main.zip
DocumentationUrl: https://github.com/annaesvensson/yellow-generate
DocumentationLanguage: en, de, sv
-Published: 2023-06-09 15:56:36
+Published: 2024-03-23 09:23:38
Status: available
system/extensions/generate.php: generate.php, create, update
@@ -789,14 +789,14 @@ Status: available
system/extensions/turkish.php: turkish.php, create, update
Extension: Update
-Version: 0.8.98
+Version: 0.8.99
Description: Keep your website up to date.
Developer: Anna Svensson
Tag: feature
DownloadUrl: https://github.com/annaesvensson/yellow-update/archive/refs/heads/main.zip
DocumentationUrl: https://github.com/annaesvensson/yellow-update
DocumentationLanguage: en, de, sv
-Published: 2024-03-20 17:51:59
+Published: 2024-03-26 22:35:01
Status: available
system/extensions/update.php: update.php, create, update
system/extensions/updatepatch.bin: updatepatch.php, create, additional
diff --git a/system/extensions/update-current.ini b/system/extensions/update-current.ini
@@ -36,14 +36,14 @@ system/extensions/edit.woff: edit.woff, delete
content/shared/page-new-default.md: page-new-default.md, create, optional
Extension: Generate
-Version: 0.8.52
+Version: 0.8.53
Description: Generate a static website.
Developer: Anna Svensson
Tag: feature
DownloadUrl: https://github.com/annaesvensson/yellow-generate/archive/refs/heads/main.zip
DocumentationUrl: https://github.com/annaesvensson/yellow-generate
DocumentationLanguage: en, de, sv
-Published: 2023-06-09 15:56:36
+Published: 2024-03-23 09:23:38
Status: available
system/extensions/generate.php: generate.php, create, update
@@ -126,14 +126,14 @@ 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.98
+Version: 0.8.99
Description: Keep your website up to date.
Developer: Anna Svensson
Tag: feature
DownloadUrl: https://github.com/annaesvensson/yellow-update/archive/refs/heads/main.zip
DocumentationUrl: https://github.com/annaesvensson/yellow-update
DocumentationLanguage: en, de, sv
-Published: 2024-03-20 17:51:59
+Published: 2024-03-26 22:35:01
Status: available
system/extensions/update.php: update.php, create, update
system/extensions/updatepatch.bin: updatepatch.php, create, additional
diff --git a/system/extensions/update.php b/system/extensions/update.php
@@ -2,7 +2,7 @@
// Update extension, https://github.com/annaesvensson/yellow-update
class YellowUpdate {
- const VERSION = "0.8.98";
+ const VERSION = "0.8.99";
const PRIORITY = "2";
public $yellow; // access to API
public $extensions; // number of extensions
@@ -22,6 +22,12 @@ class YellowUpdate {
// Handle update
public function onUpdate($action) {
+ if ($action=="install" || $action=="update") { //TODO: remove later, for backwards compatibility
+ $fileNameOld = $this->yellow->system->get("coreExtensionDirectory")."update-latest.ini";
+ if (is_file($fileNameOld) && !$this->yellow->toolbox->deleteFile($fileNameOld)) {
+ $this->yellow->toolbox->log("error", "Can't delete file '$fileNameOld'!");
+ }
+ }
if ($action=="clean" || $action=="daily") {
$statusCode = 200;
$path = $this->yellow->system->get("coreExtensionDirectory");