https://bugzilla.wikimedia.org/show_bug.cgi?id=16567
Summary: Allow getting parsedContent of Pages via API
Product: MediaWiki
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: Normal
Component: API
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]
CC: [EMAIL PROTECTED], [EMAIL PROTECTED]
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).
--
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l