commit 7704573428a50e93c1956269bccf67733e97e11a
parent c24135e06de43032ce76d80b3a24a12e8a1225ff
Author: markseu <mark2011@mayberg.se>
Date: Thu, 12 Nov 2020 15:21:55 +0100
Updated API, more information for troubleshooting
Diffstat:
3 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/system/extensions/core.php b/system/extensions/core.php
@@ -2,7 +2,7 @@
// Core extension, https://github.com/datenstrom/yellow-extensions/tree/master/source/core
class YellowCore {
- const VERSION = "0.8.30";
+ const VERSION = "0.8.31";
const RELEASE = "0.8.16";
public $page; // current page
public $content; // content files
@@ -74,7 +74,7 @@ class YellowCore {
// Check requirements
public function checkRequirements() {
- $troubleshooting = PHP_SAPI!="cli" ? "<a href=\"https://datenstrom.se/yellow/help/troubleshooting\">See troubleshooting</a>." : "";
+ $troubleshooting = PHP_SAPI!="cli" ? "<a href=\"".$this->getTroubleshootingUrl()."\">See troubleshooting</a>." : "";
version_compare(PHP_VERSION, "5.6", ">=") || die("Datenstrom Yellow requires PHP 5.6 or higher! $troubleshooting\n");
extension_loaded("curl") || die("Datenstrom Yellow requires PHP curl extension! $troubleshooting\n");
extension_loaded("exif") || die("Datenstrom Yellow requires PHP exif extension! $troubleshooting\n");
@@ -182,7 +182,7 @@ class YellowCore {
$rawData .= "Layout: error\n---\n".$this->language->getText("coreError${statusCode}Text", $languageError);
} else {
$rawData = "---\nTitle:".$this->toolbox->getHttpStatusFormatted($statusCode, true)."\n";
- $rawData .= "Layout:error\n---\n[yellow error]";
+ $rawData .= "Layout:error\n---\n$pageError";
}
$cacheable = false;
} else {
@@ -345,6 +345,11 @@ class YellowCore {
return array_pad($this->lookup->layoutArguments, $sizeMin, null);
}
+ // Return troubleshooting URL
+ public function getTroubleshootingUrl() {
+ return "https://datenstrom.se/yellow/help/troubleshooting";
+ }
+
// Return request information
public function getRequestInformation($scheme = "", $address = "", $base = "") {
if (empty($scheme) && empty($address) && empty($base)) {
@@ -903,7 +908,7 @@ class YellowPage {
public function error($statusCode, $pageError = "") {
if (!$this->isExisting("pageError") && $statusCode>0) {
$this->statusCode = $statusCode;
- $this->set("pageError", empty($pageError) ? "Layout error!" : $pageError);
+ $this->set("pageError", empty($pageError) ? "Page error!" : $pageError);
}
}
@@ -1942,7 +1947,8 @@ class YellowExtension {
$this->yellow->log("error", "Can't parse file '$fileName'!");
}
@header($this->yellow->toolbox->getHttpStatusFormatted(500));
- echo "Server error<br/>\n";
+ $troubleshooting = "<a href=\"".$this->yellow->getTroubleshootingUrl()."\">See troubleshooting</a>.";
+ echo "<br/>Something went wrong. Activate debug mode for more information. $troubleshooting\n";
}
}
}
diff --git a/system/extensions/install.php b/system/extensions/install.php
@@ -2,7 +2,7 @@
// Install extension, https://github.com/datenstrom/yellow
class YellowInstall {
- const VERSION = "0.8.41";
+ const VERSION = "0.8.42";
const PRIORITY = "1";
public $yellow; // access to API
@@ -241,7 +241,7 @@ class YellowInstall {
// Check web server requirements
public function checkServerRequirements() {
list($name) = $this->yellow->toolbox->detectServerInformation();
- $troubleshooting = "<a href=\"https://datenstrom.se/yellow/help/troubleshooting\">See troubleshooting</a>.";
+ $troubleshooting = "<a href=\"".$this->yellow->getTroubleshootingUrl()."\">See troubleshooting</a>.";
$this->checkServerConfiguration() || die("Datenstrom Yellow requires configuration file for $name! $troubleshooting\n");
$this->checkServerRewrite() || die("Datenstrom Yellow requires rewrite support for $name! $troubleshooting\n");
$this->checkServerWrite() || die("Datenstrom Yellow requires write access for $name! $troubleshooting\n");
diff --git a/system/extensions/update-current.ini b/system/extensions/update-current.ini
@@ -21,11 +21,11 @@ Tag: feature
system/extensions/command.php: command.php, create, update
Extension: Core
-Version: 0.8.30
+Version: 0.8.31
Description: Core functionality of the website.
HelpUrl: https://github.com/datenstrom/yellow-extensions/tree/master/source/core
DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/master/zip/core.zip
-Published: 2020-11-05 22:02:05
+Published: 2020-11-12 15:09:21
Developer: Datenstrom
Tag: feature
system/extensions/core.php: core.php, create, update