root/branches/multiuser/init.php

Revision 1604, 4.4 kB (checked in by mdodoo, 2 years ago)

Sync with trunk up to (but not including changeset [1585]). I should *definitely* do this more often, because this was really annoying.

  • Property svn:eol-style set to native
  • Property svn:eolstyle set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1<?php
2###############################################################################
3# Gregarius - A PHP based RSS aggregator.
4# Copyright (C) 2003 - 2006 Marco Bonetti
5#
6###############################################################################
7# This program is free software and open source software; you can redistribute
8# it and/or modify it under the terms of the GNU General Public License as
9# published by the Free Software Foundation; either version 2 of the License,
10# or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful, but WITHOUT
13# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
15# more details.
16#
17# You should have received a copy of the GNU General Public License along
18# with this program; if not, write to the Free Software Foundation, Inc.,
19# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  or visit
20# http://www.gnu.org/licenses/gpl.html
21#
22###############################################################################
23# E-mail:      mbonetti at gmail dot com
24# Web page:    http://gregarius.net/
25#
26###############################################################################
27
28function rss_home_dir() {
29    if (!defined('GREGARIUS_HOME')) {
30        define('GREGARIUS_HOME',dirname(__FILE__) . "/");
31    }
32
33    return GREGARIUS_HOME;
34}
35
36function rss_require($file,$once=true) {
37    $required_file = rss_home_dir() .  $file;
38    if ($once) {
39        require_once($required_file);
40    } else {
41        require($required_file);
42    }
43}
44
45////////////////////////////////////////////////////////////////////////////////
46// my-hacks support
47//
48
49if (file_exists(dirname(__FILE__) . '/rss_extra.php')) {
50    rss_require('rss_extra.php');
51}
52
53////////////////////////////////////////////////////////////////////////////////
54// Bootstrap
55//
56rss_require('core.php');
57rss_bootstrap();
58
59
60////////////////////////////////////////////////////////////////////////////////
61// Base includes
62//
63rss_require('util.php');
64rss_require('cls/rss.php');
65rss_require('cls/config.php');
66rss_require('themes.php');
67rss_require('plugins.php');
68rss_require('cls/user.php');
69//rss_require('config.php');
70
71
72
73
74////////////////////////////////////////////////////////////////////////////////
75// Error reporting
76//
77
78if (getConfig('rss.meta.debug')) {
79    error_reporting(E_ALL);
80} else {
81    error_reporting(0);
82}
83
84if (!isset($GLOBALS['rss'])) {
85    rss_require('cls/rss.php');
86}
87
88////////////////////////////////////////////////////////////////////////////////
89// Classes
90//
91
92_pf('parsing classes:');
93rss_require('cls/errorhandler.php');
94_pf(' ... errorhandler.php');
95rss_require('cls/items.php');
96_pf(' ... items.php');
97rss_require("cls/channels.php");
98_pf(' ... channels.php');
99rss_require('cls/sidemenu.php');
100_pf(' ... sidemenu.php');
101rss_require("cls/header.php");
102_pf(' ... header.php');
103rss_require("cls/nav.php");
104_pf(' ... nav.php');
105
106_pf('parsing remaining files...');
107
108rss_require('extlib/rss_fetch.inc');
109rss_require('extlib/rss_utils.inc');
110rss_require('extlib/kses.php');
111rss_require('extlib/Sajax.php');
112rss_require('tags.php');
113
114////////////////////////////////////////////////////////////////////////////////
115// Localization
116_pf('Loading l10n...');
117
118require_once('cls/l10n.php');
119$GLOBALS['rssl10n'] = new RSSl10n();
120$lang = $GLOBALS['rssl10n']->getLocale();
121_pf('done');
122
123// Theme  specific l10n handling
124list($theme,$media) = getActualTheme();
125
126if (file_exists(RSS_THEME_DIR."/$theme/intl/$lang.php")) {
127    rss_require(RSS_THEME_DIR."/$theme/intl/$lang.php");
128}
129elseif ($lang != "en" && file_exists(RSS_THEME_DIR."/$theme/intl/en.php")) {
130    rss_require(RSS_THEME_DIR."/$theme/intl/en.php");
131}
132
133
134//
135if (file_exists(getThemePath(GREGARIUS_HOME)."overrides.php")) {
136        rss_require(getThemePath('')."overrides.php");
137}
138
139/*
140// Load the right locale
141if (defined('OVERRIDE_LOCALE')) {
142    setlocale(LC_TIME,constant("OVERRIDE_LOCALE"));
143}
144elseif (isset($_SERVER["WINDIR"]) && defined("LOCALE_WINDOWS")) {
145    setlocale(LC_TIME,constant("LOCALE_WINDOWS"));
146}
147elseif (defined("LOCALE_LINUX")) {
148    setlocale(LC_TIME,constant("LOCALE_LINUX"));
149}
150else {
151    //last chance, we try to guess it
152    $mylocale=strtolower(getConfig('rss.output.lang'));
153    $mylocale.="_".strtoupper($mylocale);
154    if (!setlocale(LC_TIME,$mylocale)) {
155        // very last resort: try to load the system locale
156        setlocale(LC_TIME,"");
157    }
158}
159*/
160
161
162_pf('done');
163?>
Note: See TracBrowser for help on using the browser.