mikuli.cz

:)
git clone https://git.sr.ht/~ashymad/mikuli.cz
Log | Files | Refs

commit a886530521210ca757049034db53e1593f30ab0f
parent 249c0e341c6ddec331d1da12449b32bcaead41b2
Author: markseu <mark2011@mayberg.se>
Date:   Fri, 28 Oct 2022 13:59:45 +0200

Updated install extension, more logging

Diffstat:
Msystem/extensions/install-language.bin | 0
Msystem/extensions/install.php | 15+++++++++------
Msystem/extensions/update-current.ini | 4++--
3 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/system/extensions/install-language.bin b/system/extensions/install-language.bin Binary files differ. 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.81"; + const VERSION = "0.8.82"; const PRIORITY = "1"; public $yellow; // access to API @@ -54,8 +54,7 @@ class YellowInstall { if ($status=="ok") $status = $this->updateSettings()==200 ? "ok" : "error"; if ($status=="ok") $status = $this->removeInstall()==200 ? "done" : "error"; } else { - $status = $this->removeInstall()==200 ? "done" : "error"; - $this->yellow->log($status=="done" ? "info" : "error", "Uninstall extension 'Install ".YellowInstall::VERSION."'"); + $status = $this->removeInstall(true)==200 ? "done" : "error"; } if ($status=="done") { $location = $this->yellow->lookup->normaliseUrl($scheme, $address, $base, "/"); @@ -95,8 +94,7 @@ class YellowInstall { echo "The installation has not been completed. Please type 'php yellow.php serve' or 'php yellow.php skip installation`.\n"; } } else { - $statusCode = $this->removeInstall(); - $this->yellow->log($statusCode==200 ? "info" : "error", "Uninstall extension 'Install ".YellowInstall::VERSION."'"); + $statusCode = $this->removeInstall(true); if ($statusCode==200) $statusCode = 0; if ($statusCode>=400) { echo "ERROR installing files: ".$this->yellow->page->errorMessage."\n"; @@ -114,6 +112,10 @@ class YellowInstall { list($name, $version, $os) = $this->yellow->toolbox->detectServerInformation(); $product = "Datenstrom Yellow ".YellowCore::RELEASE; $this->yellow->log("info", "Install $product, PHP ".PHP_VERSION.", $name $version, $os"); + foreach ($this->yellow->extension->data as $key=>$value) { + if ($key=="install") continue; + $this->yellow->log("info", "Install extension '".ucfirst($key)." $value[version]'"); + } if (!is_file($fileName)) { $statusCode = 500; $this->yellow->page->error($statusCode, "Can't write file '$fileName'!"); @@ -257,7 +259,7 @@ class YellowInstall { } // Remove files used by installation - public function removeInstall() { + public function removeInstall($log = false) { $statusCode = 200; if (function_exists("opcache_reset")) opcache_reset(); $path = $this->yellow->system->get("coreExtensionDirectory"); @@ -282,6 +284,7 @@ class YellowInstall { $statusCode = 500; $this->yellow->page->error($statusCode, "Can't write file '$fileName'!"); } + if ($log) $this->yellow->log($statusCode==200 ? "info" : "error", "Uninstall extension 'Install ".YellowInstall::VERSION."'"); return $statusCode; } 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.81 +Version: 0.8.82 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-20 13:37:18 +Published: 2022-10-28 13:07:09 Developer: Anna Svensson Status: unlisted system/extensions/install.php: install.php, create