3 class DummyContentForTesting
extends AbstractContent
{
5 public function __construct( $data ) {
6 parent
::__construct( "testing" );
11 public function serialize( $format = null ) {
12 return serialize( $this->data
);
16 * @return string A string representing the content in a way useful for
17 * building a full text search index. If no useful representation exists,
18 * this method returns an empty string.
20 public function getTextForSearchIndex() {
25 * @return string|bool The wikitext to include when another page includes this content,
26 * or false if the content is not includable in a wikitext page.
28 public function getWikitextForTransclusion() {
33 * Returns a textual representation of the content suitable for use in edit
34 * summaries and log messages.
36 * @param int $maxlength Maximum length of the summary text.
37 * @return string The summary text.
39 public function getTextForSummary( $maxlength = 250 ) {
44 * Returns native represenation of the data. Interpretation depends on the data model used,
45 * as given by getDataModel().
47 * @return mixed The native representation of the content. Could be a string, a nested array
48 * structure, an object, a binary blob... anything, really.
50 public function getNativeData() {
55 * returns the content's nominal size in bogo-bytes.
59 public function getSize() {
60 return strlen( $this->data
);
64 * Return a copy of this Content object. The following must be true for the object returned
65 * if $copy = $original->copy()
67 * * get_class($original) === get_class($copy)
68 * * $original->getModel() === $copy->getModel()
69 * * $original->equals( $copy )
71 * If and only if the Content object is imutable, the copy() method can and should
72 * return $this. That is, $copy === $original may be true, but only for imutable content
75 * @return Content A copy of this object
77 public function copy() {
82 * Returns true if this content is countable as a "real" wiki page, provided
83 * that it's also in a countable location (e.g. a current revision in the main namespace).
85 * @param bool|null $hasLinks If it is known whether this content contains links,
86 * provide this information here, to avoid redundant parsing to find out.
89 public function isCountable( $hasLinks = null ) {
95 * @param int $revId Unused.
96 * @param null|ParserOptions $options
97 * @param bool $generateHtml Whether to generate Html (default: true). If false, the result
98 * of calling getText() on the ParserOutput object returned by this method is undefined.
100 * @return ParserOutput
102 public function getParserOutput( Title
$title, $revId = null,
103 ParserOptions
$options = null, $generateHtml = true
105 return new ParserOutput( $this->getNativeData() );
109 * @see AbstractContent::fillParserOutput()
111 * @param Title $title Context title for parsing
112 * @param int|null $revId Revision ID (for {{REVISIONID}})
113 * @param ParserOptions $options Parser options
114 * @param bool $generateHtml Whether or not to generate HTML
115 * @param ParserOutput &$output The output object to fill (reference).
117 protected function fillParserOutput( Title
$title, $revId,
118 ParserOptions
$options, $generateHtml, ParserOutput
&$output ) {
119 $output = new ParserOutput( $this->getNativeData() );