--- a/include/common.inc.php +++ b/include/common.inc.php @@ -6,10 +6,11 @@ "phperror", "awsotp", //"squallotp", - "vanilleotp", + //"vanilleotp", "database", "other" ); +$GTFSREnabled = true; $cloudmadeAPIkey = "daa03470bb8740298d4b10e3f03d63e6"; $googleMapsAPIkey = "ABQIAAAA95XYXN0cki3Yj_Sb71CFvBTPaLd08ONybQDjcH_VdYtHHLgZvRTw2INzI_m17_IoOUqH3RNNmlTk1Q"; $otpAPIurl = 'http://localhost:8080/opentripplanner-api-webapp/'; @@ -26,6 +27,14 @@ $otpAPIurl = 'http://10.0.1.135:8080/opentripplanner-api-webapp/'; } if (isDebug("phperror")) error_reporting(E_ALL ^ E_NOTICE); +$labsPath = ""; +if (strstr($_SERVER['PHP_SELF'],"labs")) $labsPath = "../"; + +function isDebugServer() +{ + return php_sapi_name() == "cli" || isset($_SERVER['SERVER_NAME']) && ( $_SERVER['SERVER_NAME'] == "azusa" || $_SERVER['SERVER_NAME'] == "vanille" || $_SERVER['SERVER_NAME'] == +"localhost" || $_SERVER['SERVER_NAME'] == "127.0.0.1") ; +} include_once ("common-geo.inc.php"); include_once ("common-net.inc.php"); @@ -34,21 +43,22 @@ include_once ("common-request.inc.php"); include_once ("common-session.inc.php"); +include_once ("common-auth.inc.php"); include_once ("common-template.inc.php"); -function isDebugServer() -{ - return $_SERVER['SERVER_NAME'] == "10.0.1.154" || $_SERVER['SERVER_NAME'] == "localhost" || $_SERVER['SERVER_NAME'] == "127.0.0.1" || !$_SERVER['SERVER_NAME']; -} + function isAnalyticsOn() { - return !isDebugServer(); + $user_agent = $_SERVER['HTTP_USER_AGENT']; + return !isDebugServer() && !preg_match('/cloudkick/i', $user_agent) && !preg_match('/googlebot/i', $user_agent) && +!preg_match('/baidu/i', $user_agent); } function isDebug($debugReason = "other") { global $debugOkay; return in_array($debugReason, $debugOkay, false) && isDebugServer(); } + function debug($msg, $debugReason = "other") { if (isDebug($debugReason)) echo "\n\n"; @@ -163,7 +173,7 @@ $key => $val )); } - if ($sort_ascending) $array = array_reverse($temp_array); + if ($sort_ascending && isset($temp_array)) $array = array_reverse($temp_array); else $array = $temp_array; } function r_implode( $glue, $pieces ) @@ -181,5 +191,6 @@ } return implode( $glue, $retVal ); } + ?>