Add php protobuffer support for transition to GTFS-realtime
Add php protobuffer support for transition to GTFS-realtime

file:b/.gitignore (new)
 
  /labs/tiles/12
  /labs/tiles/13
  /labs/tiles/14
  /labs/tiles/15
  /labs/tiles/16
  /labs/tiles/17
  /labs/tiles/19
cp /root/aws.php /tmp/ cp /root/aws.php /tmp/
mkdir /var/www/lib/staticmaplite/cache mkdir /var/www/lib/staticmaplite/cache
chcon -h system_u:object_r:httpd_sys_content_t /var/www 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 -h root:object_r:httpd_sys_content_t /var/www/*
   
chcon -R -t httpd_sys_content_rw_t /var/www/lib/staticmaplite/cache chcon -R -t httpd_sys_content_rw_t /var/www/lib/staticmaplite/cache
chmod -R 777 /var/www/lib/staticmaplite/cache chmod -R 777 /var/www/lib/staticmaplite/cache
   
chcon -R -t httpd_sys_content_rw_t /var/www/labs/tiles chcon -R -t httpd_sys_content_rw_t /var/www/labs/tiles
chmod -R 777 /var/www/labs/tiles chmod -R 777 /var/www/labs/tiles
   
  chcon -R -t httpd_sys_content_rw_t /var/www/lib/openid-php/oid_store
  chmod -R 777 /var/www/lib/openid-php/oid_store
   
wget http://s3-ap-southeast-1.amazonaws.com/busresources/cbrfeed.zip \ wget http://s3-ap-southeast-1.amazonaws.com/busresources/cbrfeed.zip \
-O /var/www/cbrfeed.zip -O /var/www/cbrfeed.zip
  <?php
  function getScheme()
  {
  $scheme = 'http';
  if (isset($_SERVER['HTTPS']) and $_SERVER['HTTPS'] == 'on') {
  $scheme .= 's';
  }
  return $scheme;
  }
 
  function getTrustRoot()
  {
  return sprintf("%s://%s:%s%s/",
  getScheme(), $_SERVER['SERVER_NAME'],
  $_SERVER['SERVER_PORT'],
  dirname($_SERVER['PHP_SELF']));
  }
 
 
  // Includes required files
  set_include_path(get_include_path() . PATH_SEPARATOR . $labsPath."lib/openid-php/");
  require_once "Auth/OpenID/Consumer.php";
  require_once "Auth/OpenID/FileStore.php";
  require_once "Auth/OpenID/AX.php";
 
 
 
  function login()
  {
  // Just tested this with/for Google, needs trying with others ...
  $oid_identifier = 'https://www.google.com/accounts/o8/id';
  // Create file storage area for OpenID data
  $store = new Auth_OpenID_FileStore('lib/openid-php/oid_store');
  // Create OpenID consumer
  $consumer = new Auth_OpenID_Consumer($store);
  // Create an authentication request to the OpenID provider
  $auth = $consumer -> begin($oid_identifier);
 
  // Create attribute request object
  // See http://code.google.com/apis/accounts/docs/OpenID.html#Parameters for parameters
  // Usage: make($type_uri, $count=1, $required=false, $alias=null)
  $attribute[] = Auth_OpenID_AX_AttrInfo :: make('http://axschema.org/contact/email', 2, 1, 'email');
  $attribute[] = Auth_OpenID_AX_AttrInfo :: make('http://axschema.org/namePerson/first', 1, 1, 'firstname');
  $attribute[] = Auth_OpenID_AX_AttrInfo :: make('http://axschema.org/namePerson/last', 1, 1, 'lastname');
 
  // Create AX fetch request
  $ax = new Auth_OpenID_AX_FetchRequest;
 
  // Add attributes to AX fetch request
  foreach($attribute as $attr) {
  $ax -> add($attr);
  }
 
  // Add AX fetch request to authentication request
  $auth -> addExtension($ax);
  $_SESSION['returnURL'] = curPageURL();
  // Redirect to OpenID provider for authentication
  $url = $auth -> redirectURL(getTrustRoot(), $_SESSION['returnURL']);
  header('Location: ' . $url);
  }
 
 
  function auth()
 
  {
  if ($_SESSION['authed'] == true) return true;
 
  // Create file storage area for OpenID data
  $store = new Auth_OpenID_FileStore('lib/openid-php/oid_store');
  // Create OpenID consumer
  $consumer = new Auth_OpenID_Consumer($store);
  // Create an authentication request to the OpenID provider
  $response = $consumer -> complete($_SESSION['returnURL']);
 
  if ($response -> status == Auth_OpenID_SUCCESS) {
  // Get registration informations
  $ax = new Auth_OpenID_AX_FetchResponse();
  $obj = $ax -> fromSuccessResponse($response);
  $email = $obj -> data['http://axschema.org/contact/email'][0];
  var_dump($email);
  if ($email != "maxious@gmail.com") {
  die("Access Denied");
  } else {
  $_SESSION['authed'] = true;
  }
  } else {
  login();
  }
  }
  if ($_REQUEST['janrain_nonce']) auth();
  ?>
<?php <?php
// Copyright 2009 Google Inc. All Rights Reserved. // Copyright 2009 Google Inc. All Rights Reserved.
$GA_ACCOUNT = "MO-22173039-1"; $GA_ACCOUNT = "MO-22173039-1";
$GA_PIXEL = "/lib/ga.php"; $GA_PIXEL = "/lib/ga.php";
function googleAnalyticsGetImageUrl() function googleAnalyticsGetImageUrl()
{ {
global $GA_ACCOUNT, $GA_PIXEL; global $GA_ACCOUNT, $GA_PIXEL;
//if (stristr($_SERVER['HTTP_USER_AGENT'], 'Googlebot') return ""; //if (stristr($_SERVER['HTTP_USER_AGENT'], 'Googlebot') return "";
$url = ""; $url = "";
$url.= $GA_PIXEL . "?"; $url.= $GA_PIXEL . "?";
$url.= "utmac=" . $GA_ACCOUNT; $url.= "utmac=" . $GA_ACCOUNT;
$url.= "&utmn=" . rand(0, 0x7fffffff); $url.= "&utmn=" . rand(0, 0x7fffffff);
$referer = $_SERVER["HTTP_REFERER"]; $referer = $_SERVER["HTTP_REFERER"];
$query = $_SERVER["QUERY_STRING"]; $query = $_SERVER["QUERY_STRING"];
$path = $_SERVER["REQUEST_URI"]; $path = $_SERVER["REQUEST_URI"];
if (empty($referer)) { if (empty($referer)) {
$referer = "-"; $referer = "-";
} }
$url.= "&utmr=" . urlencode($referer); $url.= "&utmr=" . urlencode($referer);
if (!empty($path)) { if (!empty($path)) {
$url.= "&utmp=" . urlencode($path); $url.= "&utmp=" . urlencode($path);
} }
$url.= "&guid=ON"; $url.= "&guid=ON";
return str_replace("&", "&amp;", $url); return str_replace("&", "&amp;", $url);
} }
function include_header($pageTitle, $pageType, $opendiv = true, $geolocate = false, $datepicker = false) function include_header($pageTitle, $pageType, $opendiv = true, $geolocate = false, $datepicker = false)
{ {
global $labsPath; global $labsPath,$serviceAlertsEnabled;
echo ' echo '
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>' . $pageTitle . '</title> <title>' . $pageTitle . '</title>
<meta name="google-site-verification" content="-53T5Qn4TB_de1NyfR_ZZkEVdUNcNFSaYKSFkWKx-sY" /> <meta name="google-site-verification" content="-53T5Qn4TB_de1NyfR_ZZkEVdUNcNFSaYKSFkWKx-sY" />
<link rel="dns-prefetch" href="//code.jquery.com"> <link rel="dns-prefetch" href="//code.jquery.com">
<link rel="dns-prefetch" href="//ajax.googleapis.com"> <link rel="dns-prefetch" href="//ajax.googleapis.com">
<link rel="stylesheet" href="' . $labsPath . 'css/jquery-ui-1.8.12.custom.css" />'; <link rel="stylesheet" href="' . $labsPath . 'css/jquery-ui-1.8.12.custom.css" />';
if (isDebugServer()) { if (isDebugServer()) {
$jqmcss = $labsPath . 'css/jquery.mobile-1.0b2.css'; $jqmcss = $labsPath . 'css/jquery.mobile-1.0b2.css';
$jqjs = $labsPath . 'js/jquery-1.6.2.min.js'; $jqjs = $labsPath . 'js/jquery-1.6.2.min.js';
$jqmjs = $labsPath . 'js/jquery.mobile-1.0b2.js'; $jqmjs = $labsPath . 'js/jquery.mobile-1.0b2.js';
} }
else { else {
$jqmcss = "//code.jquery.com/mobile/1.0b2/jquery.mobile-1.0b2.min.css"; $jqmcss = "//code.jquery.com/mobile/1.0b2/jquery.mobile-1.0b2.min.css";
$jqjs = "//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"; $jqjs = "//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js";
$jqmjs = "//code.jquery.com/mobile/1.0b2/jquery.mobile-1.0b2.min.js"; $jqmjs = "//code.jquery.com/mobile/1.0b2/jquery.mobile-1.0b2.min.js";
} }
echo '<link rel="stylesheet" href="' . $jqmcss . '" /> echo '<link rel="stylesheet" href="' . $jqmcss . '" />
<script src="'.$jqjs.'"></script> <script src="'.$jqjs.'"></script>
<script>$(document).bind("mobileinit", function(){ <script>$(document).bind("mobileinit", function(){
$.mobile.ajaxEnabled = false; $.mobile.ajaxEnabled = false;
}); });
</script> </script>
<script src="'.$jqmjs.'"></script> <script src="'.$jqmjs.'"></script>
   
<script src="' . $labsPath . 'js/jquery.ui.core.min.js"></script> <script src="' . $labsPath . 'js/jquery.ui.core.min.js"></script>
<script src="' . $labsPath . 'js/jquery.ui.position.min.js"></script> <script src="' . $labsPath . 'js/jquery.ui.position.min.js"></script>