When trying to get parsedContent of Pages via the API along the lines of:
$title = Title::newFromText($titleText); $article = new Article($title); $wikitext = $article->getContent(); $content = $wgOut->parse($wikitext);
I run into trouble when trying to prepare for being able to use the above code snippet.
The code:
$preIP="/srv/www/intern/mediawiki-1.13.0";
putenv ("MW_INSTALL_PATH=$preIP");
require_once( "$preIP/includes/WebStart.php" );
Initialize MediaWiki base class
require_once( "$preIP/includes/Wiki.php" );
require_once( "$preIP/includes/Title.php" );
require_once( "$preIP/includes/Article.php" );
only works if no autoloader is running.
E.g. in WebRequest.php
/**
- Some entry points may use this file without first enabling the
- autoloader. */
if ( !function_exists( 'autoload' ) ) {
require_once( dirname(FILE__) . '/normal/UtfNormal.php' );
}
Does check whether __autoload exist - but doesn not check whether it is the autoloader of Mediawiki.
It would be great if there'd be some simple function that allows to retrieve the Mediawiki page content for use in other applications (even if this means some limits on what the page can contain e.g. obviously to follow links would be tricky if no other measures are taken).
Version: unspecified
Severity: enhancement