Tell pagodabox to conenct to AWS db server
--- a/.box
+++ /dev/null
@@ -1,5 +1,1 @@
-shared_writable_dirs:
- - /labs/tiles
- - /lib/staticmaplite/cache
-php_extensions: [pgsql, pdo, pdo_pgsql, curl]
--- /dev/null
+++ b/Boxfile
@@ -1,1 +1,7 @@
+web1:
+ php_extensions:
+ - pgsql
+ - pdo
+ - pdo_pgsql
+ - curl
--- a/about.php
+++ b/about.php
@@ -35,7 +35,8 @@
Some icons by Joseph Wain / glyphish.com<br />
Native clients also available for iPhone(<a href="http://itunes.apple.com/au/app/cbrtimetable/id444287349?mt=8">cbrTimetable by Sandor Kolotenko</a>
, <a href="http://itunes.apple.com/au/app/act-buses/id376634797?mt=8">ACT Buses by David Sullivan</a>)
- and Android (<a href="https://market.android.com/details?id=com.action">MyBus 2.0 by Imagine Team</a>)
+ , Android (<a href="https://market.android.com/details?id=com.action">MyBus 2.0 by Imagine Team</a>)
+ and Windows Phone 7 (<a href="http://www.windowsphone.com/en-AU/apps/d840375e-429c-4aa4-a358-80eec6ea9e66">TransHub Canberra by Soul Solutions</a>)
<br />
GTFS-realtime API:
Alerts and Trip Updates (but only Cancelled or Stop Skipped)
--- a/feedback.php
+++ b/feedback.php
@@ -1,5 +1,6 @@
<?php
include ("include/common.inc.php");
+ $GTFSREnabled = false;
include_header("Feedback", "feedback");
function sendEmail($topic, $message)
{
@@ -30,7 +31,7 @@
} else {
$stopid = "";
$stopcode = "";
-$urlparts = explode("?",$_SERVER["HTTP_REFERER"]);
+if (isset($_SERVER["HTTP_REFERER"])) $urlparts = explode("?",$_SERVER["HTTP_REFERER"]);
if (isset($urlparts[1])) {
$getparams = explode("&",$urlparts[1]);
foreach ($getparams as $param) {
@@ -59,7 +60,7 @@
</textarea>
<textarea name="extrainfo" id="extrainfo">
<?php
- echo "Referrer URL: ".$_SERVER["HTTP_REFERER"];
+ echo "Referrer URL: ".($_SERVER["HTTP_REFERER"] ? $_SERVER["HTTP_REFERER"] : "");
echo "\nCurrent page URL: ".curPageURL();
echo "\nUser Agent: ".$_SERVER["HTTP_USER_AGENT"];
echo "\nUser host/IP: ".$_SERVER["HTTP_X_FORWARDED_FOR"]." ".$_SERVER["REMOTE_ADDR"];
--- a/include/common-db.inc.php
+++ b/include/common-db.inc.php
@@ -15,7 +15,7 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
-if (php_uname('n') == "actbus-www") {
+if (strstr(php_uname('n'),"actbus")) {
$conn = new PDO("pgsql:dbname=transitdata;user=transitdata;password=transitdata;host=bus-main.lambdacomplex.org");
} else if (isDebugServer()) {
$conn = new PDO("pgsql:dbname=transitdata;user=postgres;password=snmc;host=localhost");
--- a/include/common-template.inc.php
+++ b/include/common-template.inc.php
@@ -27,7 +27,7 @@
$url.= $GA_PIXEL . "?";
$url.= "utmac=" . $GA_ACCOUNT;
$url.= "&utmn=" . rand(0, 0x7fffffff);
- $referer = $_SERVER["HTTP_REFERER"];
+ $referer = (isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : "");
$query = $_SERVER["QUERY_STRING"];
$path = $_SERVER["REQUEST_URI"];
if (empty($referer)) {
@@ -169,6 +169,7 @@
</div><!-- /header -->
<a name="maincontent" id="maincontent"></a>
<div data-role="content"> ';
+ if ($GTFSREnabled) {
$overrides = getServiceOverride();
if ($overrides['service_id']) {
if ($overrides['service_id'] == "noservice") {
@@ -178,7 +179,6 @@
echo '<div id="servicewarning">Buses are running on an altered timetable today due to industrial action/public holiday. See <a href="http://www.action.act.gov.au">http://www.action.act.gov.au</a> for details.</div>';
}
}
- if ($GTFSREnabled) {
$serviceAlerts = getServiceAlertsAsArray("agency", "0");
if (isset($serviceAlerts['entity']) && sizeof($serviceAlerts['entity']) > 0) {
foreach ($serviceAlerts['entity'] as $entity) {
--- a/include/common.inc.php
+++ b/include/common.inc.php
@@ -31,7 +31,7 @@
$cloudmadeAPIkey = "daa03470bb8740298d4b10e3f03d63e6";
$googleMapsAPIkey = "ABQIAAAA95XYXN0cki3Yj_Sb71CFvBTPaLd08ONybQDjcH_VdYtHHLgZvRTw2INzI_m17_IoOUqH3RNNmlTk1Q";
$otpAPIurl = 'http://localhost:8080/opentripplanner-api-webapp/';
-if (isDebug("awsotp") || php_uname('n') == "maxious.xen.prgmr.com") {
+if (isDebug("awsotp") || php_uname('n') == "maxious.xen.prgmr.com" || strstr(php_uname('n'),"actbus")) {
$otpAPIurl = 'http://bus-main.lambdacomplex.org:8080/opentripplanner-api-webapp/';
}
if (isDebug("dotcloudotp") || php_uname('n') == "actbus-www") {
@@ -56,14 +56,16 @@
function isDebugServer() {
- return php_sapi_name() == "cli" || isset($_SERVER['SERVER_NAME']) && ( $_SERVER['SERVER_NAME'] == "azusa" || $_SERVER['SERVER_NAME'] == "vanille"
+ return php_sapi_name() == "cli" || strstr(php_uname('n'),"actbus") || isset($_SERVER['SERVER_NAME']) && ( $_SERVER['SERVER_NAME'] == "azusa" || $_SERVER['SERVER_NAME'] == "vanille"
|| $_SERVER['SERVER_NAME'] == "localhost" || $_SERVER['SERVER_NAME'] == "127.0.0.1" || $_SERVER['SERVER_NAME'] == "192.168.1.8");
}
include_once ("common-geo.inc.php");
include_once ("common-net.inc.php");
include_once ("common-transit.inc.php");
-include_once ("common-db.inc.php");
+if (!strstr($_SERVER['PHP_SELF'], "feedback")) {
+ include_once ("common-db.inc.php");
+}
include_once ("common-request.inc.php");
include_once ("common-session.inc.php");