mikuli.cz

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

commit 4279d8f729abc8bbaa5edaaddb8e55b6a7f28d51
parent 80cf21003c8a84c7d869eebbc2ae0062673e9ee8
Author: markseu <mark2011@mayberg.se>
Date:   Tue,  7 Jul 2020 18:29:20 +0200

Updated extensions

Diffstat:
Msystem/extensions/command.php | 32+-------------------------------
Msystem/extensions/update.php | 22++++++++++++++++++++--
2 files changed, 21 insertions(+), 33 deletions(-)

diff --git a/system/extensions/command.php b/system/extensions/command.php @@ -4,7 +4,7 @@ // This file may be used and distributed under the terms of the public license. class YellowCommand { - const VERSION = "0.8.16"; + const VERSION = "0.8.17"; const TYPE = "feature"; const PRIORITY = "3"; public $yellow; //access to API @@ -23,7 +23,6 @@ class YellowCommand { public function onCommand($command, $text) { switch ($command) { case "": $statusCode = $this->processCommandHelp(); break; - case "about": $statusCode = $this->processCommandAbout($command, $text); break; case "build": $statusCode = $this->processCommandBuild($command, $text); break; case "check": $statusCode = $this->processCommandCheck($command, $text); break; case "clean": $statusCode = $this->processCommandClean($command, $text); break; @@ -35,7 +34,6 @@ class YellowCommand { // Handle command help public function onCommandHelp() { - $help = "about\n"; $help .= "build [directory location]\n"; $help .= "check [directory location]\n"; $help .= "clean [directory location]\n"; @@ -53,22 +51,6 @@ class YellowCommand { return 200; } - // Process command to show website version and updates - public function processCommandAbout($command, $text) { - echo "Datenstrom Yellow ".YellowCore::VERSION."\n"; - list($statusCode, $dataCurrent) = $this->getExtensionsVersion(); - list($statusCode, $dataLatest) = $this->getExtensionsVersion(true); - foreach ($dataCurrent as $key=>$value) { - if (!isset($dataLatest[$key]) || strnatcasecmp($dataCurrent[$key], $dataLatest[$key])>=0) { - echo ucfirst($key)." $value\n"; - } else { - echo ucfirst($key)." $value - Update available\n"; - } - } - if ($statusCode!=200) echo "ERROR checking updates: ".$this->yellow->page->get("pageError")."\n"; - return $statusCode; - } - // Process command to build static website public function processCommandBuild($command, $text) { $statusCode = 0; @@ -520,18 +502,6 @@ class YellowCommand { uksort($data, "strnatcasecmp"); return $data; } - - // Return extensions version - public function getExtensionsVersion($latest = false) { - $data = array(); - if ($this->yellow->extensions->isExisting("update")) { - list($statusCode, $data) = $this->yellow->extensions->get("update")->getExtensionsVersion($latest); - } else { - $statusCode = 200; - $data = $this->yellow->extensions->getData(); - } - return array($statusCode, $data); - } // Return human readable status public function getStatusFormatted($statusCode) { diff --git a/system/extensions/update.php b/system/extensions/update.php @@ -4,7 +4,7 @@ // This file may be used and distributed under the terms of the public license. class YellowUpdate { - const VERSION = "0.8.22"; + const VERSION = "0.8.23"; const TYPE = "feature"; const PRIORITY = "2"; public $yellow; //access to API @@ -36,6 +36,7 @@ class YellowUpdate { if ($this->isExtensionPending()) $statusCode = $this->processCommandPending(); if ($statusCode==0) { switch ($command) { + case "about": $statusCode = $this->processCommandAbout($command, $text); break; case "clean": $statusCode = $this->processCommandClean($command, $text); break; case "install": $statusCode = $this->processCommandInstall($command, $text); break; case "uninstall": $statusCode = $this->processCommandUninstall($command, $text); break; @@ -48,7 +49,8 @@ class YellowUpdate { // Handle command help public function onCommandHelp() { - $help = "install [extension]\n"; + $help = "about\n"; + $help .= "install [extension]\n"; $help .= "uninstall [extension]\n"; $help .= "update [extension]\n"; return $help; @@ -161,6 +163,22 @@ class YellowUpdate { } } + // Process command to show website version and updates + public function processCommandAbout($command, $text) { + echo "Datenstrom Yellow ".YellowCore::VERSION."\n"; + list($statusCode, $dataCurrent) = $this->getExtensionsVersion(); + list($statusCode, $dataLatest) = $this->getExtensionsVersion(true); + foreach ($dataCurrent as $key=>$value) { + if (!isset($dataLatest[$key]) || strnatcasecmp($dataCurrent[$key], $dataLatest[$key])>=0) { + echo ucfirst($key)." $value\n"; + } else { + echo ucfirst($key)." $value - Update available\n"; + } + } + if ($statusCode!=200) echo "ERROR checking updates: ".$this->yellow->page->get("pageError")."\n"; + return $statusCode; + } + // Process command to clean downloads public function processCommandClean($command, $text) { $statusCode = 0;