[Mediawiki-l] Including MW via a function call

DanTMan dan_the_man at telus.net
Wed Aug 1 13:19:46 UTC 2007

I don't know about doing it though any place other than the same 
directory that MediaWiki is located in, but if you take this code out 
from index.php:
# Initialise common code
require_once( 'includes/WebStart.php' );

# Initialize MediaWiki base class
require_once( "includes/Wiki.php" );
$mediaWiki = new MediaWiki();

You suddenly gain access to everything in MediaWiki, all the wfMsg, and 
the database, title, and other methods are available.

~Daniel Friesen(Dantman) of The Gaiapedia, Wikia Graphical Entertainment Project, and Wiki-Tools.com

Platonides wrote:
>> 1) Does this theory sound correct?
> So it seems.
>> 2) Assuming I need to use functions in my site's framework, what's the 
>> best way to make this work?
> I suppose you could do some strange trickeries to avoid the function, like
> <?Php
> do_data()
> render_page();
> if ($show_wiki) require("index.php");
> ?>
> However, i think you're using the wrong approach here.
> You could allow the users to go to /wiki/ with the wiki having an Skin 
> to resemble your site's skin (you can even callback to your site's 
> code). http://www.mediawiki.org/wiki/Manual:Skinning
> Also, if you only want to convert wikitext to html, you can use the 
> Parser class in your code.
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l at lists.wikimedia.org
> http://lists.wikimedia.org/mailman/listinfo/mediawiki-l

More information about the MediaWiki-l mailing list