commit c9adbd354527c28284b56ca68cd85fc0e4510c0f
parent 098e21ec935a8b3ab0b13eb063eb5e438e8eccfe
Author: markseu <mark2011@mayberg.se>
Date: Fri, 14 Apr 2023 10:54:05 +0200
Updated static extension, import settings
Diffstat:
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/system/extensions/static.php b/system/extensions/static.php
@@ -2,7 +2,7 @@
// Static extension, https://github.com/annaesvensson/static-command
class YellowStatic {
- const VERSION = "0.8.46";
+ const VERSION = "0.8.47";
public $yellow; // access to API
public $files; // number of files
public $links; // number of links
@@ -19,6 +19,24 @@ class YellowStatic {
$this->yellow->system->setDefault("staticErrorFile", "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(
+ "staticUrl" => $this->yellow->system->get("commandStaticUrl"),
+ "staticDirectory" => $this->yellow->system->get("commandStaticDirectory"),
+ "staticDefaultFile" => $this->yellow->system->get("commandStaticDefaultFile"),
+ "staticErrorFile" => $this->yellow->system->get("commandStaticErrorFile"));
+ if (!$this->yellow->system->save($fileName, $settings)) {
+ $this->yellow->log("error", "Can't write file '$fileName'!");
+ }
+ $this->yellow->log("info", "Import settings for 'Static ".YellowStatic::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-current.ini b/system/extensions/update-current.ini
@@ -86,11 +86,11 @@ Tag: feature
system/extensions/meta.php: meta.php, create, update
Extension: Static
-Version: 0.8.46
+Version: 0.8.47
Description: Build a static website.
DocumentationUrl: https://github.com/annaesvensson/yellow-static
DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/main/downloads/static.zip
-Published: 2023-04-13 20:02:44
+Published: 2023-04-14 10:46:36
Developer: Anna Svensson
Tag: feature
system/extensions/static.php: static.php, create, update