From: maxious Date: Sun, 10 Apr 2011 09:57:41 +0000 Subject: DB fixes X-Git-Url: http://maxious.lambdacomplex.org/git/?p=busui.git&a=commitdiff&h=bd1648c7e216962fd37858e5b48662d382fcf787 --- DB fixes --- --- /dev/null +++ b/aws/awsStartup.sh @@ -1,1 +1,36 @@ +#!/bin/bash +#this script should be run from a fresh git checkout from github +#ami base must have yum install lighttpd-fastcgi, git, tomcat6 +#screen php-cli php-gd tomcat6-webapps tomcat6-admin-webapps svn maven2 +#http://www.how2forge.org/installing-lighttpd-with-php5-and-mysql-support-on-fedora-12 +cp /root/aws.php /tmp/ +mkdir /var/www/lib/staticmaplite/cache +chcon -h system_u:object_r:httpd_sys_content_t /var/www +chcon -R -h root:object_r:httpd_sys_content_t /var/www/* +chcon -R -t httpd_sys_content_rw_t /var/www/lib/staticmaplite/cache +chmod -R 777 /var/www/lib/staticmaplite/cache +wget http://s3-ap-southeast-1.amazonaws.com/busresources/cbrfeed.zip \ +-O /var/www/cbrfeed.zip + +createdb transitdata +createlang -d transitdata plpgsql +psql -d transitdata -f /var/www/lib/postgis.sql +# curl https://github.com/maxious/ACTBus-ui/raw/master/transitdata.cbrfeed.sql.gz -o transitdata.cbrfeed.sql.gz +#made with pg_dump transitdata | gzip -c > transitdata.cbrfeed.sql.gz +gunzip /var/www/transitdata.cbrfeed.sql.gz +psql -d transitdata -f /var/www/transitdata.cbrfeed.sql +#createuser transitdata -SDRP +#password transitdata +#psql -d transitdata -c \"GRANT SELECT ON TABLE agency,calendar,calendar_dates,routes,stop_times,stops,trips TO transitdata;\" +php /var/www/updatedb.php + +wget http://s3-ap-southeast-1.amazonaws.com/busresources/Graph.obj \ +-O /tmp/Graph.obj +rm -rfv /usr/share/tomcat6/webapps/opentripplanner* +wget http://s3-ap-southeast-1.amazonaws.com/busresources/opentripplanner-webapp.war \ +-O /usr/share/tomcat6/webapps/opentripplanner-webapp.war +wget http://s3-ap-southeast-1.amazonaws.com/busresources/opentripplanner-api-webapp.war \ +-O /usr/share/tomcat6/webapps/opentripplanner-api-webapp.war +/etc/init.d/tomcat6 restart + --- /dev/null +++ b/include/common-db.inc.php @@ -1,1 +1,16 @@ - + --- a/include/common-geo.inc.php +++ b/include/common-geo.inc.php @@ -70,6 +70,7 @@ else return round($km,2)."k"; } else return floor($km * 1000); } + function decodePolylineToArray($encoded) { // source: http://latlongeeks.com/forum/viewtopic.php?f=4&t=5 --- a/include/common-session.inc.php +++ b/include/common-session.inc.php @@ -9,7 +9,7 @@ $_SESSION['time'] = filter_var($_REQUEST['time'], FILTER_SANITIZE_STRING); sessionUpdated(); } -if (isset($_REQUEST['geolocate'])) { +if (isset($_REQUEST['geolocate']) && $_REQUEST['geolocate'] != "Enter co-ordinates or address here") { $geocoded = false; if (isset($_REQUEST['lat']) && isset($_REQUEST['lon'])) { $_SESSION['lat'] = trim(filter_var($_REQUEST['lat'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION)); @@ -17,7 +17,6 @@ } else { $geolocate = filter_var($_REQUEST['geolocate'], FILTER_SANITIZE_URL); - echo $_REQUEST['geolocate']; if (startsWith($geolocate, "-")) { $locateparts = explode(",", $geolocate); $_SESSION['lat'] = $locateparts[0]; --- a/include/common-template.inc.php +++ b/include/common-template.inc.php @@ -1,28 +1,27 @@ '; if ($datepicker) echo ''; - if (isDebugServer()) echo ' + if (isDebugServer()) { + echo ' + '; - else echo ' + } + else { + echo ' - '; - if ($datepicker) echo ''; + } + if ($datepicker) { + echo ' '; + } echo '