commit e1681aed745556cb2ea1605ebeb904a530e6505e
parent c0400b56cbe63f39bf0f7a7e8a436e679faf77fd
Author: markseu <mark2011@mayberg.se>
Date: Fri, 11 Mar 2022 01:48:47 +0100
Replaced DEBUG with coreDebugMode
Diffstat:
8 files changed, 106 insertions(+), 78 deletions(-)
diff --git a/system/extensions/bundle.php b/system/extensions/bundle.php
@@ -2,7 +2,7 @@
// Bundle extension, https://github.com/datenstrom/yellow-extensions/tree/master/source/bundle
class YellowBundle {
- const VERSION = "0.8.23";
+ const VERSION = "0.8.24";
public $yellow; // access to API
// Handle initialisation
@@ -54,7 +54,7 @@ class YellowBundle {
array_push($dataOther, $line);
}
}
- if (!defined("DEBUG")) {
+ if (!$this->yellow->system->get("coreDebugMode")) {
$dataCss = $this->processBundle($dataCss, "css");
$dataScriptDefer = $this->processBundle($dataScriptDefer, "js", "defer");
$dataScriptNow = $this->processBundle($dataScriptNow, "js");
@@ -190,7 +190,7 @@ class YellowBundle {
list($dummy, $fileNames, $modified) = $this->getBundleInformation($fileName);
$idExpected = $idCurrent = $this->getBundleId($fileNames, $modified);
if (preg_match("/^bundle-(.*)\.min/", basename($fileName), $matches)) $idCurrent = $matches[1];
- return $idExpected==$idCurrent && !defined("DEBUG");
+ return $idExpected==$idCurrent && !$this->yellow->system->get("coreDebugMode");
}
}
diff --git a/system/extensions/command.php b/system/extensions/command.php
@@ -2,7 +2,7 @@
// Command extension, https://github.com/datenstrom/yellow-extensions/tree/master/source/command
class YellowCommand {
- const VERSION = "0.8.32";
+ const VERSION = "0.8.33";
public $yellow; // access to API
public $files; // number of files
public $links; // number of links
@@ -153,7 +153,9 @@ class YellowCommand {
++$this->errors;
echo "\rERROR building location '$location', ".$this->yellow->page->getStatusCode(true)."\n";
}
- if (defined("DEBUG") && DEBUG>=1) echo "YellowCommand::buildStaticFile status:$statusCode location:$location<br/>\n";
+ if ($this->yellow->system->get("coreDebugMode")>=1) {
+ echo "YellowCommand::buildStaticFile status:$statusCode location:$location<br/>\n";
+ }
return $statusCode;
}
@@ -226,13 +228,17 @@ class YellowCommand {
$location = rtrim($location, "/")."/";
if (!isset($this->locationsArguments[$location])) {
$this->locationsArguments[$location] = $location;
- if (defined("DEBUG") && DEBUG>=2) echo "YellowCommand::analyseLocations detected location:$location<br/>\n";
+ if ($this->yellow->system->get("coreDebugMode")>=2) {
+ echo "YellowCommand::analyseLocations detected location:$location<br/>\n";
+ }
}
} else {
$location = rtrim($location, "0..9");
if (!isset($this->locationsArgumentsPagination[$location])) {
$this->locationsArgumentsPagination[$location] = $location;
- if (defined("DEBUG") && DEBUG>=2) echo "YellowCommand::analyseLocations detected location:$location<br/>\n";
+ if ($this->yellow->system->get("coreDebugMode")>=2) {
+ echo "YellowCommand::analyseLocations detected location:$location<br/>\n";
+ }
}
}
}
@@ -299,7 +305,9 @@ class YellowCommand {
} else {
$links[$url] .= ",".$locationSource;
}
- if (defined("DEBUG") && DEBUG>=2) echo "YellowCommand::analyseLinks detected url:$url<br/>\n";
+ if ($this->yellow->system->get("coreDebugMode")>=2) {
+ echo "YellowCommand::analyseLinks detected url:$url<br/>\n";
+ }
} elseif (substru($location, 0, 1)=="/") {
$url = "$scheme://$address$location";
if (!isset($links[$url])) {
@@ -307,10 +315,14 @@ class YellowCommand {
} else {
$links[$url] .= ",".$locationSource;
}
- if (defined("DEBUG") && DEBUG>=2) echo "YellowCommand::analyseLinks detected url:$url<br/>\n";
+ if ($this->yellow->system->get("coreDebugMode")>=2) {
+ echo "YellowCommand::analyseLinks detected url:$url<br/>\n";
+ }
}
}
- if (defined("DEBUG") && DEBUG>=1) echo "YellowCommand::analyseLinks location:$locationSource<br/>\n";
+ if ($this->yellow->system->get("coreDebugMode")>=1) {
+ echo "YellowCommand::analyseLinks location:$locationSource<br/>\n";
+ }
} else {
$statusCode = 500;
++$this->errors;
@@ -347,7 +359,7 @@ class YellowCommand {
uksort($remote, "strnatcasecmp");
foreach ($remote as $url=>$value) {
echo "\rChecking static website ".$this->getProgressPercent(++$remoteNow, count($remote), 5, 95)."%... ";
- if (defined("DEBUG") && DEBUG>=1) echo "YellowCommand::analyseStatus url:$url\n";
+ if ($this->yellow->system->get("coreDebugMode")>=1) echo "YellowCommand::analyseStatus url:$url\n";
$referer = "$scheme://$address$base".(($pos = strposu($value, ",")) ? substru($value, 0, $pos) : $value);
$statusCodeUrl = $this->getLinkStatus($url, $referer);
if ($statusCodeUrl!=200) {
@@ -614,7 +626,9 @@ class YellowCommand {
curl_exec($curlHandle);
$statusCode = curl_getinfo($curlHandle, CURLINFO_HTTP_CODE);
curl_close($curlHandle);
- if (defined("DEBUG") && DEBUG>=2) echo "YellowCommand::getLinkStatus status:$statusCode url:$url<br/>\n";
+ if ($this->yellow->system->get("coreDebugMode")>=2) {
+ echo "YellowCommand::getLinkStatus status:$statusCode url:$url<br/>\n";
+ }
return $statusCode;
}
}
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.58";
+ const VERSION = "0.8.59";
const RELEASE = "0.8.19";
public $page; // current page
public $content; // content files
@@ -37,6 +37,7 @@ class YellowCore {
$this->system->setDefault("coreStaticUrl", "auto");
$this->system->setDefault("coreTimezone", "UTC");
$this->system->setDefault("coreMultiLanguageMode", "0");
+ $this->system->setDefault("coreDebugMode", "0");
$this->system->setDefault("coreMediaLocation", "/media/");
$this->system->setDefault("coreDownloadLocation", "/media/downloads/");
$this->system->setDefault("coreImageLocation", "/media/images/");
@@ -81,16 +82,16 @@ class YellowCore {
extension_loaded("mbstring") || die("Datenstrom Yellow requires PHP mbstring extension! $troubleshooting\n");
extension_loaded("zip") || die("Datenstrom Yellow requires PHP zip extension! $troubleshooting\n");
mb_internal_encoding("UTF-8");
- if (defined("DEBUG") && DEBUG>=1) {
- ini_set("display_errors", 1);
- error_reporting(E_ALL);
- }
}
// Handle initialisation
public function load() {
- register_shutdown_function(array($this, "processFatalError"));
$this->system->load($this->system->get("coreExtensionDirectory").$this->system->get("coreSystemFile"));
+ register_shutdown_function(array($this, "processFatalError"));
+ if ($this->system->get("coreDebugMode")>=1) {
+ ini_set("display_errors", 1);
+ error_reporting(E_ALL);
+ }
$this->user->load($this->system->get("coreExtensionDirectory").$this->system->get("coreUserFile"));
$this->language->load($this->system->get("coreExtensionDirectory"));
$this->language->load($this->system->get("coreExtensionDirectory").$this->system->get("coreLanguageFile"));
@@ -119,7 +120,7 @@ class YellowCore {
if ($this->page->isExisting("pageError")) $statusCode = $this->processRequestError();
ob_end_flush();
$this->toolbox->timerStop($time);
- if (defined("DEBUG") && DEBUG>=1 && $this->lookup->isContentFile($fileName)) {
+ if ($this->system->get("coreDebugMode")>=1 && $this->lookup->isContentFile($fileName)) {
echo "YellowCore::request status:$statusCode time:$time ms<br/>\n";
}
return $statusCode;
@@ -150,7 +151,7 @@ class YellowCore {
$statusCode = $this->sendFile(200, $fileName, true);
}
}
- if (defined("DEBUG") && DEBUG>=1 && $this->lookup->isContentFile($fileName)) {
+ if ($this->system->get("coreDebugMode")>=1 && $this->lookup->isContentFile($fileName)) {
echo "YellowCore::processRequest file:$fileName<br/>\n";
}
return $statusCode;
@@ -163,7 +164,7 @@ class YellowCore {
$this->page->location, $this->page->fileName, $this->page->cacheable, $this->page->statusCode,
$this->page->get("pageError"));
$statusCode = $this->sendPage();
- if (defined("DEBUG") && DEBUG>=1) echo "YellowCore::processRequestError file:$fileName<br/>\n";
+ if ($this->system->get("coreDebugMode")>=1) echo "YellowCore::processRequestError file:$fileName<br/>\n";
return $statusCode;
}
@@ -223,7 +224,7 @@ class YellowCore {
}
if (!is_null($this->page->outputData)) echo $this->page->outputData;
}
- if (defined("DEBUG") && DEBUG>=1) {
+ if ($this->system->get("coreDebugMode")>=1) {
foreach ($this->page->headerData as $key=>$value) {
echo "YellowCore::sendPage $key: $value<br/>\n";
}
@@ -269,7 +270,7 @@ class YellowCore {
foreach ($this->page->headerData as $key=>$value) {
@header("$key: $value");
}
- if (defined("DEBUG") && DEBUG>=1) {
+ if ($this->system->get("coreDebugMode")>=1) {
foreach ($this->page->headerData as $key=>$value) {
echo "YellowCore::sendStatus $key: $value<br/>\n";
}
@@ -303,7 +304,7 @@ class YellowCore {
echo "Yellow $command: Command not found\n";
}
$this->toolbox->timerStop($time);
- if (defined("DEBUG") && DEBUG>=1) {
+ if ($this->system->get("coreDebugMode")>=1) {
echo "YellowCore::command status:$statusCode time:$time ms<br/>\n";
}
return $statusCode<400 ? 0 : 1;
@@ -368,7 +369,9 @@ class YellowCore {
$this->system->set("coreServerScheme", $scheme);
$this->system->set("coreServerAddress", $address);
$this->system->set("coreServerBase", $base);
- if (defined("DEBUG") && DEBUG>=3) echo "YellowCore::getRequestInformation $scheme://$address$base<br/>\n";
+ if ($this->system->get("coreDebugMode")>=3) {
+ echo "YellowCore::getRequestInformation $scheme://$address$base<br/>\n";
+ }
}
$location = substru($this->toolbox->detectServerLocation(), strlenu($base));
if (empty($fileName)) $fileName = $this->lookup->findFileFromSystem($location);
@@ -381,7 +384,9 @@ class YellowCore {
public function getCommandInformation($line = "") {
if (empty($line)) {
$line = $this->toolbox->getTextString(array_slice($this->toolbox->getServer("argv"), 1));
- if (defined("DEBUG") && DEBUG>=3) echo "YellowCore::getCommandInformation $line<br/>\n";
+ if ($this->system->get("coreDebugMode")>=3) {
+ echo "YellowCore::getCommandInformation $line<br/>\n";
+ }
}
return $this->toolbox->getTextList($line, " ", 2);
}
@@ -567,7 +572,9 @@ class YellowPage {
$description = $this->yellow->toolbox->createTextDescription($this->parserData, 150);
$this->set("description", !empty($description) ? $description : $this->get("title"));
}
- if (defined("DEBUG") && DEBUG>=3) echo "YellowPage::parseContent location:".$this->location."<br/>\n";
+ if ($this->yellow->system->get("coreDebugMode")>=3) {
+ echo "YellowPage::parseContent location:".$this->location."<br/>\n";
+ }
}
}
@@ -608,7 +615,9 @@ class YellowPage {
}
}
}
- if (defined("DEBUG") && DEBUG>=3 && !empty($name)) echo "YellowPage::parseContentShortcut name:$name type:$type<br/>\n";
+ if ($this->yellow->system->get("coreDebugMode")>=3 && !empty($name)) {
+ echo "YellowPage::parseContentShortcut name:$name type:$type<br/>\n";
+ }
return $output;
}
@@ -675,11 +684,15 @@ class YellowPage {
$fileNameLayoutTheme = $this->yellow->system->get("coreLayoutDirectory").
$this->yellow->lookup->normaliseName($this->get("theme"))."-".$this->yellow->lookup->normaliseName($name).".html";
if (is_file($fileNameLayoutTheme)) {
- if (defined("DEBUG") && DEBUG>=2) echo "YellowPage::includeLayout file:$fileNameLayoutTheme<br/>\n";
+ if ($this->yellow->system->get("coreDebugMode")>=2) {
+ echo "YellowPage::includeLayout file:$fileNameLayoutTheme<br/>\n";
+ }
$this->setLastModified(filemtime($fileNameLayoutTheme));
require($fileNameLayoutTheme);
} elseif (is_file($fileNameLayoutNormal)) {
- if (defined("DEBUG") && DEBUG>=2) echo "YellowPage::includeLayout file:$fileNameLayoutNormal<br/>\n";
+ if ($this->yellow->system->get("coreDebugMode")>=2) {
+ echo "YellowPage::includeLayout file:$fileNameLayoutNormal<br/>\n";
+ }
$this->setLastModified(filemtime($fileNameLayoutNormal));
require($fileNameLayoutNormal);
} else {
@@ -1236,7 +1249,7 @@ class YellowContent {
// Scan file system on demand
public function scanLocation($location) {
if (!isset($this->pages[$location])) {
- if (defined("DEBUG") && DEBUG>=2) echo "YellowContent::scanLocation location:$location<br/>\n";
+ if ($this->yellow->system->get("coreDebugMode")>=2) echo "YellowContent::scanLocation location:$location<br/>\n";
$this->pages[$location] = array();
$scheme = $this->yellow->page->scheme;
$address = $this->yellow->page->address;
@@ -1439,7 +1452,7 @@ class YellowMedia {
// Scan file system on demand
public function scanLocation($location) {
if (!isset($this->files[$location])) {
- if (defined("DEBUG") && DEBUG>=2) echo "YellowMedia::scanLocation location:$location<br/>\n";
+ if ($this->yellow->system->get("coreDebugMode")>=2) echo "YellowMedia::scanLocation location:$location<br/>\n";
$this->files[$location] = array();
$scheme = $this->yellow->page->scheme;
$address = $this->yellow->page->address;
@@ -1556,11 +1569,11 @@ class YellowSystem {
// Load system settings from file
public function load($fileName) {
- if (defined("DEBUG") && DEBUG>=2) echo "YellowSystem::load file:$fileName<br/>\n";
+ if ($this->yellow->system->get("coreDebugMode")>=2) echo "YellowSystem::load file:$fileName<br/>\n";
$this->modified = $this->yellow->toolbox->getFileModified($fileName);
$fileData = $this->yellow->toolbox->readFile($fileName);
$this->settings = $this->yellow->toolbox->getTextSettings($fileData, "");
- if (defined("DEBUG") && DEBUG>=3) {
+ if ($this->yellow->system->get("coreDebugMode")>=3) {
foreach ($this->settings as $key=>$value) {
echo "YellowSystem::load ".ucfirst($key).":$value<br/>\n";
}
@@ -1677,7 +1690,7 @@ class YellowUser {
// Load user settings from file
public function load($fileName) {
- if (defined("DEBUG") && DEBUG>=2) echo "YellowUser::load file:$fileName<br/>\n";
+ if ($this->yellow->system->get("coreDebugMode")>=2) echo "YellowUser::load file:$fileName<br/>\n";
$this->modified = $this->yellow->toolbox->getFileModified($fileName);
$fileData = $this->yellow->toolbox->readFile($fileName);
$this->settings = $this->yellow->toolbox->getTextSettings($fileData, "email");
@@ -1780,7 +1793,7 @@ class YellowLanguage {
$regex = "/^.*\.txt$/";
}
foreach ($this->yellow->toolbox->getDirectoryEntries($path, $regex, true, false) as $entry) {
- if (defined("DEBUG") && DEBUG>=2) echo "YellowLanguage::load file:$entry<br/>\n";
+ if ($this->yellow->system->get("coreDebugMode")>=2) echo "YellowLanguage::load file:$entry<br/>\n";
$this->modified = max($this->modified, filemtime($entry));
$fileData = $this->yellow->toolbox->readFile($entry);
$settings = $this->yellow->toolbox->getTextSettings($fileData, "language");
@@ -1947,7 +1960,7 @@ class YellowExtension {
// Load extensions
public function load($path) {
foreach ($this->yellow->toolbox->getDirectoryEntries($path, "/^.*\.php$/", true, false) as $entry) {
- if (defined("DEBUG") && DEBUG>=3) echo "YellowExtension::load file:$entry<br/>\n";
+ if ($this->yellow->system->get("coreDebugMode")>=3) echo "YellowExtension::load file:$entry<br/>\n";
$this->modified = max($this->modified, filemtime($entry));
require_once($entry);
$name = $this->yellow->lookup->normaliseName(basename($entry), true, true);
@@ -2042,7 +2055,7 @@ class YellowLookup {
$token = $this->normaliseToken($entry)."/";
if ($token==$pathRoot) $token = "";
array_push($locations, $includePath ? "root/$token $pathBase$entry/" : "root/$token");
- if (defined("DEBUG") && DEBUG>=2) echo "YellowLookup::findRootLocations root/$token<br/>\n";
+ if ($this->yellow->system->get("coreDebugMode")>=2) echo "YellowLookup::findRootLocations root/$token<br/>\n";
}
} else {
array_push($locations, $includePath ? "root/ $pathBase" : "root/");
@@ -2080,7 +2093,7 @@ class YellowLookup {
} else {
$invalid = true;
}
- if (defined("DEBUG") && DEBUG>=2) {
+ if ($this->yellow->system->get("coreDebugMode")>=2) {
$debug = ($invalid ? "INVALID" : $location)." <- $pathBase$fileName";
echo "YellowLookup::findLocationFromFile $debug<br/>\n";
}
@@ -2130,7 +2143,7 @@ class YellowLookup {
} else {
$path .= $this->findFileDefault($path, $fileDefault, $fileExtension, false);
}
- if (defined("DEBUG") && DEBUG>=2) {
+ if ($this->yellow->system->get("coreDebugMode")>=2) {
$debug = "$location -> ".($invalid ? "INVALID" : $path);
echo "YellowLookup::findFileFromLocation $debug<br/>\n";
}
diff --git a/system/extensions/edit.js b/system/extensions/edit.js
@@ -130,7 +130,7 @@ yellow.edit = {
// Create pane
createPane: function(paneId, paneAction, paneStatus) {
- if (yellow.system.debug) console.log("yellow.edit.createPane id:"+paneId);
+ if (yellow.system.coreDebugMode) console.log("yellow.edit.createPane id:"+paneId);
var elementPane = document.createElement("div");
elementPane.className = "yellow-pane";
elementPane.setAttribute("id", paneId);
@@ -514,7 +514,7 @@ yellow.edit = {
if (!document.getElementById(paneId)) this.createPane(paneId, paneAction, paneStatus);
var element = document.getElementById(paneId);
if (!yellow.toolbox.isVisible(element)) {
- if (yellow.system.debug) console.log("yellow.edit.showPane id:"+paneId);
+ if (yellow.system.coreDebugMode) console.log("yellow.edit.showPane id:"+paneId);
yellow.toolbox.setVisible(element, true);
if (paneModal) {
yellow.toolbox.addClass(document.body, "yellow-body-modal-open");
@@ -536,7 +536,7 @@ yellow.edit = {
hidePane: function(paneId, fadeout) {
var element = document.getElementById(paneId);
if (yellow.toolbox.isVisible(element)) {
- if (yellow.system.debug) console.log("yellow.edit.hidePane id:"+paneId);
+ if (yellow.system.coreDebugMode) console.log("yellow.edit.hidePane id:"+paneId);
yellow.toolbox.removeClass(document.body, "yellow-body-modal-open");
yellow.toolbox.removeValue("meta[name=viewport]", "content", ", maximum-scale=1, user-scalable=0");
yellow.toolbox.setVisible(element, false, fadeout);
@@ -554,7 +554,7 @@ yellow.edit = {
status = status ? status : "none";
arguments = arguments ? arguments : "none";
if (action!="none") {
- if (yellow.system.debug) console.log("yellow.edit.processAction action:"+action+" status:"+status);
+ if (yellow.system.coreDebugMode) console.log("yellow.edit.processAction action:"+action+" status:"+status);
var paneId = (status!="next" && status!="done") ? "yellow-pane-"+action : "yellow-pane-information";
switch(action) {
case "login": this.showPane(paneId, action, status); break;
@@ -587,7 +587,7 @@ yellow.edit = {
// Process toolbar
processToolbar: function(status, arguments) {
- if (yellow.system.debug) console.log("yellow.edit.processToolbar status:"+status);
+ if (yellow.system.coreDebugMode) console.log("yellow.edit.processToolbar status:"+status);
var elementText = document.getElementById(this.paneId+"-text");
var elementPreview = document.getElementById(this.paneId+"-preview");
if (!yellow.toolbox.isVisible(elementPreview) && !elementText.readOnly) {
@@ -652,7 +652,7 @@ yellow.edit = {
for (var i=0; i<tokens.length; i++) {
var pair = tokens[i].split(" ");
if (shortcut==pair[0] || shortcut.replace("meta+", "ctrl+")==pair[0]) {
- if (yellow.system.debug) console.log("yellow.edit.processShortcut shortcut:"+shortcut);
+ if (yellow.system.coreDebugMode) console.log("yellow.edit.processShortcut shortcut:"+shortcut);
e.stopPropagation();
e.preventDefault();
this.processToolbar(pair[1]);
@@ -698,7 +698,7 @@ yellow.edit = {
// Create popup
createPopup: function(popupId) {
- if (yellow.system.debug) console.log("yellow.edit.createPopup id:"+popupId);
+ if (yellow.system.coreDebugMode) console.log("yellow.edit.createPopup id:"+popupId);
var elementPopup = document.createElement("div");
elementPopup.className = "yellow-popup";
elementPopup.setAttribute("id", popupId);
@@ -769,7 +769,7 @@ yellow.edit = {
this.hidePopup(this.popupId);
if (!document.getElementById(popupId)) this.createPopup(popupId);
var element = document.getElementById(popupId);
- if (yellow.system.debug) console.log("yellow.edit.showPopup id:"+popupId);
+ if (yellow.system.coreDebugMode) console.log("yellow.edit.showPopup id:"+popupId);
yellow.toolbox.setVisible(element, true);
this.popupId = popupId;
this.updateToolbar(status, "yellow-toolbar-selected");
@@ -787,7 +787,7 @@ yellow.edit = {
hidePopup: function(popupId, fadeout) {
var element = document.getElementById(popupId);
if (yellow.toolbox.isVisible(element)) {
- if (yellow.system.debug) console.log("yellow.edit.hidePopup id:"+popupId);
+ if (yellow.system.coreDebugMode) console.log("yellow.edit.hidePopup id:"+popupId);
yellow.toolbox.setVisible(element, false, fadeout);
this.popupId = 0;
this.updateToolbar(0, "yellow-toolbar-selected");
@@ -1090,7 +1090,7 @@ yellow.editor = {
element.value = textSelectionBefore + textSelectionNew + textSelectionAfter;
element.setSelectionRange(selectionStartNew, selectionEndNew);
}
- if (yellow.system.debug) console.log("yellow.editor.setMarkdown type:"+information.type);
+ if (yellow.system.coreDebugMode) console.log("yellow.editor.setMarkdown type:"+information.type);
},
// Return Markdown formatting information
@@ -1224,7 +1224,7 @@ yellow.editor = {
element.value = textSelectionBefore + textSelectionNew + textSelectionAfter;
element.setSelectionRange(selectionStartNew, selectionEndNew);
element.scrollTop = 0;
- if (yellow.system.debug) console.log("yellow.editor.setMetaData key:"+key);
+ if (yellow.system.coreDebugMode) console.log("yellow.editor.setMetaData key:"+key);
}
},
diff --git a/system/extensions/edit.php b/system/extensions/edit.php
@@ -2,7 +2,7 @@
// Edit extension, https://github.com/datenstrom/yellow-extensions/tree/master/source/edit
class YellowEdit {
- const VERSION = "0.8.55";
+ const VERSION = "0.8.56";
public $yellow; // access to API
public $response; // web response
public $merge; // text merge
@@ -819,7 +819,7 @@ class YellowEdit {
$page = $this->response->getPagePreview($scheme, $address, $base, $location, $fileName,
$this->yellow->page->getRequest("rawdataedit"), $this->yellow->page->getRequest("rawdataendofline"));
$statusCode = $this->yellow->sendData(200, $page->outputData, "", false);
- if (defined("DEBUG") && DEBUG>=1) echo "YellowEdit::processRequestPreview file:$fileName<br/>\n";
+ if ($this->yellow->system->get("coreDebugMode")>=1) echo "YellowEdit::processRequestPreview file:$fileName<br/>\n";
return $statusCode;
}
@@ -1218,6 +1218,7 @@ class YellowEditResponse {
$data["coreServerScheme"] = $this->yellow->system->get("coreServerScheme");
$data["coreServerAddress"] = $this->yellow->system->get("coreServerAddress");
$data["coreServerBase"] = $this->yellow->system->get("coreServerBase");
+ $data["coreDebugMode"] = $this->yellow->system->get("coreDebugMode");
$data = array_merge($data, $this->yellow->system->getSettings("", "Location"));
if ($this->isUser()) {
$data["coreFileSizeMax"] = $this->yellow->toolbox->getNumberBytes(ini_get("upload_max_filesize"));
@@ -1247,7 +1248,6 @@ class YellowEditResponse {
$data["editLoginPassword"] = $this->yellow->page->get("editLoginPassword");
$data["editLoginRestriction"] = intval($this->isLoginRestriction());
}
- if (defined("DEBUG") && DEBUG>=1) $data["debug"] = DEBUG;
return $data;
}
@@ -1929,7 +1929,6 @@ class YellowEditMerge {
} else {
$this->mergeConflict($diff, $diffMine[$posMine], $diffYours[$posYours], true);
}
- if (defined("DEBUG") && DEBUG>=2) echo "YellowEditMerge::mergeDiff $typeMine $typeYours pos:$posMine\t$posYours<br/>\n";
if ($typeMine==YellowEditMerge::ADD || $typeYours==YellowEditMerge::ADD) {
if ($typeMine==YellowEditMerge::ADD) ++$posMine;
if ($typeYours==YellowEditMerge::ADD) ++$posYours;
@@ -1942,13 +1941,11 @@ class YellowEditMerge {
array_push($diff, $diffMine[$posMine]);
$typeMine = $diffMine[$posMine][0];
$typeYours = " ";
- if (defined("DEBUG") && DEBUG>=2) echo "YellowEditMerge::mergeDiff $typeMine $typeYours pos:$posMine\t$posYours<br/>\n";
}
for (;$posYours<count($diffYours); ++$posYours) {
array_push($diff, $diffYours[$posYours]);
$typeYours = $diffYours[$posYours][0];
$typeMine = " ";
- if (defined("DEBUG") && DEBUG>=2) echo "YellowEditMerge::mergeDiff $typeMine $typeYours pos:$posMine\t$posYours<br/>\n";
}
return $diff;
}
diff --git a/system/extensions/install.php b/system/extensions/install.php
@@ -2,7 +2,7 @@
// Install extension, https://github.com/datenstrom/yellow-extensions/tree/master/source/install
class YellowInstall {
- const VERSION = "0.8.61";
+ const VERSION = "0.8.62";
const PRIORITY = "1";
public $yellow; // access to API
@@ -271,7 +271,7 @@ class YellowInstall {
// Check web server requirements
public function checkServerRequirements() {
- if (defined("DEBUG") && DEBUG>=1) {
+ if ($this->yellow->system->get("coreDebugMode")>=1) {
list($name, $version, $os) = $this->yellow->toolbox->detectServerInformation();
echo "YellowInstall::checkServerRequirements for $name $version, $os<br/>\n";
}
@@ -301,7 +301,9 @@ class YellowInstall {
foreach ($fileNames as $fileName) {
if (!is_file($fileName) || filesize($fileName)==0) {
$complete = false;
- if (defined("DEBUG") && DEBUG>=1) echo "YellowInstall::checkServerComplete detected missing file:$fileName<br/>\n";
+ if ($this->yellow->system->get("coreDebugMode")>=1) {
+ echo "YellowInstall::checkServerComplete detected missing file:$fileName<br/>\n";
+ }
}
}
return $complete;
@@ -342,7 +344,7 @@ class YellowInstall {
// Check command line requirements
public function checkCommandRequirements() {
- if (defined("DEBUG") && DEBUG>=1) {
+ if ($this->yellow->system->get("coreDebugMode")>=1) {
list($name, $version, $os) = $this->yellow->toolbox->detectServerInformation();
echo "YellowInstall::checkCommandRequirements for $name $version, $os<br/>\n";
}
diff --git a/system/extensions/update-current.ini b/system/extensions/update-current.ini
@@ -1,31 +1,31 @@
# Datenstrom Yellow update settings
Extension: Bundle
-Version: 0.8.23
+Version: 0.8.24
Description: Bundle website files.
HelpUrl: https://github.com/datenstrom/yellow-extensions/tree/master/source/bundle
DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/master/zip/bundle.zip
-Published: 2022-01-10 18:37:31
+Published: 2022-03-11 00:39:48
Developer: Datenstrom
Tag: feature
system/extensions/bundle.php: bundle.php, create, update
Extension: Command
-Version: 0.8.32
+Version: 0.8.33
Description: Command line of the website.
HelpUrl: https://github.com/datenstrom/yellow-extensions/tree/master/source/command
DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/master/zip/command.zip
-Published: 2021-12-06 16:12:16
+Published: 2022-03-11 00:29:08
Developer: Datenstrom
Tag: feature
system/extensions/command.php: command.php, create, update
Extension: Core
-Version: 0.8.58
+Version: 0.8.59
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: 2022-01-13 19:40:30
+Published: 2022-03-11 00:35:26
Developer: Datenstrom
Tag: feature
system/extensions/core.php: core.php, create, update
@@ -37,11 +37,11 @@ system/layouts/navigation.html: navigation.html, create, update, careful
system/layouts/pagination.html: pagination.html, create, update, careful
Extension: Edit
-Version: 0.8.55
+Version: 0.8.56
Description: Edit your website in a web browser.
HelpUrl: https://github.com/datenstrom/yellow-extensions/tree/master/source/edit
DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/master/zip/edit.zip
-Published: 2021-11-20 17:17:51
+Published: 2022-03-11 00:51:13
Developer: Datenstrom
Tag: feature
system/extensions/edit.php: edit.php, create, update
@@ -64,11 +64,11 @@ media/images/photo.jpg: photo.jpg, create, optional
media/thumbnails/photo-100x40.jpg: photo-100x40.jpg, create, optional
Extension: Install
-Version: 0.8.61
+Version: 0.8.62
Description: Install a brand new, shiny website.
HelpUrl: https://github.com/datenstrom/yellow-extensions/tree/master/source/install
DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/master/zip/install.zip
-Published: 2021-12-09 12:27:33
+Published: 2022-03-11 01:33:02
Developer: Datenstrom
Status: unlisted
system/extensions/install.php: install.php, create
@@ -131,11 +131,11 @@ system/themes/stockholm-opensans-light.woff: stockholm-opensans-light.woff, crea
system/themes/stockholm-opensans-regular.woff: stockholm-opensans-regular.woff, create, update, careful
Extension: Update
-Version: 0.8.63
+Version: 0.8.64
Description: Keep your website up to date.
HelpUrl: https://github.com/datenstrom/yellow-extensions/tree/master/source/update
DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/master/zip/update.zip
-Published: 2021-12-09 15:00:07
+Published: 2022-03-11 00:33:02
Developer: Datenstrom
Tag: feature
system/extensions/update.php: update.php, create, update
diff --git a/system/extensions/update.php b/system/extensions/update.php
@@ -2,7 +2,7 @@
// Update extension, https://github.com/datenstrom/yellow-extensions/tree/master/source/update
class YellowUpdate {
- const VERSION = "0.8.63";
+ const VERSION = "0.8.64";
const PRIORITY = "2";
public $yellow; // access to API
public $updates; // number of updates
@@ -308,7 +308,7 @@ class YellowUpdate {
$statusCode = 200;
$zip = new ZipArchive();
if ($zip->open($path)===true) {
- if (defined("DEBUG") && DEBUG>=2) echo "YellowUpdate::updateExtensionArchive file:$path<br/>\n";
+ if ($this->yellow->system->get("coreDebugMode")>=2) echo "YellowUpdate::updateExtensionArchive file:$path<br/>\n";
$pathBase = "";
if (preg_match("#^(.*\/).*?$#", $zip->getNameIndex(0), $matches)) $pathBase = $matches[1];
$fileData = $zip->getFromName($pathBase.$this->yellow->system->get("updateExtensionFile"));
@@ -390,7 +390,7 @@ class YellowUpdate {
$this->yellow->page->error($statusCode, "Can't delete file '$fileName'!");
}
}
- if (defined("DEBUG") && DEBUG>=2) {
+ if ($this->yellow->system->get("coreDebugMode")>=2) {
$debug = "action:".($create ? "create" : "").($update ? "update" : "").($delete ? "delete" : "");
if (!$create && !$update && !$delete) $debug = "action:none";
echo "YellowUpdate::updateExtensionFile file:$fileName $debug<br/>\n";
@@ -601,7 +601,7 @@ class YellowUpdate {
$statusCode = 500;
$this->yellow->page->error($statusCode, "Can't delete file '$fileName'!");
}
- if (defined("DEBUG") && DEBUG>=2) {
+ if ($this->yellow->system->get("coreDebugMode")>=2) {
echo "YellowUpdate::removeExtensionFile file:$fileName action:delete<br/>\n";
}
}
@@ -836,7 +836,9 @@ class YellowUpdate {
$statusCode = 500;
$this->yellow->page->error($statusCode, "Can't download file '$url'!");
}
- if (defined("DEBUG") && DEBUG>=2) echo "YellowUpdate::getExtensionFile status:$statusCode url:$url<br/>\n";
+ if ($this->yellow->system->get("coreDebugMode")>=2) {
+ echo "YellowUpdate::getExtensionFile status:$statusCode url:$url<br/>\n";
+ }
return array($statusCode, $fileData);
}