wiki.techinc.nl/includes/content
C. Scott Ananian df9756b9a1 Make Content JsonCodecable
By default this uses the existing ContentHandler::serializeContent() and
::unserializeContent() methods.  But in cases where existing PHP
serialization preserved fields that ::serializeContent() did not,
provide an additional ContentHandler::serializeContentToJsonArray()
and ContentHandler::deserializeContentFromJsonArray() methods which
can be used.  Use these in WikitextContentHandler to preserve the
PST flags.

Added test cases and a ContentSerializationTestTrait to make it
easy to ensure forward- and backward-compatibility in accord with

https://www.mediawiki.org/wiki/Manual:Parser_cache/Serialization_compatibility

The new JsonCodecable codec will be used to improve PageEditStashContent
serialization, which no longer has to PHP-serialize its Content object.
New test case added demonstrating compatibility.

Bug: T264389
Bug: T161647
Change-Id: I544625136088164561b9169a63aed7450cce82f5
(cherry picked from commit 21576d6c1893079777a1a51d0f81c4941c58e376)
2025-09-05 16:12:09 -04:00
..
Hook Namespace all remaining classes in includes/parser 2024-10-15 23:54:32 +01:00
Renderer Use explicit nullable type on parameter arguments 2024-10-16 20:58:33 +02:00
Transform Namespace all remaining classes in includes/parser 2024-10-15 23:54:32 +01:00
AbstractContent.php Make Content JsonCodecable 2025-09-05 16:12:09 -04:00
CodeContentHandler.php Use explicit nullable type on parameter arguments 2024-10-16 20:58:33 +02:00
Content.php Use explicit nullable type on parameter arguments 2024-10-16 20:58:33 +02:00
ContentHandler.php Make Content JsonCodecable 2025-09-05 16:12:09 -04:00
ContentHandlerFactory.php Move remaining four classes in includes/content into Content namespace 2024-08-10 10:40:53 +02:00
ContentJsonCodec.php Make Content JsonCodecable 2025-09-05 16:12:09 -04:00
ContentModelChange.php Move remaining four classes in includes/content into Content namespace 2024-08-10 10:40:53 +02:00
CssContent.php
CssContentHandler.php Move remaining four classes in includes/content into Content namespace 2024-08-10 10:40:53 +02:00
FallbackContent.php Move remaining four classes in includes/content into Content namespace 2024-08-10 10:40:53 +02:00
FallbackContentHandler.php Move remaining four classes in includes/content into Content namespace 2024-08-10 10:40:53 +02:00
FileContentHandler.php Fix some typos 2024-08-18 18:59:44 +02:00
IContentHandlerFactory.php Move remaining four classes in includes/content into Content namespace 2024-08-10 10:40:53 +02:00
JavaScriptContent.php
JavaScriptContentHandler.php Move remaining four classes in includes/content into Content namespace 2024-08-10 10:40:53 +02:00
JsonContent.php Made the JsonContent Responsive 2024-08-08 19:49:48 +05:30
JsonContentHandler.php Move remaining four classes in includes/content into Content namespace 2024-08-10 10:40:53 +02:00
TextContent.php Use explicit nullable type on parameter arguments 2024-10-16 20:58:33 +02:00
TextContentHandler.php Move remaining four classes in includes/content into Content namespace 2024-08-10 10:40:53 +02:00
ValidationParams.php
WikitextContent.php Use explicit nullable type on parameter arguments 2024-10-16 20:58:33 +02:00
WikitextContentHandler.php Make Content JsonCodecable 2025-09-05 16:12:09 -04:00
WikiTextStructure.php Add namespace to WikitextContent 2024-08-06 17:42:51 +03:30