Purge openid-php
Purge openid-php

file:b/.gitignore (new)
--- /dev/null
+++ b/.gitignore
@@ -1,1 +1,9 @@
 
+/labs/tiles/12
+/labs/tiles/13
+/labs/tiles/14
+/labs/tiles/15
+/labs/tiles/16
+/labs/tiles/17
+/labs/tiles/19
+/nbproject/private/

--- a/aws/busuiphp.sh
+++ b/aws/busuiphp.sh
@@ -2,9 +2,16 @@
 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 
+
 chcon -R -t httpd_sys_content_rw_t /var/www/labs/tiles
 chmod -R 777 /var/www/labs/tiles
+
+mkdir /var/www/lib/openid-php/oid_store
+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 \
 -O /var/www/cbrfeed.zip

--- /dev/null
+++ b/include/common-auth.inc.php
@@ -1,1 +1,33 @@
+<?php
+require $basePath.'lib/openid.php';
+ $openid = new LightOpenID($_SERVER['HTTP_HOST']);
+ 
+function login()
+{
+ global $openid;
+ if(!$openid->mode) {
+    $openid->required = array('contact/email');
+            $openid->identity = 'https://www.google.com/accounts/o8/id';
+            header('Location: ' . $openid->authUrl());
+ }
+    } 
 
+
+function auth()
+
+{
+  if ($_SESSION['authed'] == true) return true;
+ global $openid;
+  
+  if($openid->mode) {
+      $attr = $openid->getAttributes();
+        if ($attr["contact/email"] != "maxious@gmail.com") {
+            die("Access Denied");
+             } else {
+               $_SESSION['authed'] = true;
+             }
+        } else {
+        login();
+         } 
+    } 
+?>

--- a/include/common-template.inc.php
+++ b/include/common-template.inc.php
@@ -159,8 +159,8 @@
 		if ($serviceAlertsEnabled) {
 		$serviceAlerts = getServiceAlerts("network","network");
 		foreach ($serviceAlerts['entities'] as $entity) {
-			echo "<div id='servicewarning'>".date("F j, g:i a",strtotime($entity['alert']['active_period']['start']))." to ". date("F j, g:i a", strtotime($entity['alert']['active_period']['end']))."<br>Warning: {$entity['alert']['description']['translation']} 
-			<br><a href='{$entity['alert']['url']['translation']}'>Source</a>  </div>";
+			echo "<div id='servicewarning'>".date("F j, g:i a",strtotime($entity['alert']['active_period']['start']))." to ". date("F j, g:i a", strtotime($entity['alert']['active_period']['end']))."{$entity['alert']['header_text']['translation']['text']}<br>Warning: {$entity['alert']['description_text']['translation']['text']} 
+			<br><a href='{$entity['alert']['url']['translation']['text']}'>Source</a>  </div>";
 		}
 	}
 	}

--- a/include/common-transit.inc.php
+++ b/include/common-transit.inc.php
@@ -45,6 +45,32 @@
 		return "";
 	}
 }
