commit 9d74e8013739a2c92a0bfd7f94e4c9d4e13bbd83
parent 3a5469fbacbcc3b9d8a7f86a01aff33f855e5526
Author: Szymon Mikulicz <szymon.mikulicz@posteo.net>
Date: Wed, 8 Jul 2020 23:12:34 +0200
Merge branch 'master' of https://github.com/datenstrom/yellow
Diffstat:
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;