2 # The main wiki script and things like database
3 # conversion and maintenance scripts all share a
4 # common setup of including lots of classes and
5 # setting up a few globals.
9 include_once( "$IP/GlobalFunctions.php" );
10 include_once( "$IP/Namespace.php" );
11 include_once( "$IP/Skin.php" );
12 include_once( "$IP/OutputPage.php" );
13 include_once( "$IP/DifferenceEngine.php" );
14 include_once( "$IP/SearchEngine.php" );
15 include_once( "$IP/User.php" );
16 include_once( "$IP/LinkCache.php" );
17 include_once( "$IP/Title.php" );
18 include_once( "$IP/Article.php" );
19 include_once( "$IP/MagicWord.php" );
20 include_once( "$IP/MemCachedClient.inc.php" );
21 include_once( "$IP/Block.php" );
23 global $wgUser, $wgLang, $wgOut, $wgTitle;
24 global $wgArticle, $wgDeferredUpdateList, $wgLinkCache;
25 global $wgMemc, $wgMagicWords, $wgMwRedir;
27 class MemCachedClientforWiki
extends MemCachedClient
{
28 function _debug( $text ) {
29 wfDebug( "memcached: $text\n" );
33 $wgMemc = new MemCachedClientforWiki();
34 if( $wgUseMemCached ) {
35 $wgMemc->set_servers( $wgMemCachedServers );
36 $wgMemc->set_debug( $wgMemCachedDebug );
39 include_once( "$IP/Language.php" );
41 $wgOut = new OutputPage();
44 $wgLangClass = "Language" . ucfirst( $wgLanguageCode );
45 if( ! class_exists( $wgLangClass ) ) {
46 include_once( "$IP/LanguageUtf8.php" );
47 $wgLangClass = "LanguageUtf8";
49 $wgLang = new $wgLangClass();
51 $wgUser = User
::loadFromSession();
52 $wgDeferredUpdateList = array();
53 $wgLinkCache = new LinkCache();
54 $wgMagicWords = array();
55 $wgMwRedir =& MagicWord
::get( MAG_REDIRECT
);