From 40fa250a450130d5a952acd50505dac4d31941c3 Mon Sep 17 00:00:00 2001 From: SamanthaNguyen Date: Sat, 24 Feb 2018 18:19:31 -0600 Subject: [PATCH] Create a custom log formatter that allows log entries to contain wikitext This creates a new log formatter called WikitextLogFormatter, which is a simple class that allows log entries to contain properly formatted wikitext. This makes it easier for extensions so they don't have to create their own subclass of LogFormatter. Change-Id: I2b7fddf5c6ef017a0925b4bf75cfd47cb55aa5de --- autoload.php | 1 + includes/logging/WikitextLogFormatter.php | 35 +++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 includes/logging/WikitextLogFormatter.php diff --git a/autoload.php b/autoload.php index f8d1f9f409..ae0dd62e6c 100644 --- a/autoload.php +++ b/autoload.php @@ -1715,6 +1715,7 @@ $wgAutoloadLocalClasses = [ 'Wikimedia\\Rdbms\\TransactionProfiler' => __DIR__ . '/includes/libs/rdbms/TransactionProfiler.php', 'WikitextContent' => __DIR__ . '/includes/content/WikitextContent.php', 'WikitextContentHandler' => __DIR__ . '/includes/content/WikitextContentHandler.php', + 'WikitextLogFormatter' => __DIR__ . '/includes/logging/WikitextLogFormatter.php', 'WinCacheBagOStuff' => __DIR__ . '/includes/libs/objectcache/WinCacheBagOStuff.php', 'WithoutInterwikiPage' => __DIR__ . '/includes/specials/SpecialWithoutinterwiki.php', 'WordLevelDiff' => __DIR__ . '/includes/diff/WordLevelDiff.php', diff --git a/includes/logging/WikitextLogFormatter.php b/includes/logging/WikitextLogFormatter.php new file mode 100644 index 0000000000..13b55595d2 --- /dev/null +++ b/includes/logging/WikitextLogFormatter.php @@ -0,0 +1,35 @@ +parse(); + } +} -- 2.20.1