rename handle_404 to four_oh_four - stop confusing it with file handlers

This commit is contained in:
Shish 2020-02-23 18:46:27 +00:00
parent 174b87d0c4
commit 9dcc8b7da1
3 changed files with 6 additions and 6 deletions

View File

@ -1,8 +1,8 @@
<?php declare(strict_types=1); <?php declare(strict_types=1);
class Handle404Info extends ExtensionInfo class FourOhFourInfo extends ExtensionInfo
{ {
public const KEY = "handle_404"; public const KEY = "four_oh_four";
public $key = self::KEY; public $key = self::KEY;
public $name = "404 Detector"; public $name = "404 Detector";

View File

@ -1,7 +1,6 @@
<?php declare(strict_types=1); <?php declare(strict_types=1);
class FourOhFour extends Extension
class Handle404 extends Extension
{ {
public function onPageRequest(PageRequestEvent $event) public function onPageRequest(PageRequestEvent $event)
{ {
@ -9,7 +8,7 @@ class Handle404 extends Extension
// hax. // hax.
if ($page->mode == PageMode::PAGE && (!isset($page->blocks) || $this->count_main($page->blocks) == 0)) { if ($page->mode == PageMode::PAGE && (!isset($page->blocks) || $this->count_main($page->blocks) == 0)) {
$h_pagename = html_escape(implode('/', $event->args)); $h_pagename = html_escape(implode('/', $event->args));
log_debug("handle_404", "Hit 404: $h_pagename"); log_debug("four_oh_four", "Hit 404: $h_pagename");
$page->set_code(404); $page->set_code(404);
$page->set_title("404"); $page->set_title("404");
$page->set_heading("404 - No Handler Found"); $page->set_heading("404 - No Handler Found");

View File

@ -1,5 +1,6 @@
<?php declare(strict_types=1); <?php declare(strict_types=1);
class Handle404Test extends ShimmiePHPUnitTestCase
class FourOhFourTest extends ShimmiePHPUnitTestCase
{ {
public function test404Handler() public function test404Handler()
{ {