commit b295cbd10779719221e7ca1d76936b432a0b8f13
parent 14b6f81d119a1a481544c842a4acefef7dbaf027
Author: markseu <mark2011@mayberg.se>
Date: Fri, 14 Oct 2022 20:39:12 +0200
Updated install extension, error handling
Diffstat:
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/system/extensions/install.php b/system/extensions/install.php
@@ -2,7 +2,7 @@
// Install extension, https://github.com/annaesvensson/yellow-install
class YellowInstall {
- const VERSION = "0.8.78";
+ const VERSION = "0.8.79";
const PRIORITY = "1";
public $yellow; // access to API
@@ -73,7 +73,7 @@ class YellowInstall {
if ($this->yellow->system->get("updateCurrentRelease")=="none") {
$this->checkCommandRequirements();
if (empty($command)) {
- $statusCode = 304;
+ $statusCode = 200;
echo "Datenstrom Yellow is for people who make small websites. https://datenstrom.se/yellow/\n";
echo "Syntax: php yellow.php\n";
echo " php yellow.php about [extension]\n";
@@ -86,15 +86,14 @@ class YellowInstall {
if ($statusCode==200) $statusCode = $this->updateLanguages();
if ($statusCode==200) $statusCode = $this->updateSettings();
if ($statusCode==200) $statusCode = $this->removeInstall();
- $statusCode = 200;
+ if ($statusCode>=400) {
+ echo "ERROR installing files: ".$this->yellow->page->errorMessage."\n";
+ echo "The installation has not been completed. Please run command again.\n";
+ }
} else {
- $statusCode = 304;
+ $statusCode = 500;
echo "The installation has not been completed. Please type 'php yellow.php serve' or 'php yellow.php skip installation`.\n";
}
- if ($statusCode>=400) {
- echo "ERROR installing files: ".$this->yellow->page->errorMessage."\n";
- echo "The installation has not been completed. Please run command again.\n";
- }
} else {
$statusCode = $this->removeInstall();
$this->yellow->log($statusCode==200 ? "info" : "error", "Uninstall extension 'Install ".YellowInstall::VERSION."'");
diff --git a/system/extensions/update-current.ini b/system/extensions/update-current.ini
@@ -54,11 +54,11 @@ media/images/photo.jpg: photo.jpg, create, optional
media/thumbnails/photo-100x40.jpg: photo-100x40.jpg, create, optional
Extension: Install
-Version: 0.8.78
+Version: 0.8.79
Description: Install a brand new, shiny website.
DocumentationUrl: https://github.com/annaesvensson/yellow-install
DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/main/downloads/install.zip
-Published: 2022-10-12 16:23:51
+Published: 2022-10-14 20:25:13
Developer: Anna Svensson
Status: unlisted
system/extensions/install.php: install.php, create