+
+$serviceAlertCause = Array(
+"UNKNOWN_CAUSE" => "Unknown cause",
+"OTHER_CAUSE" => "Other cause",
+"TECHNICAL_PROBLEM" => "Technical problem",
+"STRIKE" => "Strike",
+"DEMONSTRATION" => "Demonstration",
+"ACCIDENT" => "Accident",
+"HOLIDAY" => "Holiday",
+"WEATHER" => "Weather",
+"MAINTENANCE" => "Maintenance",
+"CONSTRUCTION" => "Construction",
+"POLICE_ACTIVITY" => "Police activity",
+"MEDICAL_EMERGENCY" => "Medical emergency"
+);
+$serviceAlertEffect = Array(
+"NO_SERVICE" => "No service",
+"REDUCED_SERVICE" => "Reduced service",
+"SIGNIFICANT_DELAYS" => "Significant delays",
+"DETOUR" => "Detour",
+"ADDITIONAL_SERVICE" => "Additional service",
+"MODIFIED_SERVICE" => "Modified service",
+"OTHER_EFFECT" => "Other effect",
+"UNKNOWN_EFFECT" => "Unknown effect",
+"STOP_MOVED" => "Stop moved");
+
 function getServiceAlerts($filter_class, $filter_id) {
 /*
 
@@ -66,8 +92,9 @@
             route patch: trip remove
             */
 $return = Array();
-$return['header']['gtrtfs_version'] = "1";
+$return['header']['gtfs_realtime_version'] = "1";
 $return['header']['timestamp'] = time();
+$return['header']['incrementality'] =  "FULL_DATASET";
 $return['entities'] = Array();
 foreach(getCurrentAlerts() as $alert) {
 	$informedEntities = getInformedAlerts($alert['id'],$_REQUEST['filter_class'],$_REQUEST['filter_id']);
@@ -76,8 +103,12 @@
 		$entity['id'] = $alert['id'];
 		$entity['alert']['active_period']['start'] = $alert['start'];
 		$entity['alert']['active_period']['end'] = $alert['end'];
-		$entity['alert']['url']['translation'] = $alert['url'];
-		$entity['alert']['description']['translation'] = $alert['description'];
+		$entity['alert']['url']['translation']['text'] = $alert['url'];
+		$entity['alert']['url']['translation']['language'] = 'en';
+		$entity['alert']['header_text']['translation']['text'] = $alert['header'];
+		$entity['alert']['header_text']['translation']['language'] = 'en';
+		$entity['alert']['description_text']['translation']['text'] = $alert['description'];
+		$entity['alert']['description_text']['translation']['language'] = 'en';
 		
 		foreach ($informedEntities as $informedEntity) {
 			$informed = Array();

--- a/include/common.inc.php
+++ b/include/common.inc.php
@@ -43,6 +43,7 @@
 
 include_once ("common-request.inc.php");
 include_once ("common-session.inc.php");
+include_once ("common-auth.inc.php");
 include_once ("common-template.inc.php");
 
 
@@ -55,6 +56,7 @@
 	global $debugOkay;
 	return in_array($debugReason, $debugOkay, false) && isDebugServer();
 }
+
 function debug($msg, $debugReason = "other")
 {
 	if (isDebug($debugReason)) echo "\n<!-- " . date(DATE_RFC822) . "\n $msg -->\n";
@@ -187,5 +189,6 @@
   } 
   return implode( $glue, $retVal ); 
 } 
+
 ?>
 

--- a/include/db/trip-dao.inc.php
+++ b/include/db/trip-dao.inc.php
@@ -215,14 +215,14 @@
          } 
     return $query -> fetchAll();
     } 
