This repository was archived by the owner on Jan 14, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.php
More file actions
executable file
·97 lines (79 loc) · 2.96 KB
/
index.php
File metadata and controls
executable file
·97 lines (79 loc) · 2.96 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
/**
* This is the main control script for the application.
*
* @package middmedia
*
* @copyright Copyright © 2005, Middlebury College
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
*
* @version $Id$
*/
/*********************************************************
* Define a Constant reference to this application directory.
*********************************************************/
define("MYDIR",dirname(__FILE__));
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on')
$protocol = 'https';
else
$protocol = 'http';
if ($_SERVER['SCRIPT_NAME'])
$scriptPath = $_SERVER['SCRIPT_NAME'];
else
$scriptPath = $_SERVER['PHP_SELF'];
define("MYPATH", $protocol."://".$_SERVER['HTTP_HOST'].str_replace(
"\\", "/",
rtrim(dirname($scriptPath), '/')));
// The following lines set the MYURL constant.
if (file_exists(MYDIR.'/config/url.conf.php'))
include_once (MYDIR.'/config/url.conf.php');
else
include_once (MYDIR.'/config/url_default.conf.php');
if (!defined("MYURL"))
define("MYURL", trim(MYPATH, '/')."/index.php");
define("LOAD_GUI", true);
/*********************************************************
* Include our libraries
*********************************************************/
require_once(dirname(__FILE__)."/main/include/libraries.inc.php");
try {
/*********************************************************
* Include our configuration and setup scripts
*********************************************************/
require_once(dirname(__FILE__)."/main/include/setup.inc.php");
/*********************************************************
* Execute our actions
*********************************************************/
if (defined('ENABLE_TIMERS') && ENABLE_TIMERS) {
require_once(HARMONI."/utilities/Timer.class.php");
$execTimer = new Timer;
$execTimer->start();
}
$harmoni->execute();
// Handle certain types of uncaught exceptions specially. In particular,
// Send back HTTP Headers indicating that an error has ocurred to help prevent
// crawlers from continuing to pound invalid urls.
} catch (UnknownActionException $e) {
MiddMediaErrorPrinter::handleException($e, 404);
} catch (NullArgumentException $e) {
MiddMediaErrorPrinter::handleException($e, 400);
} catch (PermissionDeniedException $e) {
MiddMediaErrorPrinter::handleException($e, 403);
} catch (UnknownIdException $e) {
MiddMediaErrorPrinter::handleException($e, 404);
}
// Default
catch (Exception $e) {
MiddMediaErrorPrinter::handleException($e, 500);
}
if (defined('ENABLE_TIMERS') && ENABLE_TIMERS) {
$execTimer->end();
print "\n<table>\n<tr><th align='right'>Execution Time:</th>\n<td align='right'><pre>";
printf("%1.6f", $execTimer->printTime());
print "</pre></td></tr>\n</table>";
$dbhandler = Services::getService("DBHandler");
printpre("NumQueries: ".$dbhandler->getTotalNumberOfQueries());
// printpreArrayExcept($_SESSION, array('__temporarySets'));
// debug::output(session_id());
// Debug::printAll();
}