stand in default theme
[elgg.git] / includes.php
blobd562123f6739c30e2968ac5b7683065b00e1e8bf
1 <?php
3 // error_reporting(E_ERROR | E_WARNING | E_PARSE);
5 // All installation specific parameters should be in a file
6 // that is not part of the standard distribution.
7 if (!file_exists(dirname(__FILE__)."/config.php")) {
8 $message = <<< END
9 <html>
10 <head>
11 <title>Elgg installation</title>
12 </head>
13 <body>
14 <h1>Elgg isn't ready to run just yet.</h1>
15 <p>
16 There isn't a whole lot of work to do to get up and running, but
17 there is a bit. Here's what you have to do:
18 </p>
19 <ol>
20 <li>Read the INSTALL file that came with your installation package.
21 <li><a href="_elggadmin/">Click here to use the visual installer</a>.</li>
22 </ol>
23 <p>
24 If you have any problems, head over to the main Elgg site
25 at <a href="http://elgg.org/">Elgg.org</a>.
26 </p>
27 </body>
28 </html>
29 END;
30 die($message);
32 require_once(dirname(__FILE__)."/config.php");
34 // Check for .htaccess
35 if (!file_exists(dirname(__FILE__)."/.htaccess")) {
36 $message = <<< END
37 <html>
38 <head>
39 <title>Elgg installation</title>
40 </head>
41 <body>
42 <h1>Elgg still isn't ready to run just yet. (Sorry.)</h1>
43 <p>
44 You're going to need to rename the <i>htaccess-dist</i> file that
45 came with your installation (it's in the main installation directory)
46 to <i>.htaccess</i>.
47 </p>
48 <p>
49 If you're using a Windows <i>server</i>, this is a bit of a problem.
50 Windows doesn't like files starting in a period,
51 but there's a workaround: open htaccess-dist in Notepad, click Save As,
52 change the file type pulldown to all files (*.*), and type .htaccess
53 in the filename box.
54 </p>
55 <p>
56 If you're using any other kind of server, all is well with the world.
57 (If you're uncertain, try renaming the file: most servers run on Linux
58 or a similar operating system.)
59 </p>
60 <p>
61 Read the INSTALL file that came with your installation for more information
62 about installing Elgg.
63 </p>
64 </body>
65 </html>
66 END;
67 die($message);
70 // Check config values make sense
71 require_once(dirname(__FILE__).'/sanitychecks.php');
73 /***************************************************************************
74 * HELPER LIBRARIES
75 ****************************************************************************/
77 // Load cache lib
78 require_once($CFG->dirroot.'lib/cache/lib.php');
80 // Load datalib
81 require_once($CFG->dirroot.'lib/datalib.php');
83 // Load elgglib
84 require_once($CFG->dirroot.'lib/elgglib.php');
86 // Load constants
87 require_once($CFG->dirroot.'lib/constants.php');
89 /***************************************************************************
90 * CORE FUNCTIONALITY LIBRARIES
91 ****************************************************************************/
93 // Load setup.php which will initialize database connections and such like.
94 require_once($CFG->dirroot.'lib/setup.php');
96 // Load required system files: do not edit this line.
97 require_once(dirname(__FILE__)."/includes_system.php");
99 // User functions
100 require_once($CFG->dirroot.'lib/userlib.php');
102 // Check database
103 require_once($CFG->dirroot.'lib/dbsetup.php');
105 /***************************************************************************
106 * PLUGIN INITIALISATION
107 ****************************************************************************/
109 // XMLRPC
110 @include($CFG->dirroot . "units/rpc/main.php");
112 /***************************************************************************
113 * CONTENT MODULES
114 * This should make languages easier, although some kind of
115 * selection process will be required
116 ****************************************************************************/
118 // General
119 include_once($CFG->dirroot . "content/general/main.php");
120 // Main index
121 include_once($CFG->dirroot . "content/mainindex/main.php");
122 // User-related
123 include_once($CFG->dirroot . "content/users/main.php");
125 /***************************************************************************
126 * HELP MODULES
127 ****************************************************************************/
129 // Include main
130 // include_once($CFG->dirroot . "help/mainindex/main.php");
132 // Visual editor (tinyMCE)
133 @include($CFG->dirroot . "units/tinymce/main.php");
135 // Calendaring system
136 // require($CFG->dirroot . "units/calendar/main.php");
138 /***************************************************************************
139 * START-OF-PAGE RUNNING
140 ****************************************************************************/
142 run("init");
144 if ($allmods = get_list_of_plugins('mod') ) {
145 foreach ($allmods as $mod) {
146 $mod_init = $mod . '_init';
147 if (function_exists($mod_init)) {
148 $mod_init();
153 // Walled garden checking: if we're not logged in,
154 // and walled garden functionality is turned on, redirect to
155 // the logon screen
156 if (!empty($CFG->walledgarden) && (context != "external" || !defined("context")) && !logged_on) {
157 header("Location: " . $CFG->wwwroot . "login/index.php");
158 exit();