Release diogenes-0.9.22
[diogenes.git] / include / diogenes.common.inc.php
CommitLineData
6855525e
JL
1<?php
2/*
3 * Copyright (C) 2003-2004 Polytechnique.org
4 * http://opensource.polytechnique.org/
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21 // define Diogenes core classes
22 require_once 'diogenes.globals.inc.php';
23 require_once 'diogenes/diogenes.database.inc.php';
24 require_once 'diogenes.session.inc.php';
ba1faac3 25 require_once 'Icons.php';
4be8b457 26 require_once 'VCS/CVS.php';
6855525e
JL
27 require_once 'Plugins.php';
28
29 // get custom definitions
30 $globals = new DiogenesGlobals();
31 require_once 'diogenes.config.inc.php';
32
33 // location of the Diogenes library
34 if (!isset($globals->libroot))
35 $globals->libroot = $globals->root."/lib";
36
37 // connect to database
38 $globals->dbconnect();
39
40 // read extra options from database
41 $globals->readOptions();
42
43 // set up the plugin holder
44 $globals->plugins = new Diogenes_Plugins($globals->db, $globals->root . "/plugins", $globals->spoolroot . "/diogenes_c");
45
46 // set up the icons
ba1faac3 47 $globals->icons = new Diogenes_Icons();
6855525e
JL
48
49 // do we want to debug database calls ?
50 if ($globals->debugdatabase)
51 $globals->db->trace_on();
52
53 // environment variable for gettext
54 bindtextdomain("diogenes", "{$globals->root}/locale");
55 textdomain("diogenes");
56 if (isset($_COOKIE['lang'])) {
57 putenv("LANG={$_COOKIE['lang']}");
58 setlocale(LC_ALL,$_COOKIE['lang']);
59 }
60
61?>