root/trunk/gregarius/init.php

Revision 1692, 4.4 kB (checked in by mbonetti, 20 months ago)

massive hack to clean up schema generation

  • 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 = dirname(__FILE__) . '/'. $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// Bootstrap
54//
55rss_require('core.php');
56rss_bootstrap();
57
58
59////////////////////////////////////////////////////////////////////////////////
60// Base includes
61//
62rss_require('util.php');
63rss_require('cls/rss.php');
64rss_require('cls/config.php');
65rss_require('themes.php');
66rss_require('plugins.php');
67rss_require('cls/user.php');
68
69////////////////////////////////////////////////////////////////////////////////
70// Error reporting
71//
72
73if (getConfig('rss.meta.debug')) {
74    error_reporting(E_ALL);
75} else {
76    error_reporting(0);
77}
78
79if (!isset($GLOBALS['rss'])) {
80    rss_require('cls/rss.php');
81}
82
83////////////////////////////////////////////////////////////////////////////////
84// Classes
85//
86
87_pf('parsing classes:');
88rss_require('cls/errorhandler.php');
89_pf(' ... errorhandler.php');
90rss_require('cls/items.php');
91_pf(' ... items.php');
92rss_require("cls/channels.php");
93_pf(' ... channels.php');
94rss_require('cls/sidemenu.php');
95_pf(' ... sidemenu.php');
96rss_require("cls/header.php");
97_pf(' ... header.php');
98rss_require("cls/nav.php");
99_pf(' ... nav.php');
100
101_pf('parsing remaining files...');
102
103rss_require('extlib/rss_fetch.inc');
104rss_require('extlib/rss_utils.inc');
105rss_require('extlib/kses.php');
106rss_require('extlib/Sajax.php');
107rss_require('tags.php');
108
109////////////////////////////////////////////////////////////////////////////////
110// Localization
111_pf('Loading l10n...');
112
113require_once('cls/l10n.php');
114$GLOBALS['rssl10n'] = new RSSl10n();
115$lang = $GLOBALS['rssl10n']->getLocale();
116_pf('done');
117
118// Theme  specific l10n handling
119list($theme,$media) = getActualTheme();
120
121if (file_exists(RSS_THEME_DIR."/$theme/intl/$lang.php")) {
122    rss_require(RSS_THEME_DIR."/$theme/intl/$lang.php");
123}
124elseif ($lang != "en" && file_exists(RSS_THEME_DIR."/$theme/intl/en.php")) {
125    rss_require(RSS_THEME_DIR."/$theme/intl/en.php");
126}
127
128
129//
130if (file_exists(getThemePath(GREGARIUS_HOME)."overrides.php")) {
131        rss_require(getThemePath('')."overrides.php");
132}
133
134/*
135// Load the right locale
136if (defined('OVERRIDE_LOCALE')) {
137    setlocale(LC_TIME,constant("OVERRIDE_LOCALE"));
138}
139elseif (isset($_SERVER["WINDIR"]) && defined("LOCALE_WINDOWS")) {
140    setlocale(LC_TIME,constant("LOCALE_WINDOWS"));
141}
142elseif (defined("LOCALE_LINUX")) {
143    setlocale(LC_TIME,constant("LOCALE_LINUX"));
144}
145else {
146    //last chance, we try to guess it
147    $mylocale=strtolower(getConfig('rss.output.lang'));
148    $mylocale.="_".strtoupper($mylocale);
149    if (!setlocale(LC_TIME,$mylocale)) {
150        // very last resort: try to load the system locale
151        setlocale(LC_TIME,"");
152    }
153}
154*/
155
156
157_pf('done');
158?>
Note: See TracBrowser for help on using the browser.