From ac5546c6efc44719b4923774ca5cc96b2508f7c8 Mon Sep 17 00:00:00 2001 From: Shish Date: Sun, 3 Nov 2019 16:22:59 +0000 Subject: [PATCH] remove more old comments --- core/_install.php | 32 +++++++++++++++----------------- ext/comment/main.php | 6 ------ ext/image/main.php | 9 +-------- ext/image_hash_ban/main.php | 6 ++---- ext/ipban/main.php | 13 +++---------- ext/setup/main.php | 23 +++++------------------ ext/tag_list/main.php | 11 ++--------- ext/upload/main.php | 3 --- ext/user/main.php | 10 +++------- ext/user/theme.php | 1 - ext/wiki/main.php | 2 -- 11 files changed, 31 insertions(+), 85 deletions(-) diff --git a/core/_install.php b/core/_install.php index a37553da..3f799d46 100644 --- a/core/_install.php +++ b/core/_install.php @@ -74,8 +74,7 @@ if (is_readable("data/config/shimmie.conf.php")) { do_install(); -// utilities {{{ - // TODO: Can some of these be pushed into "core/???.inc.php" ? +// TODO: Can some of these be pushed into "core/???.inc.php" ? function check_gd_version(): int { @@ -99,10 +98,9 @@ function check_im_version(): int return (empty($convert_check) ? 0 : 1); } -// }}} function do_install() -{ // {{{ +{ if (file_exists("data/config/auto_install.conf.php")) { require_once "data/config/auto_install.conf.php"; } elseif (@$_POST["database_type"] == DatabaseDriver::SQLITE) { @@ -118,10 +116,10 @@ function do_install() define("CACHE_DSN", null); define("DATABASE_KA", true); install_process(); -} // }}} +} function ask_questions() -{ // {{{ +{ $warnings = []; $errors = []; @@ -232,21 +230,21 @@ function ask_questions() EOD; -} // }}} +} /** * This is where the install really takes place. */ function install_process() -{ // {{{ +{ build_dirs(); create_tables(); insert_defaults(); write_config(); -} // }}} +} function create_tables() -{ // {{{ +{ try { $db = new Database(); @@ -331,10 +329,10 @@ EOD; } catch (Exception $e) { handle_db_errors(false, "An unknown error occurred while trying to insert data into the database.", $e->getMessage(), 4); } -} // }}} +} function insert_defaults() -{ // {{{ +{ try { $db = new Database(); @@ -350,10 +348,10 @@ function insert_defaults() } catch (Exception $e) { handle_db_errors(false, "An unknown error occurred while trying to insert data into the database.", $e->getMessage(), 6); } -} // }}} +} function build_dirs() -{ // {{{ +{ $data_exists = file_exists("data") || mkdir("data"); $data_writable = is_writable("data") || chmod("data", 0755); @@ -373,10 +371,10 @@ function build_dirs() "; exit(7); } -} // }}} +} function write_config() -{ // {{{ +{ $file_content = '<' . '?php' . "\n" . "define('DATABASE_DSN', '".DATABASE_DSN."');\n" . '?' . '>'; @@ -417,7 +415,7 @@ EOD; EOD; } echo "\n"; -} // }}} +} function handle_db_errors(bool $isPDO, string $errorMessage1, string $errorMessage2, int $exitCode) { diff --git a/ext/comment/main.php b/ext/comment/main.php index 3791ea00..8dca6983 100644 --- a/ext/comment/main.php +++ b/ext/comment/main.php @@ -367,7 +367,6 @@ class CommentList extends Extension } } - // page building {{{ private function build_page(int $current_page) { global $cache, $database, $user; @@ -417,9 +416,7 @@ class CommentList extends Extension $this->theme->display_comment_list($images, $current_page, $total_pages, $user->can(Permissions::CREATE_COMMENT)); } - // }}} - // get comments {{{ /** * #return Comment[] */ @@ -488,9 +485,7 @@ class CommentList extends Extension ORDER BY comments.id ASC ", ["image_id"=>$image_id]); } - // }}} - // add / remove / edit comments {{{ private function is_comment_limit_hit(): bool { global $config, $database; @@ -651,5 +646,4 @@ class CommentList extends Extension throw new CommentPostingException("Akismet thinks that your comment is spam. Try rewriting the comment, or logging in."); } } - // }}} } diff --git a/ext/image/main.php b/ext/image/main.php index 2dc8f72b..941e7492 100644 --- a/ext/image/main.php +++ b/ext/image/main.php @@ -159,8 +159,6 @@ class ImageIO extends Extension $event->panel->add_block($sb); } - - // add image {{{ private function add_image(ImageAdditionEvent $event) { global $user, $database, $config; @@ -237,9 +235,7 @@ class ImageIO extends Extension log_warning("add_image", "Error while running update_image_media_properties: ".$e->getMessage()); } } - // }}} end add - // fetch image {{{ private function send_file(int $image_id, string $type) { global $config; @@ -298,9 +294,7 @@ class ImageIO extends Extension )); } } - // }}} end fetch - // replace image {{{ private function replace_image(int $id, Image $image) { global $database; @@ -362,5 +356,4 @@ class ImageIO extends Extension log_info("image", "Replaced Image #{$id} with ({$image->hash})"); } - // }}} end replace -} // end of class ImageIO +} diff --git a/ext/image_hash_ban/main.php b/ext/image_hash_ban/main.php index 33ff65d5..0617b503 100644 --- a/ext/image_hash_ban/main.php +++ b/ext/image_hash_ban/main.php @@ -1,6 +1,5 @@ hash = $hash; } } -// }}} -// AddImageHashBanEvent {{{ + class AddImageHashBanEvent extends Event { public $hash; @@ -23,7 +21,7 @@ class AddImageHashBanEvent extends Event $this->reason = $reason; } } -// }}} + class ImageBan extends Extension { public function onInitExt(InitExtEvent $event) diff --git a/ext/ipban/main.php b/ext/ipban/main.php index 52b92fd9..9ebcca21 100644 --- a/ext/ipban/main.php +++ b/ext/ipban/main.php @@ -1,6 +1,5 @@ id = $id; } } -// }}} -// AddIPBanEvent {{{ + class AddIPBanEvent extends Event { public $ip; @@ -25,7 +23,6 @@ class AddIPBanEvent extends Event $this->end = trim($end); } } -// }}} class IPBan extends Extension { @@ -131,7 +128,6 @@ class IPBan extends Extension } } - // installer {{{ protected function install() { global $database; @@ -209,8 +205,7 @@ class IPBan extends Extension $config->set_int("ext_ipban_version", 8); } } - // }}} - // deal with banned person {{{ + private function check_ip_ban() { $remote = $_SERVER['REMOTE_ADDR']; @@ -266,8 +261,7 @@ class IPBan extends Extension log_error("ipban", "block($remote) called but no bans matched"); exit; } - // }}} - // database {{{ + private function get_bans() { global $database; @@ -328,5 +322,4 @@ class IPBan extends Extension $cache->set("ip_bans_sorted", $sorted, 600); return $sorted; } - // }}} } diff --git a/ext/setup/main.php b/ext/setup/main.php index 676442fe..12e4ea6b 100644 --- a/ext/setup/main.php +++ b/ext/setup/main.php @@ -2,8 +2,7 @@ include_once "config.php"; -/* ConfigSaveEvent {{{ - * +/* * Sent when the setup screen's 'set' button has been * activated; new config options are in $_POST */ @@ -17,9 +16,8 @@ class ConfigSaveEvent extends Event $this->config = $config; } } -// }}} -/* SetupBuildingEvent {{{ - * + +/* * Sent when the setup page is ready to be added to */ class SetupBuildingEvent extends Event @@ -32,10 +30,7 @@ class SetupBuildingEvent extends Event $this->panel = $panel; } } -// }}} -/* SetupPanel {{{ - * - */ + class SetupPanel { /** @var SetupBlock[] */ @@ -46,10 +41,7 @@ class SetupPanel $this->blocks[] = $block; } } -// }}} -/* SetupBlock {{{ - * - */ + class SetupBlock extends Block { /** @var string */ @@ -57,8 +49,6 @@ class SetupBlock extends Block /** @var string */ public $body; - - public function __construct(string $title) { $this->header = $title; @@ -134,8 +124,6 @@ class SetupBlock extends Block $this->end_table_header_cell(); } - - private function format_option(string $name, $html, ?string $label, bool $table_row) { if ($table_row) { @@ -274,7 +262,6 @@ class SetupBlock extends Block $this->format_option($name, $html, $label, $table_row); } } -// }}} class Setup extends Extension { diff --git a/ext/tag_list/main.php b/ext/tag_list/main.php index 24bdb92a..0b0f1b93 100644 --- a/ext/tag_list/main.php +++ b/ext/tag_list/main.php @@ -159,8 +159,7 @@ class TagList extends Extension $sb->end_table(); $event->panel->add_block($sb); } - // }}} - // misc {{{ + private function tag_link(string $tag): string { $u_tag = url_escape($tag); @@ -253,8 +252,6 @@ class TagList extends Extension return $html; } - // }}} - // maps {{{ private function build_navigation(): string { @@ -453,8 +450,7 @@ class TagList extends Extension return $html; } - // }}} - // blocks {{{ + private function add_related_block(Page $page, Image $image): void { global $database, $config; @@ -653,7 +649,4 @@ class TagList extends Extension return $related_tags; } } - - - // }}} } diff --git a/ext/upload/main.php b/ext/upload/main.php index 25a0daf9..9bc90995 100644 --- a/ext/upload/main.php +++ b/ext/upload/main.php @@ -291,8 +291,6 @@ class Upload extends Extension return $tags; } - // do things {{{ - /** * Returns a descriptive error message for the specified PHP error code. * @@ -475,5 +473,4 @@ class Upload extends Extension return $ok; } - // }}} } diff --git a/ext/user/main.php b/ext/user/main.php index 71e62d1f..7905c16f 100644 --- a/ext/user/main.php +++ b/ext/user/main.php @@ -339,8 +339,7 @@ class UserPage extends Extension $this->theme->display_user_block($page, $user, $ubbe->parts); } } - // }}} - // Things done *with* the user {{{ + private function page_login($name, $pass) { global $config, $page; @@ -490,8 +489,7 @@ class UserPage extends Extension '/' ); } - //}}} - // Things done *to* the user {{{ + private function user_can_edit_user(User $a, User $b): bool { if ($a->is_anonymous()) { @@ -581,8 +579,7 @@ class UserPage extends Extension $this->redirect_to_user($duser); } } - // }}} - // ips {{{ + private function count_upload_ips(User $duser): array { global $database; @@ -683,5 +680,4 @@ class UserPage extends Extension $page->set_redirect(make_link("post/list")); } } - // }}} } diff --git a/ext/user/theme.php b/ext/user/theme.php index 06ebc887..3c41641d 100644 --- a/ext/user/theme.php +++ b/ext/user/theme.php @@ -339,7 +339,6 @@ class UserPageTheme extends Themelet } return $html; } - // }}} public function get_help_html() { diff --git a/ext/wiki/main.php b/ext/wiki/main.php index 189a7797..d52b3059 100644 --- a/ext/wiki/main.php +++ b/ext/wiki/main.php @@ -265,7 +265,6 @@ class Wiki extends Extension return new WikiPage($row); } - // php-diff {{{ /** Diff implemented in pure php, written from scratch. Copyright (C) 2003 Daniel Unterberger @@ -502,5 +501,4 @@ class Wiki extends Extension throw new Exception("stat needs to be =, + or -"); } } - // }}} }