/
mobi_lib_constants.php.init
95 lines (77 loc) · 3.24 KB
/
mobi_lib_constants.php.init
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
<?
$docRoot = getenv("DOCUMENT_ROOT");
require_once($docRoot . '/mobi-config/mobi_lib_config.php');
/*
* use this file for storing constants that are used in multiple files
* DO NOT STORE sensitive info like passwords
* those go in config.php
* which should not be committed
*/
// file/directory locations
if (version_compare(phpversion(), '5.3') == -1) {
define("CACHE_DIR", '/var/www/html/mobi-lib/cache/');
define("LIBDIR", '/var/www/html/mobi-lib/');
} else {
define("CACHE_DIR", __DIR__ . '/cache/');
define("LIBDIR", __DIR__);
}
/* debug preferences
* not really all constants but whatever
*/
define("DEBUG_LEVEL_ERROR", 0);
define("DEBUG_LEVEL_WARNING", 1);
define("DEBUG_LEVEL_DEBUG", 2);
define("DEBUG_LEVEL", DEBUG_LEVEL_ERROR);
function warn($mesg) {
if (DEBUG_LEVEL >= DEBUG_LEVEL_WARNING) echo $mesg . "\n";
}
function debug($mesg) {
if (DEBUG_LEVEL >= DEBUG_LEVEL_DEBUG) echo $mesg . "\n";
}
/* misc */
define("TIMEZONE", "America/New_York");
/* SHUTTLESCHEDULE */
define("NEXTBUS_FEED_URL", 'http://www.nextbus.com/s/xmlFeed?');
define("NEXTBUS_AGENCY", 'mit');
define("NEXTBUS_ROUTE_CACHE_TIMEOUT", 86400); // max age, routeConfig data
define("NEXTBUS_PREDICTION_CACHE_TIMEOUT", 20); // max age, predictions
define("NEXTBUS_VEHICLE_CACHE_TIMEOUT", 10); // max age, vehicle locations
define("NEXTBUS_CACHE_MAX_TOLERANCE", 90); // when to revert to pub schedule
define("NEXTBUS_DAEMON_PID_FILE", CACHE_DIR . 'NEXTBUS_DAEMON_PID');
/* STELLAR */
define("STELLAR_COURSE_DIR", CACHE_DIR . 'STELLAR_COURSE/'); // dir for subject listing files
define("STELLAR_COURSE_CACHE_TIMEOUT", 86400); // how long to keep cached subject files
define("STELLAR_FEED_DIR", CACHE_DIR . 'STELLAR_FEEDS/'); // dir for cached rss data
define("STELLAR_FEED_CACHE_TIMEOUT", 10); // how long to keep cached rss files
define("STELLAR_SUBSCRIPTIONS_FILE", CACHE_DIR . 'STELLAR_SUBSCRIPTIONS');
define("STELLAR_USE_PRODUCTION", True);
if(STELLAR_USE_PRODUCTION) {
define("STELLAR_BASE_URL", "http://stellar.mit.edu/courseguide/course/");
define("STELLAR_RSS_URL", "http://stellar.mit.edu/SRSS/rss");
} else {
define("STELLAR_BASE_URL", "http://stellar-dev.mit.edu/courseguide/course/");
define("STELLAR_RSS_URL", "http://stellar-dev.mit.edu/SRSS/rss");
}
/* LIBRARIES */
define("ICS_CACHE_LIFESPAN", 900);
// EMERGENCY
define("EMERGENCY_USE_PRODUCTION", True);
if(EMERGENCY_USE_PRODUCTION) {
define("EMERGENCY_RSS_URL", 'http://emergency.mit.net/emergency/mobirss');
} else {
define("EMERGENCY_RSS_URL", 'http://emergency.mit.net/emtest/mobirss');
}
// 3DOWN
define("THREEDOWN_RSS_URL", 'http://3down.mit.edu/3down/index.php?rss=1');
/*
// these aren't being used, just keeping a record of what may
// PEOPLE DIRECTORY
define("LDAP_SERVER", 'ldap.mit.edu');
*/
/* Events Calendar */
define("EVENTS_CALENDAR_UNIQUE_EVENT_URL", "http://events.mit.edu/event.html?id=");
/* news office */
define("NEWSOFFICE_FEED_URL", 'http://web.mit.edu/newsoffice/feeds/iphone.php');
define("NEWSOFFICE_STORY_URL", 'http://web.mit.edu/newsoffice/index.php?option=com_content&view=article&id=');
define("NEWSOFFICE_SEARCH_URL", 'http://web.mit.edu/newsoffice/index.php?option=com_search&view=isearch');
?>