Initial support for memcached.
[lhc/web/wiklou.git] / includes / Setup.php
1 <?
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.
6 #
7
8 global $IP;
9 include_once( "$IP/GlobalFunctions.php" );
10 include_once( "$IP/Language.php" );
11 include_once( "$IP/Namespace.php" );
12 include_once( "$IP/Skin.php" );
13 include_once( "$IP/OutputPage.php" );
14 include_once( "$IP/DifferenceEngine.php" );
15 include_once( "$IP/SearchEngine.php" );
16 include_once( "$IP/User.php" );
17 include_once( "$IP/LinkCache.php" );
18 include_once( "$IP/Title.php" );
19 include_once( "$IP/Article.php" );
20 require( "$IP/MemCachedClient.inc.php" );
21
22 wfDebug( "\n\n" );
23
24 global $wgUser, $wgLang, $wgOut, $wgTitle;
25 global $wgArticle, $wgDeferredUpdateList, $wgLinkCache;
26 global $wgMemc;
27
28 class MemCachedClientforWiki extends MemCachedClient {
29 function _debug( $text ) {
30 wfDebug( "memcached: $text\n" );
31 }
32 }
33
34 $wgMemc = new MemCachedClientforWiki();
35 if( $wgUseMemCached ) {
36 $wgMemc->set_servers( $wgMemCachedServers );
37 $wgMemc->set_debug( $wgMemcachedDebug );
38 }
39
40 $wgOut = new OutputPage();
41 $wgLangClass = "Language" . ucfirst( $wgLanguageCode );
42 if( ! class_exists( $wgLangClass ) ) {
43 include_once( "$IP/Utf8Case.php" );
44 $wgLangClass = "LanguageUtf8";
45 }
46 $wgLang = new $wgLangClass();
47
48 $wgUser = User::loadFromSession();
49 $wgDeferredUpdateList = array();
50 $wgLinkCache = new LinkCache();
51
52 ?>