2013-02-20 22:00:42 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Scribunto Content Model
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @ingroup Extensions
|
|
|
|
* @ingroup Scribunto
|
|
|
|
*
|
|
|
|
* @author Brad Jorsch <bjorsch@wikimedia.org>
|
|
|
|
*/
|
|
|
|
|
2022-04-07 23:12:32 +00:00
|
|
|
namespace MediaWiki\Extension\Scribunto;
|
|
|
|
|
2024-01-05 18:24:06 +00:00
|
|
|
use MediaWiki\Title\Title;
|
2022-04-07 23:12:32 +00:00
|
|
|
use TextContent;
|
|
|
|
|
2013-02-20 22:00:42 +00:00
|
|
|
/**
|
|
|
|
* Represents the content of a Scribunto script page
|
|
|
|
*/
|
|
|
|
class ScribuntoContent extends TextContent {
|
|
|
|
|
2020-01-14 18:50:34 +00:00
|
|
|
/**
|
|
|
|
* @param string $text
|
|
|
|
*/
|
2018-11-09 19:31:08 +00:00
|
|
|
public function __construct( $text ) {
|
2014-09-16 03:25:53 +00:00
|
|
|
parent::__construct( $text, CONTENT_MODEL_SCRIBUNTO );
|
2013-02-20 22:00:42 +00:00
|
|
|
}
|
2020-02-21 20:49:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritDoc
|
|
|
|
*/
|
|
|
|
public function updateRedirect( Title $target ) {
|
|
|
|
return Scribunto::newDefaultEngine()->updateRedirect( $this, $target );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @inheritDoc
|
|
|
|
*/
|
|
|
|
public function getRedirectTarget() {
|
|
|
|
return Scribunto::newDefaultEngine()->getRedirectTarget( $this );
|
|
|
|
}
|
2013-02-20 22:00:42 +00:00
|
|
|
}
|