rename handle_static to static_files - stop confusing it with file handlers

This commit is contained in:
Shish 2020-02-23 18:48:25 +00:00
parent 9dcc8b7da1
commit e1e161759e
19 changed files with 14 additions and 14 deletions

View File

@ -383,7 +383,7 @@ class BasePage
$this->add_html_header("<script type='text/javascript'>base_href = '$data_href';</script>", 40); $this->add_html_header("<script type='text/javascript'>base_href = '$data_href';</script>", 40);
# static handler will map these to themes/foo/static/bar.ico or ext/handle_static/static/bar.ico # static handler will map these to themes/foo/static/bar.ico or ext/static_files/static/bar.ico
$this->add_html_header("<link rel='icon' type='image/x-icon' href='$data_href/favicon.ico'>", 41); $this->add_html_header("<link rel='icon' type='image/x-icon' href='$data_href/favicon.ico'>", 41);
$this->add_html_header("<link rel='apple-touch-icon' href='$data_href/apple-touch-icon.png'>", 42); $this->add_html_header("<link rel='apple-touch-icon' href='$data_href/apple-touch-icon.png'>", 42);
@ -425,7 +425,7 @@ class BasePage
"vendor/bower-asset/jquery-timeago/jquery.timeago.js", "vendor/bower-asset/jquery-timeago/jquery.timeago.js",
"vendor/bower-asset/tablesorter/jquery.tablesorter.min.js", "vendor/bower-asset/tablesorter/jquery.tablesorter.min.js",
"vendor/bower-asset/js-cookie/src/js.cookie.js", "vendor/bower-asset/js-cookie/src/js.cookie.js",
"ext/handle_static/modernizr-3.3.1.custom.js", "ext/static_files/modernizr-3.3.1.custom.js",
], ],
zglob("ext/{" . Extension::get_enabled_extensions_as_string() . "}/script.js"), zglob("ext/{" . Extension::get_enabled_extensions_as_string() . "}/script.js"),
zglob("themes/$theme_name/script.js") zglob("themes/$theme_name/script.js")

View File

@ -345,8 +345,8 @@ function exit_with_page($title, $body, $code=0)
<html> <html>
<head> <head>
<title>Shimmie Installer</title> <title>Shimmie Installer</title>
<link rel=\"shortcut icon\" href=\"ext/handle_static/static/favicon.ico\"> <link rel=\"shortcut icon\" href=\"ext/static_files/static/favicon.ico\">
<link rel=\"stylesheet\" href=\"ext/handle_static/style.css\" type=\"text/css\"> <link rel=\"stylesheet\" href=\"ext/static_files/style.css\" type=\"text/css\">
</head> </head>
<body> <body>
<div id=\"installer\"> <div id=\"installer\">

View File

@ -24,7 +24,7 @@ class BrowserSearch extends Extension
$search_title = $config->get_string(SetupConfig::TITLE); $search_title = $config->get_string(SetupConfig::TITLE);
$search_form_url = make_link('post/list/{searchTerms}'); $search_form_url = make_link('post/list/{searchTerms}');
$suggenton_url = make_link('browser_search/')."{searchTerms}"; $suggenton_url = make_link('browser_search/')."{searchTerms}";
$icon_b64 = base64_encode(file_get_contents("ext/handle_static/static/favicon.ico")); $icon_b64 = base64_encode(file_get_contents("ext/static_files/static/favicon.ico"));
// Now for the XML // Now for the XML
$xml = " $xml = "

View File

@ -4,7 +4,7 @@ class IcoFileHandlerTest extends ShimmiePHPUnitTestCase
public function testIcoHander() public function testIcoHander()
{ {
$this->log_in_as_user(); $this->log_in_as_user();
$image_id = $this->post_image("ext/handle_static/static/favicon.ico", "shimmie favicon"); $image_id = $this->post_image("ext/static_files/static/favicon.ico", "shimmie favicon");
$page = $this->get_page("post/view/$image_id"); $page = $this->get_page("post/view/$image_id");
$this->assertEquals(200, $page->code); $this->assertEquals(200, $page->code);

View File

@ -1,8 +1,8 @@
<?php declare(strict_types=1); <?php declare(strict_types=1);
class HandleStaticInfo extends ExtensionInfo class StaticFilesInfo extends ExtensionInfo
{ {
public const KEY = "handle_static"; public const KEY = "static_files";
public $key = self::KEY; public $key = self::KEY;
public $name = "Static File Handler"; public $name = "Static File Handler";
@ -10,6 +10,6 @@ class HandleStaticInfo extends ExtensionInfo
public $authors = self::SHISH_AUTHOR; public $authors = self::SHISH_AUTHOR;
public $license = self::LICENSE_GPLV2; public $license = self::LICENSE_GPLV2;
public $visibility = self::VISIBLE_ADMIN; public $visibility = self::VISIBLE_ADMIN;
public $description = 'If Shimmie can\'t handle a request, check static files ($theme/static/$filename, then ext/handle_static/static/$filename)'; public $description = 'If Shimmie can\'t handle a request, check static files ($theme/static/$filename, then ext/static_files/static/$filename)';
public $core = true; public $core = true;
} }

View File

@ -1,6 +1,6 @@
<?php declare(strict_types=1); <?php declare(strict_types=1);
class HandleStatic extends Extension class StaticFiles extends Extension
{ {
public function onPageRequest(PageRequestEvent $event) public function onPageRequest(PageRequestEvent $event)
{ {
@ -12,7 +12,7 @@ class HandleStatic extends Extension
$theme_name = $config->get_string(SetupConfig::THEME, "default"); $theme_name = $config->get_string(SetupConfig::THEME, "default");
$theme_file = "themes/$theme_name/static/$f_pagename"; $theme_file = "themes/$theme_name/static/$f_pagename";
$static_file = "ext/handle_static/static/$f_pagename"; $static_file = "ext/static_files/static/$f_pagename";
if (file_exists($theme_file) || file_exists($static_file)) { if (file_exists($theme_file) || file_exists($static_file)) {
$filename = file_exists($theme_file) ? $theme_file : $static_file; $filename = file_exists($theme_file) ? $theme_file : $static_file;

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

Before

Width:  |  Height:  |  Size: 265 B

After

Width:  |  Height:  |  Size: 265 B

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

Before

Width:  |  Height:  |  Size: 43 B

After

Width:  |  Height:  |  Size: 43 B

View File

@ -1,5 +1,5 @@
<?php declare(strict_types=1); <?php declare(strict_types=1);
class HandleStaticTest extends ShimmiePHPUnitTestCase class StaticFilesTest extends ShimmiePHPUnitTestCase
{ {
public function testStaticHandler() public function testStaticHandler()
{ {

View File

@ -60,8 +60,8 @@ if (!file_exists("vendor/")) {
<html> <html>
<head> <head>
<title>Shimmie Error</title> <title>Shimmie Error</title>
<link rel="shortcut icon" href="ext/handle_static/static/favicon.ico"> <link rel="shortcut icon" href="ext/static_files/static/favicon.ico">
<link rel="stylesheet" href="ext/handle_static/style.css" type="text/css"> <link rel="stylesheet" href="ext/static_files/style.css" type="text/css">
</head> </head>
<body> <body>
<div id="installer"> <div id="installer">