This repository has been archived by the owner on Apr 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
entry.php
83 lines (67 loc) · 2.83 KB
/
entry.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
ob_start();
if(!defined('entry') || !entry) die('Not a valid page');
error_reporting (E_ALL);
ini_set('display_errors', '1');
// PHP settings specific to Gelato
ini_set('pcre.backtrack_limit', '10000');
define('Absolute_Path', dirname(__FILE__).DIRECTORY_SEPARATOR);
$installed = true;
$configFile = Absolute_Path.'config.php';
$dir = (strpos($_SERVER['REQUEST_URI'],'/admin')) ? "../" : "";
if (!file_exists($configFile) and basename($_SERVER['PHP_SELF'])!='install.php'){
header("Location: {$dir}install.php");
exit;
} else {
include_once(Absolute_Path.'classes/install.class.php');
$install = new Install();
if(!$install->is_gelato_installed()){
if(basename($_SERVER['PHP_SELF'])!='install.php'){
header("Location: {$dir}install.php");exit;
}
$installed = false;
}
}
if($installed) {
require_once($configFile);
}
if (!extension_loaded('json')) {
require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'JSON.php');
$GLOBALS['JSON_OBJECT'] = new Services_JSON();
function json_encode($value) {
return $GLOBALS['JSON_OBJECT']->encode($value);
}
function json_decode($value, $none) {
return $GLOBALS['JSON_OBJECT']->decode($value);
}
}
require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'configuration.class.php');
require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'util.class.php');
require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'gelato.class.php');
require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'templates.class.php');
require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'themes.class.php');
require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'pagination.class.php');
require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'user.class.php');
require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'comments.class.php');
require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'feeds.class.php');
require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'mysql_connection.class.php');
require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'streams.class.php');
require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'gettext.class.php');
require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'lang.functions.php');
require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'plugin.class.php');
require_once(Absolute_Path.'classes'.DIRECTORY_SEPARATOR.'plugins.class.php');
if($installed){
// Globals to be used throughout the application
$db = new Conexion_Mysql(DB_name, DB_Server, DB_User, DB_Password);
$conf = new configuration();
$tumble = new gelato();
$user = new user();
session_start();
util::init_plugins();
$trigger =& plugin::instance(); //DO NOT remove the & after the =
$trigger->call('gelato_init');
$feeds = new feeds();
$feeds->updateFeeds();
unset($feeds);
}
?>