/**
* Returns a Content object representing the pages effective display content,
- * not necessarily the revision's content!
- *
- * Note that getContent/loadContent do not follow redirects anymore.
+ * not necessarily the revision's content!
+ *
+ * Note that getContent/loadContent do not follow redirects anymore.
* If you need to fetch redirectable content easily, try
* the shortcut in WikiPage::getRedirectTarget()
*
'ZhClient' => 'includes/ZhClient.php',
'ZipDirectoryReader' => 'includes/ZipDirectoryReader.php',
- # content handler
- 'Content' => 'includes/Content.php',
- 'AbstractContent' => 'includes/Content.php',
- 'ContentHandler' => 'includes/ContentHandler.php',
- 'CssContent' => 'includes/Content.php',
- 'CssContentHandler' => 'includes/ContentHandler.php',
- 'JavaScriptContent' => 'includes/Content.php',
- 'JavaScriptContentHandler' => 'includes/ContentHandler.php',
- 'MessageContent' => 'includes/Content.php',
- 'TextContent' => 'includes/Content.php',
- 'WikitextContent' => 'includes/Content.php',
- 'WikitextContentHandler' => 'includes/ContentHandler.php',
+ # content handler
+ 'Content' => 'includes/Content.php',
+ 'AbstractContent' => 'includes/Content.php',
+ 'ContentHandler' => 'includes/ContentHandler.php',
+ 'CssContent' => 'includes/Content.php',
+ 'CssContentHandler' => 'includes/ContentHandler.php',
+ 'JavaScriptContent' => 'includes/Content.php',
+ 'JavaScriptContentHandler' => 'includes/ContentHandler.php',
+ 'MessageContent' => 'includes/Content.php',
+ 'TextContent' => 'includes/Content.php',
+ 'WikitextContent' => 'includes/Content.php',
+ 'WikitextContentHandler' => 'includes/ContentHandler.php',
# includes/actions
'CachedAction' => 'includes/actions/CachedAction.php',
'ApiFormatDump' => 'includes/api/ApiFormatDump.php',
'ApiFormatFeedWrapper' => 'includes/api/ApiFormatBase.php',
'ApiFormatJson' => 'includes/api/ApiFormatJson.php',
- 'ApiFormatNone' => 'includes/api/ApiFormatNone.php',
+ 'ApiFormatNone' => 'includes/api/ApiFormatNone.php',
'ApiFormatPhp' => 'includes/api/ApiFormatPhp.php',
'ApiFormatRaw' => 'includes/api/ApiFormatRaw.php',
'ApiFormatTxt' => 'includes/api/ApiFormatTxt.php',
* Each entry in the array maps a model id to a class name
*/
$wgContentHandlers = array(
- CONTENT_MODEL_WIKITEXT => 'WikitextContentHandler', // the usual case
- CONTENT_MODEL_JAVASCRIPT => 'JavaScriptContentHandler', // dumb version, no syntax highlighting
- CONTENT_MODEL_CSS => 'CssContentHandler', // dumb version, no syntax highlighting
- CONTENT_MODEL_TEXT => 'TextContentHandler', // dumb plain text in <pre>
+ CONTENT_MODEL_WIKITEXT => 'WikitextContentHandler', // the usual case
+ CONTENT_MODEL_JAVASCRIPT => 'JavaScriptContentHandler', // dumb version, no syntax highlighting
+ CONTENT_MODEL_CSS => 'CssContentHandler', // dumb version, no syntax highlighting
+ CONTENT_MODEL_TEXT => 'TextContentHandler', // dumb plain text in <pre>
);
/**
*/
class DeprecatedGlobal extends StubObject {
- // The m's are to stay consistent with parent class.
+ // The m's are to stay consistent with parent class.
protected $mRealValue, $mVersion;
function __construct( $name, $realValue, $version = false ) {
$diffText = '';
// Don't bother generating the diff if we won't be able to show it
if ( $wgFeedDiffCutoff > 0 ) {
- $contentHandler = ContentHandler::getForTitle( $title );
- $de = $contentHandler->createDifferenceEngine( $title, $oldid, $newid );
+ $contentHandler = ContentHandler::getForTitle( $title );
+ $de = $contentHandler->createDifferenceEngine( $title, $oldid, $newid );
$diffText = $de->getDiff(
wfMsg( 'previousrevision' ), // hack
wfMsg( 'revisionasof',
return $r;
}
- /**
- * Overloading Article's getContentObject method.
- *
- * Omit noarticletext if sharedupload; text will be fetched from the
- * shared upload server if possible.
- * @return string
- */
- public function getContentObject() {
- $this->loadFile();
- if ( $this->mPage->getFile() && !$this->mPage->getFile()->isLocal() && 0 == $this->getID() ) {
- return null;
- }
- return parent::getContentObject();
- }
+ /**
+ * Overloading Article's getContentObject method.
+ *
+ * Omit noarticletext if sharedupload; text will be fetched from the
+ * shared upload server if possible.
+ * @return string
+ */
+ public function getContentObject() {
+ $this->loadFile();
+ if ( $this->mPage->getFile() && !$this->mPage->getFile()->isLocal() && 0 == $this->getID() ) {
+ return null;
+ }
+ return parent::getContentObject();
+ }
protected function openShowImage() {
global $wgImageLimits, $wgEnableUploads, $wgSend404Code;
$this->getOutput()->returnToMain( false, $this->getTitle() );
if ( !$request->getBool( 'hidediff', false ) && !$this->getUser()->getBoolOption( 'norollbackdiff', false ) ) {
- $contentHandler = ContentHandler::getForTitle( $this->getTitle() );
- $de = $contentHandler->createDifferenceEngine( $this->getContext(), $current->getId(), $newId, false, true );
+ $contentHandler = ContentHandler::getForTitle( $this->getTitle() );
+ $de = $contentHandler->createDifferenceEngine( $this->getContext(), $current->getId(), $newId, false, true );
$de->showDiff( '', '' );
}
}
$rev1 = $this->revisionOrTitleOrId( $params['fromrev'], $params['fromtitle'], $params['fromid'] );
$rev2 = $this->revisionOrTitleOrId( $params['torev'], $params['totitle'], $params['toid'] );
- $contentHandler = ContentHandler::getForModelID( $rev1->getContentModel() );
- $de = $contentHandler->createDifferenceEngine( $this->getContext(),
+ $contentHandler = ContentHandler::getForModelID( $rev1->getContentModel() );
+ $de = $contentHandler->createDifferenceEngine( $this->getContext(),
$rev1,
$rev2,
null, // rcid
if ( !is_null( $params['section'] ) ) {
// Process the content for section edits
$section = intval( $params['section'] );
- $sectionContent = $content->getSection( $section );
- $text = ContentHandler::getContentText( $sectionContent ); #FIXME: serialize?! get format from params?...
+ $sectionContent = $content->getSection( $section );
+ $text = ContentHandler::getContentText( $sectionContent ); #FIXME: serialize?! get format from params?...
if ( $text === false || $text === null ) {
$this->dieUsage( "There is no section {$section}.", 'nosuchsection' );
}
// TODO: Make them not or check if they still do
$wgTitle = $titleObj;
- $handler = ContentHandler::getForTitle( $titleObj );
+ $handler = ContentHandler::getForTitle( $titleObj );
$ep = $handler->createEditPage( $articleObj );
$ep->setContextTitle( $titleObj );
$this->dieUsage( "There is no revision ID {$page->getLatest()}", 'missingrev' );
}
if ( $getWikitext ) {
- $this->content = $page->getContent( Revision::RAW ); #FIXME: use $this->content everywhere
+ $this->content = $page->getContent( Revision::RAW ); #FIXME: use $this->content everywhere
$this->text = ContentHandler::getContentText( $this->content ); #FIXME: serialize, get format from params; or use object structure in result?
}
return $pout;
$rev2 = self::revOrTitle( $data['Revision2'], $data['Page2'] );
if( $rev1 && $rev2 ) {
- $contentHandler = ContentHandler::getForModelID( $rev1->getContentModel() );
+ $contentHandler = ContentHandler::getForModelID( $rev1->getContentModel() );
$de = $contentHandler->createDifferenceEngine( $form->getContext(),
$rev1,
$rev2,