From 30698fefdc999bc549ebf90a5f3775c5dafc784e Mon Sep 17 00:00:00 2001 From: Shish Date: Wed, 2 Oct 2019 11:23:57 +0100 Subject: [PATCH] remove a bunch of dead variables and things --- .gitignore | 1 - core/_install.php | 10 ---------- core/cacheengine.php | 2 +- core/imageboard/image.php | 4 ---- core/polyfills.php | 1 - ext/bulk_actions/main.php | 2 +- ext/bulk_actions/theme.php | 2 -- ext/comment/main.php | 2 +- ext/cron_uploader/main.php | 2 -- ext/danbooru_api/main.php | 2 +- ext/ext_manager/main.php | 1 - ext/featured/main.php | 2 +- ext/forum/main.php | 2 +- ext/handle_404/main.php | 2 +- ext/handle_flash/main.php | 2 -- ext/handle_video/main.php | 2 -- ext/help_pages/main.php | 3 +-- ext/image/main.php | 14 ++++---------- ext/media/main.php | 2 +- ext/media/theme.php | 2 +- ext/oekaki/main.php | 2 +- ext/ouroboros_api/main.php | 12 +----------- ext/pools/main.php | 4 ++-- ext/post_titles/main.php | 2 +- ext/rating/main.php | 10 ++++------ ext/rating/theme.php | 6 ++---- ext/regen_thumb/main.php | 4 +--- ext/resize/main.php | 2 +- ext/rotate/main.php | 3 --- ext/rss_images/main.php | 2 +- ext/setup/main.php | 2 -- ext/system/main.php | 2 +- ext/tag_list/main.php | 3 +-- ext/transcode/main.php | 6 ++++-- ext/transcode/theme.php | 6 ++---- ext/trash/main.php | 2 +- ext/user/main.php | 3 +-- ext/user/theme.php | 4 ++-- themes/danbooru/layout.class.php | 4 ++-- themes/danbooru2/ext_manager.theme.php | 2 +- themes/danbooru2/layout.class.php | 2 +- themes/default/layout.class.php | 3 +-- themes/lite/layout.class.php | 4 ++-- themes/material/layout.class.php | 8 ++++---- themes/material/view.theme.php | 4 ---- 45 files changed, 51 insertions(+), 111 deletions(-) diff --git a/.gitignore b/.gitignore index 33a39f7d..65079abb 100644 --- a/.gitignore +++ b/.gitignore @@ -55,7 +55,6 @@ Icon *.un~ Session.vim .netrwhist -*~ ### PhpStorm ### diff --git a/core/_install.php b/core/_install.php index bf99bc21..a37553da 100644 --- a/core/_install.php +++ b/core/_install.php @@ -99,16 +99,6 @@ function check_im_version(): int return (empty($convert_check) ? 0 : 1); } - -function eok($name, $value) -{ - echo "
$name ... "; - if ($value) { - echo "ok\n"; - } else { - echo "failed\n"; - } -} // }}} function do_install() diff --git a/core/cacheengine.php b/core/cacheengine.php index 7d78abff..f8ecbbcb 100644 --- a/core/cacheengine.php +++ b/core/cacheengine.php @@ -127,7 +127,7 @@ class RedisCache implements CacheEngine public function delete(string $key) { - $this->redis->delete($key); + $this->redis->del($key); } } diff --git a/core/imageboard/image.php b/core/imageboard/image.php index 2c1a632e..1be0b839 100644 --- a/core/imageboard/image.php +++ b/core/imageboard/image.php @@ -13,7 +13,6 @@ class Image public const IMAGE_DIR = "images"; public const THUMBNAIL_DIR = "thumbs"; - private static $tag_n = 0; // temp hack public static $order_sql = null; // this feels ugly /** @var null|int */ @@ -875,8 +874,6 @@ class Image */ private static function build_search_querylet(array $tag_conditions, array $img_conditions): Querylet { - global $database; - $positive_tag_count = 0; $negative_tag_count = 0; foreach ($tag_conditions as $tq) { @@ -989,7 +986,6 @@ class Image } } - $sql = ""; assert($positive_tag_id_array || $positive_wildcard_id_array || $negative_tag_id_array, @$_GET['q']); if (!empty($positive_tag_id_array) || !empty($positive_wildcard_id_array)) { $inner_joins = []; diff --git a/core/polyfills.php b/core/polyfills.php index 4f0b2c71..87e739e3 100644 --- a/core/polyfills.php +++ b/core/polyfills.php @@ -281,7 +281,6 @@ const MIME_TYPE_MAP = [ 'mpg' => 'video/mpeg', 'mpeg' => 'video/mpeg', 'mov' => 'video/quicktime', - 'flv' => 'video/x-flv', 'php' => 'text/x-php', 'mp4' => 'video/mp4', 'ogv' => 'video/ogg', diff --git a/ext/bulk_actions/main.php b/ext/bulk_actions/main.php index dbae2b4c..d622f216 100644 --- a/ext/bulk_actions/main.php +++ b/ext/bulk_actions/main.php @@ -54,7 +54,7 @@ class BulkActions extends Extension { public function onPostListBuilding(PostListBuildingEvent $event) { - global $config, $page, $user; + global $page, $user; if ($user->is_logged_in()) { $babbe = new BulkActionBlockBuildingEvent(); diff --git a/ext/bulk_actions/theme.php b/ext/bulk_actions/theme.php index ed3c8a1e..9d1b854e 100644 --- a/ext/bulk_actions/theme.php +++ b/ext/bulk_actions/theme.php @@ -4,8 +4,6 @@ class BulkActionsTheme extends Themelet { public function display_selector(Page $page, array $actions, string $query) { - global $user; - $body = "