Pārlūkot izejas kodu

Updated code, spring cleanup

markseu 1 gadu atpakaļ
vecāks
revīzija
b3ebd0d921

+ 1 - 19
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);

+ 4 - 4
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

+ 4 - 4
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

+ 7 - 1
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");