-function viaPoints($tripID, $stop_sequence = "")
+function viaPoints($tripID, $stop_sequence = "", $timing_points_only = true)
 
 {
      global $conn;
      $query = "SELECT stops.stop_id, stop_name, arrival_time
 FROM stop_times join stops on stops.stop_id = stop_times.stop_id
 WHERE stop_times.trip_id = :tripID
-" . ($stop_sequence != "" ? " AND stop_sequence > :stop_sequence " : "") . "AND substr(stop_code,1,2) != 'Wj' ORDER BY stop_sequence";
+" . ($stop_sequence != "" ? " AND stop_sequence > :stop_sequence " : "") . ($timing_points_only ? "AND substr(stop_code,1,2) != 'Wj' ": ""). " ORDER BY stop_sequence";
      debug($query, "database");
      $query = $conn -> prepare($query);
      if ($stop_sequence != "") $query -> bindParam(":stop_sequence", $stop_sequence);

--- a/labs/index.php
+++ b/labs/index.php
@@ -1,6 +1,18 @@
 <?php
 include ('../include/common.inc.php');
-include_header("Busness R&amp;D", "index")
+
+include_header("Busness R&amp;D", "index");
+ if ($_SESSION['authed'] == true) {
+ 	echo '<ul data-role="listview" data-theme="e" data-groupingtheme="e">
+		<li data-role="list-divider" > Admin Features </li>
+		<li><a href="myway_timeliness_calculate.php"><h3>myway_timeliness_calculate</h3>
+		<p>myway_timeliness_calculate</p></a></li>
+		<li><a href="myway_timeliness_reconcile.php"><h3>myway_timeliness_reconcile</h3>
+		<p>myway_timeliness_reconcile</p></a></li>
+		<li><a href="servicealert_editor.php"><h3>servicealert_editor</h3>
+		<p>servicealert_editor</p></a></li>
+            </ul>';
+ }
 ?>
 	    <ul data-role="listview" data-theme="e" data-groupingtheme="e">
 		<li data-role="list-divider" > Experimental Features </li>

--- a/labs/myway_timeliness_reconcile.php
+++ b/labs/myway_timeliness_reconcile.php
@@ -1,5 +1,6 @@
 <?php
 include ('../include/common.inc.php');
+auth();
 foreach ($_REQUEST as $key => $value) {
 	if (strstr($key, "route") && !strstr($value, "Select")) {
 		$myway_route = str_replace("route", "", $key);

--- a/labs/servicealert_editor.php
+++ b/labs/servicealert_editor.php
@@ -1,5 +1,6 @@
 <?php
 include ('../include/common.inc.php');
+auth();
 include_header("Service Alert Editor", "serviceAlertEditor");
 /**
  * Currently support:
@@ -12,9 +13,9 @@
  * - trip search by route
  */
 if (isset($_REQUEST['saveedit'])) {
-
-if ($_REQUEST['saveedit'] != "") updateServiceAlert($_REQUEST['saveedit'], $_REQUEST['startdate'], $_REQUEST['enddate'], $_REQUEST['description'], $_REQUEST['url']);
-else addServiceAlert($_REQUEST['startdate'], $_REQUEST['enddate'], $_REQUEST['description'], $_REQUEST['url']);
+    
+    if ($_REQUEST['saveedit'] != "") updateServiceAlert($_REQUEST['saveedit'], $_REQUEST['startdate'], $_REQUEST['enddate'], $_REQUEST['description'], $_REQUEST['url']);
+    else addServiceAlert($_REQUEST['startdate'], $_REQUEST['enddate'], $_REQUEST['description'], $_REQUEST['url']);
      echo "Saved " . $_REQUEST['saveedit'];
      die();
      } 
@@ -44,18 +45,26 @@
          foreach (getStopRoutes($_REQUEST['stopid'], $sp) as $route) {
             addInformedAlert($_REQUEST['stopsearch'], "route", $route['route_id'], "inform");
              echo "Added route inform for" . $_REQUEST['stopsearch'] . ", route" . $route['route_id'] . "<br>\n";
-            
-            
              } 
         } 
     die();
      } 
 if ($_REQUEST['routesearch']) {
     echo "Informing route<br>\n";
-     getRouteTrips();
+     $stops = Array();
      echo "Informing trips<br>\n";
-     echo "Informing stops<br>\n";
-     die();
+     foreach(getRouteTrips() as $trip) {
+        addInformedAlert($_REQUEST['stopsearch'], "trip", $trip['trip_id'], "patch");
+         echo "Added trip patch for" . $_REQUEST['stopsearch'] . ", trip" . $trip['trip_id'] . "<br>\n";
+         viaPoints($tripID, "", false);
+         } 
+    
+    echo "Informing stops<br>\n";
+     foreach($stops as $stop) {
+        addInformedAlert($_REQUEST['stopsearch'], "stop", $_REQUEST['stopid'], "remove");
+         echo "Added stop remove for" . $_REQUEST['stopsearch'] . ", stop" . $_REQUEST['stopid'] . "<br>\n";
+         } 
+    die();
      } 
 if ($_REQUEST['streetsearch']) {
     
@@ -141,7 +150,7 @@
 <form action="<?php echo basename(__FILE__) ;
      ?>" method="get">
         <input type="hidden" name="networkinform" value="<?php echo $_REQUEST['edit'];
-    ?>"/>
+     ?>"/>
         <input type="submit" value="Add Network Inform"/>
                 </form>
                 <form action="<?php echo basename(__FILE__) ;
@@ -151,7 +160,7 @@
         <input type="text" name="stopid" />
     </div>
         <input type="hidden" name="stopsearch" value="<?php echo $_REQUEST['edit'];
-    ?>"/>
+     ?>"/>
         <input type="submit" value="Stop Search"/>
                 </form>
 <form action="<?php echo basename(__FILE__) ;
@@ -161,7 +170,7 @@
         <input type="text" name="street" />
     </div>
         <input type="hidden" name="streetsearch" value="<?php echo $_REQUEST['edit'];
-    ?>"/>
+     ?>"/>
         <input type="submit" value="Street Search"/>
                 </form>
                 <form action="<?php echo basename(__FILE__) ;
@@ -171,7 +180,7 @@
         <input type="text" name="routeid" />
     </div>
         <input type="hidden" name="routesearch" value="<?php echo $_REQUEST['edit'];
-    ?>"/>
+     ?>"/>
         <input type="submit" value="Route Search"/>
                 </form>
 <?php

--- /dev/null
+++ b/lib/Protobuf-PHP/LICENSE
@@ -1,1 +1,21 @@
+The MIT License
 
+Copyright (c) 2011 Iván -DrSlump- Montes
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.

--- /dev/null
+++ b/lib/Protobuf-PHP/README.md
@@ -1,1 +1,198 @@
+Protobuf for PHP
+================
 
+Protobuf for PHP is an implementation of Google's Protocol Buffers for the PHP
+language, supporting its binary data serialization and including a `protoc` 
+plugin to generate PHP classes from .proto files.
+
+Great effort has been put into generating PHP files that include all sort of type
+hints to aide IDE's with autocompletion. Therefore, it can not only be used to
+communicate with Protocol Buffers services but also as a generation tool for 
+_data objects_ no matter what the final serialization is.
+
+For more information see the [included man pages](http://drslump.github.com/Protobuf-PHP/).
+
+
+## Requirements
+
+  - PHP 5.3  
+  - Pear's Console_CommandLine (for the protoc wrapper tool)
+  - Google's `protoc` compiler version 2.3 or above
+  - GMP or BC Math extensions ¹
+
+  ¹ Only needed for negative values in `int32`, `int64` or `fixed64` types. See
+    the _known issues_ section.
+
+
+## Features
+
+### Working
+
+  - Standard types (numbers, string, enums, messages, etc)
+  - Pluggable serialization backends (codecs)
+    - Standard Binary
+    - Standard TextFormat ¹
+    - PhpArray
+    - JSON
+    - [ProtoJson](https://github.com/drslump/ProtoJson) (_TagMap_ and _Indexed_ variants)
+    - XML
+  - Protoc compiler plugin to generate the PHP classes
+  - Extensions
+  - Unknown fields
+  - Packed fields
+  - Reflection
+  - Dynamic messages with annotations support
+  - Generates service interfaces
+  - Includes comments from .proto files in the generated files
+  - Pear package for easy installation
+
+¹ Only serialization is supported
+
+### Future
+
+  - Speed optimized code generation mode
+  - Support numbers beyond PHP's native limits
+
+
+
+## Example usage
+
+    $person = new Tutorial\Person();
+    $person->name = 'DrSlump';
+    $person->setId(12);
+
+    $book = new Tutorial\AddressBook();
+    $book->addPerson($person);
+
+    // Use default codec
+    $data = $book->serialize();
+
+    // Use custom codec
+    $codec = new \DrSlump\Protobuf\Codec\Binary();
+    $data = $codec->encode($book);
+    // ... or ...
+    $data = $book->serialize($codec);
+
+
+## Installation
+
+Install with Pear
+
+    pear channel-discover pear.pollinimini.net
+    pear install drslump/Protobuf-beta
+
+You can also get the latest version by checking out a copy of the
+repository in your computer.
+
+
+
+## Known issues
+
+
+### Types
+
+PHP is very weak when dealing with numbers processing. Several work arounds have been applied
+to the standard binary codec to reduce incompatibilities between Protobuf types and PHP ones.
+
+  - Protobuf stores floating point values using the [IEEE 754](http://en.wikipedia.org/wiki/IEEE_754) standard
+    with 64bit words for the `double` and 32bit for the `float` types. PHP supports IEEE 754 natively although
+    the precission is platform dependant, however it typically supports 64bit doubles. It means that
+    if your PHP was compiled with 64bit sized doubles (or greater) you shouldn't have any problem encoding
+    and decoded float and double typed values with Protobuf.
+
+  - Integer values are also [platform dependant in PHP](http://www.php.net/manual/en/language.types.integer.php).
+    The library has been developed and tested against PHP binaries compiled with 64bit integers. The encoding and
+    decoding algorithm should in theory work no matter if PHP uses 32bit or 64bit integers internally, just take
+    into account that with 32bit integers the numbers cannot exceed in any case the `PHP_INT_MAX` value (2147483647).
+
+    While Protobuf supports unsigned integers PHP does not. In fact, numbers above the compiled PHP maximum
+    integer (`PHP_INT_MAX`, 0x7FFFFFFFFFFFFFFF for 64bits) will be automatically casted to doubles, which
+    typically will offer 53bits of decimal precission, allowing to safely work with numbers upto
+    0x20000000000000 (2^53), even if they are represented in PHP as floats instead of integers. Higher numbers
+    will loose precission or might even return an _infinity_ value, note that the library does not include
+    any checking for these numbers and using them might provoke unexpected behaviour.
+
+    Negative values when encoded as `int32`, `int64` or `fixed64` types require the big integer extensions
+    [GMP](http://www.php.net/gmp) or [BC Math](http://www.php.net/bc) (the later only for 64bit architectures)
+    to be available in your PHP environment. The reason is that when encoding these negative numbers without
+    using _zigzag_ the binary representation uses the most significant bit for the sign, thus the numbers become
+    above the maximum supported values in PHP. The library will check for these conditions and will automatically
+    try to use GMP or BC to process the value.
+
+
+### Strings
+
+The binary codec expects strings to be encoded using UTF-8. PHP does not natively support string encodings,
+PHP's string data type is basically a length delimited stream of bytes, so it's not trivial to include
+automatic encoding conversion into the library encoding and decoding routines. Instead of trying to guess
+or offer a configuration interface for the encoding, the binary codec will process the `string` type just as
+it would process `byte` one, delegating on your application the task of encoding or decoding in the desired
+character set.
+
+### Memory usage
+
+Large messages might be troublesome since the way the library is modelled does not allow to parse or
+serialize messages as a streams, instead the whole operation is performed in memory, which allows for faster
+processing but could consume too much RAM if messages are too large.
+
+
+### Unknown fields
+
+Since wire types are different across different codec's formats, it's not possible to transcode unkwnon
+fields consumed in one codec to another. This means, for example, that when consuming a message using the
+binary codec, if it contains unknown fields, they won't be included when serializing the message using the
+Json codec.
+
+
+## Generating PHP classes
+
+The generation tool is designed to be run as a `protoc` plugin, thus it should
+work with any proto file supported by the official compiler.
+
+    protoc --plugin=protoc-gen-php --php_out=./build tutorial.proto
+
+To make use of non-standard options in your proto files (like `php.namespace`) you'll
+have to import the `php.proto` file included with the library. It's location will 
+depend on where you've installed this library.
+
+    protoc -I=./Protobuf-PHP/library/DrSlump/Protobuf/Compiler/protos \
+           --plugin=protoc-gen-php --php_out=./build tutorial.proto
+
+In order to make your life easier, the supplied protoc plugin offers an additional
+execution mode, where it acts as a wrapper for the `protoc` invocation. It will
+automatically include the `php.proto` path so that you don't need to worry about it.
+
+    protoc-gen-php -o ./build tutorial.proto
+
+
+## LICENSE:
+
+    The MIT License
+
+    Copyright (c) 2011 Iván -DrSlump- Montes
+
+    Permission is hereby granted, free of charge, to any person obtaining
+    a copy of this software and associated documentation files (the
+    'Software'), to deal in the Software without restriction, including
+    without limitation the rights to use, copy, modify, merge, publish,
+    distribute, sublicense, and/or sell copies of the Software, and to
+    permit persons to whom the Software is furnished to do so, subject to
+    the following conditions:
+
+    The above copyright notice and this permission notice shall be
+    included in all copies or substantial portions of the Software.
+
+    THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+
+
+
+
+

--- /dev/null
+++ b/lib/Protobuf-PHP/Rakefile
@@ -1,1 +1,120 @@
+# encoding: utf-8
+namespace :pear do
 
+  support_files = ['README.md', 'LICENSE', 'protoc-gen-php.php', 'protoc-gen-php.bat']
+  tpl_file = 'package.pear'
+  xml_file = 'library/package.xml'
+
+  desc "Generate package.xml"
+  task :xml => [:clean] do |t, args|
+    unless ENV['version'] then
+      puts 'Version number not given. Use "pear:xml version=1.0"'
+      exit 1
+    end
+
+    # Get template contents
+    text = File.read(tpl_file, :encoding => "UTF-8")
+    # Replace the version, date and time
+    text = text.gsub("{VERSION}", ENV['version'])
+    text = text.gsub('{DATE}', Time.now.strftime('%Y-%m-%d'))
+    text = text.gsub('{TIME}', Time.now.strftime('%H:%M:%S'))
+
+    # Include source files
+    dirs = []
+    Dir.glob('library/**/*.*') do |file|
+      file[0, 'library/'.length] = ''
+      dirs << '<file name="' + file + '" role="php">'
+      dirs << '<tasks:replace from="@package_version@" to="version" type="package-info" />'
+      dirs << '</file>'
+    end
+
+    text = text.gsub('{DIRS}', dirs.join("\n"))
+
+    # Generate a new pear package.xml
+    xml = File.new(xml_file, 'w')
+    xml.syswrite(text);
+    xml.close();
+  end
+
+  desc "Build a release"
+  task :package => ['doc:build', :xml] do
+
+    # Copy supporting files to the package root
+
+    support_files.each do |file|
+       cp file, "library/#{file}"
+    end
+
+    begin
+      sh "pear package -n #{xml_file}"
+    rescue Exception => e
+      puts "Rolling back..."
+      Rake::Task['pear:clean'].execute
+      raise
+    end
+
+    Rake::Task['pear:clean'].execute
+  end
+
+  desc "Clean up"
+  task :clean do
+    puts "Cleaning up..."
+
+    # Remove package.xml
+    rm_f xml_file
+
+    # Remove supporting files
+    support_files.each { |file| rm_f "library/#{file}" }
+  end
+
+end
+
+namespace :doc do
+
+  desc "Generate manual"
+  task :build do
+    version = ENV['version']
+    ENV['RONN_MANUAL'] = "Protobuf-PHP #{version}"
+    ENV['RONN_ORGANIZATION'] = "Ivan -DrSlump- Montes"
+    sh "ronn -w -s toc -r5 --markdown man/*.ronn"
+  end
+
+  desc 'Publish to github pages'
+  task :github => 'doc:build' do
+    require 'git'
+    require 'logger'
+
+    remote = `git remote show origin`
+             .split(%r{\n})  # Ruby 1.9 only has grep() on Array
+             .grep(/Push.*URL/)
+             .first[/git@.*/]
+
+    files = [
+      'protoc-gen-php.1.html',
+      'protobuf-php.3.html',
+      'protobuf-php.5.html',
+    ]
+
+    root = "/tmp/checkout-#{Time.now.to_i}"
+    g = Git.clone(remote, root, :log => Logger.new(STDOUT))
+
+    # Make sure this actually switches branches.
+    g.checkout(g.branch('gh-pages'))
+    
+    files.each {|file|
+      cp "man/#{file}", "#{root}/."
+      g.add(file)
+    }
+
+    g.commit('Regenerating Github Pages.')
+
+    # PUSH!
+    g.push(g.remote('origin'), g.branch('gh-pages'))
+
+    puts '--> GitHub Pages Commit and Push successful.'
+  end
+
+end
+
+
+

--- /dev/null
+++ b/lib/Protobuf-PHP/gtfs-realtime.php
@@ -1,1 +1,3673 @@
-
+<?php
+// DO NOT EDIT! Generated by Protobuf-PHP protoc plugin @package_version@
+// cmd line php -f protoc-gen-php.php  gtfs-realtime.proto -i ./
+// Source: gtfs-realtime.proto
+//   Date: 2011-08-23 07:08:46
+
+// @@protoc_insertion_point(scope_file)
+
+namespace transit_realtime {
+
+  // @@protoc_insertion_point(scope_namespace)
+  // @@protoc_insertion_point(namespace_transit_realtime)
+
+  class FeedMessage extends \DrSlump\Protobuf\Message {
+
+    /** @var \Closure[] */
+    protected static $__extensions = array();
+
+    public static function descriptor()
+    {
+      $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'transit_realtime.FeedMessage');
+
+      // required .transit_realtime.FeedHeader header = 1
+      $f = new \DrSlump\Protobuf\Field();
+      $f->number    = 1;
+      $f->name      = "header";
+      $f->type      = 11;
+      $f->rule      = 2;
+      $f->reference = '\transit_realtime\FeedHeader';
+      // @@protoc_insertion_point(scope_field)
+      // @@protoc_insertion_point(field_transit_realtime.FeedMessage:header)
+      $descriptor->addField($f);
+
+      // repeated .transit_realtime.FeedEntity entity = 2
+      $f = new \DrSlump\Protobuf\Field();
+      $f->number    = 2;
+      $f->name      = "entity";
+      $f->type      = 11;
+      $f->rule      = 3;
+      $f->reference = '\transit_realtime\FeedEntity';
+      // @@protoc_insertion_point(scope_field)
+      // @@protoc_insertion_point(field_transit_realtime.FeedMessage:entity)
+      $descriptor->addField($f);
+
+      foreach (self::$__extensions as $cb) {
+        $descriptor->addField($cb(), true);
+      }
+
+      // @@protoc_insertion_point(scope_descriptor)
+      // @@protoc_insertion_point(descriptor_transit_realtime.FeedMessage)
+
+      return $descriptor;
+    }
+
+    /**  @var \transit_realtime\FeedHeader */
+    public $header = null;
+    
+    /**  @var \transit_realtime\FeedEntity[]  */
+    public $entity = array();
+    
+
+    /**
+     * Check if <header> has a value
+     *
+     * @return boolean
+     */
+    public function hasHeader(){
+      return $this->_has(1);
+    }
+    
+    /**
+     * Clear <header> value
+     *
+     * @return \transit_realtime\FeedMessage
+     */
+    public function clearHeader(){
+      return $this->_clear(1);
+    }
+    
+    /**
+     * Get <header> value
+     *
+     * @return \transit_realtime\FeedHeader
+     */
+    public function getHeader(){
+      return $this->_get(1);
+    }
+    
+    /**
+     * Set <header> value
+     *
+     * @param \transit_realtime\FeedHeader $value
+     * @return \transit_realtime\FeedMessage
+     */
+    public function setHeader(\transit_realtime\FeedHeader $value){
+      return $this->_set(1, $value);
+    }
+    
+    /