-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.php
65 lines (51 loc) · 1.93 KB
/
index.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
<?php
/**
* This file is part of the {@link http://aksw.org/Projects/Xodx Xodx} project.
*
* @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)
*/
$main_dir = rtrim(dirname(__FILE__), '/\\');
if ($main_dir[strlen($main_dir) - 1] != '/') {
$main_dir .= '/';
}
# Set include paths
$includePath = get_include_path() . PATH_SEPARATOR;
$includePath .= $main_dir . '/classes/' . PATH_SEPARATOR;
$includePath .= $main_dir . '/classes/Xodx/' . PATH_SEPARATOR;
$includePath .= $main_dir . '/libraries/' . PATH_SEPARATOR;
$includePath .= $main_dir . '/libraries/Erfurt/library/' . PATH_SEPARATOR;
$includePath .= $main_dir . '/libraries/lib-dssn-php/' . PATH_SEPARATOR;
$includePath .= $main_dir . '/libraries/ARC2/' . PATH_SEPARATOR;
set_include_path($includePath);
# Include Zend Autoloader
require_once 'Zend/Loader/Autoloader.php';
# Configure Zend Autoloader
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->registerNamespace('Erfurt_');
$autoloader->registerNamespace('Saft_');
$autoloader->registerNamespace('Xodx_');
$autoloader->registerNamespace('DSSN_');
$autoloader->registerNamespace('ARC2_');
DSSN_Utils::setConstants();
$app = new Xodx_Application();
$app->setAppNamespace('Xodx_');
$app->setBaseDir($main_dir);
// Check if Application should be started normaly or to run the Worker
$options = getopt('j');
if (!isset($options['j'])) {
// if the Application is started normaly we assume to be in a server environment
if (isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') {
$protocol = 'https';
} else {
$protocol = 'http';
}
$base_uri = $protocol . "://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']);
// append trailing slash if not present
if ($base_uri[strlen($base_uri) - 1] != '/') {
$base_uri .= '/';
}
$app->setBaseUri($base_uri);
$app->run();
} else {
$app->runJobs();
}