MediaWiki REL1_35
UnknownContentHandler.php
Go to the documentation of this file.
1<?php
35
48 public function __construct( $modelId, $formats = null ) {
49 parent::__construct(
50 $modelId,
51 $formats ?? [
52 'application/octet-stream',
53 'application/unknown',
54 'application/x-binary',
55 'text/unknown',
56 'unknown/unknown',
57 ]
58 );
59 }
60
69 public function serializeContent( Content $content, $format = null ) {
71 '@phan-var UnknownContent $content';
72 return $content->getData();
73 }
74
85 public function unserializeContent( $blob, $format = null ) {
86 return new UnknownContent( $blob, $this->getModelID() );
87 }
88
96 public function makeEmptyContent() {
97 return $this->unserializeContent( '' );
98 }
99
103 public function supportsDirectEditing() {
104 return false;
105 }
106
112 protected function getSlotDiffRendererInternal( IContextSource $context ) {
113 return new UnsupportedSlotDiffRenderer( $context );
114 }
115}
A content handler knows how do deal with a specific type of content on a wiki page.
getModelID()
Returns the model id that identifies the content model this ContentHandler can handle.
Content handler implementation for unknown content.
makeEmptyContent()
Creates an empty UnknownContent object.
serializeContent(Content $content, $format=null)
Returns the content's data as-is.
__construct( $modelId, $formats=null)
Constructs an UnknownContentHandler.
unserializeContent( $blob, $format=null)
Constructs an UnknownContent instance wrapping the given data.
getSlotDiffRendererInternal(IContextSource $context)
Content object implementation representing unknown content.
Produces a warning message about not being able to render a slot diff.
Base interface for content objects.
Definition Content.php:35
Interface for objects which can provide a MediaWiki context on request.
$content
Definition router.php:76