Updated API, renamed page->clean() to page->status()

This commit is contained in:
markseu 2022-05-08 11:19:51 +02:00
parent f3c6303c08
commit 6e57e1257f
2 changed files with 6 additions and 6 deletions

View file

@ -2,7 +2,7 @@
// Core extension, https://github.com/datenstrom/yellow-extensions/tree/master/source/core // Core extension, https://github.com/datenstrom/yellow-extensions/tree/master/source/core
class YellowCore { class YellowCore {
const VERSION = "0.8.77"; const VERSION = "0.8.78";
const RELEASE = "0.8.19"; const RELEASE = "0.8.19";
public $page; // current page public $page; // current page
public $content; // content files public $content; // content files
@ -239,7 +239,7 @@ class YellowCore {
// Send status response // Send status response
public function sendStatus($statusCode, $location = "") { public function sendStatus($statusCode, $location = "") {
if (!empty($location)) $this->page->clean($statusCode, $location); if (!empty($location)) $this->page->status($statusCode, $location);
@header($this->toolbox->getHttpStatusFormatted($statusCode)); @header($this->toolbox->getHttpStatusFormatted($statusCode));
foreach ($this->page->headerData as $key=>$value) { foreach ($this->page->headerData as $key=>$value) {
@header("$key: $value"); @header("$key: $value");
@ -603,7 +603,7 @@ class YellowPage {
if ($this->yellow->getRequestHandler()=="core" && $this->isExisting("redirect") && $this->statusCode==200) { if ($this->yellow->getRequestHandler()=="core" && $this->isExisting("redirect") && $this->statusCode==200) {
$location = $this->yellow->lookup->normaliseLocation($this->get("redirect"), $this->location); $location = $this->yellow->lookup->normaliseLocation($this->get("redirect"), $this->location);
$location = $this->yellow->lookup->normaliseUrl($this->scheme, $this->address, "", $location); $location = $this->yellow->lookup->normaliseUrl($this->scheme, $this->address, "", $location);
$this->clean(301, $location); $this->status(301, $location);
} }
if ($this->yellow->getRequestHandler()=="core" && !$this->isAvailable() && $this->statusCode==200) { if ($this->yellow->getRequestHandler()=="core" && !$this->isAvailable() && $this->statusCode==200) {
$this->error(404); $this->error(404);
@ -901,7 +901,7 @@ class YellowPage {
} }
// Respond with status code, no page content // Respond with status code, no page content
public function clean($statusCode, $location = "") { public function status($statusCode, $location = "") {
if ($statusCode>0 && !$this->isExisting("pageClean")) { if ($statusCode>0 && !$this->isExisting("pageClean")) {
$this->statusCode = $statusCode; $this->statusCode = $statusCode;
$this->lastModified = 0; $this->lastModified = 0;

View file

@ -21,11 +21,11 @@ Tag: feature
system/extensions/command.php: command.php, create, update system/extensions/command.php: command.php, create, update
Extension: Core Extension: Core
Version: 0.8.77 Version: 0.8.78
Description: Core functionality of the website. Description: Core functionality of the website.
DocumentationUrl: https://github.com/datenstrom/yellow-extensions/tree/master/source/core DocumentationUrl: https://github.com/datenstrom/yellow-extensions/tree/master/source/core
DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/master/zip/core.zip DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/master/zip/core.zip
Published: 2022-05-08 11:05:14 Published: 2022-05-08 11:15:46
Developer: Datenstrom Developer: Datenstrom
Tag: feature Tag: feature
system/extensions/core.php: core.php, create, update system/extensions/core.php: core.php, create, update