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, $wgDebugLogFile;
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 );
38 # Test it to see if it's working
39 if ( $wgDebugLogFile && !$wgMemc->set( "test", "", 0 ) ) {
40 wfDebug( "Memcached error: " . $wgMemc->error_string() . "\n" );
44 include_once( "$IP/Language.php" );
46 $wgOut = new OutputPage();
49 $wgLangClass = "Language" . ucfirst( $wgLanguageCode );
50 if( ! class_exists( $wgLangClass ) ) {
51 include_once( "$IP/LanguageUtf8.php" );
52 $wgLangClass = "LanguageUtf8";
54 $wgLang = new $wgLangClass();
56 if( !isset( $wgProfiling ) )
60 include_once( "$IP/Profiling.php" );
62 function wfProfileIn( $fn ) {}
63 function wfProfileOut( $fn = "" ) {}
64 function wfGetProfilingOutput( $s, $e ) {}
65 function wfProfileClose() {}
68 $wgUser = User
::loadFromSession();
69 $wgDeferredUpdateList = array();
70 $wgLinkCache = new LinkCache();
71 $wgMagicWords = array();
72 $wgMwRedir =& MagicWord
::get( MAG_REDIRECT
);