Skip to content

Data modeling and object writer for General Transit Feed Specification (GTFS)

Notifications You must be signed in to change notification settings

smartilabs/phpgtfs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

phpgtfs

phpgtfs is a data modeling and object writer for General Transit Feed Specification (GTFS).

Installation

Install with Composer

Usage

$agencies = new \smartilabs\phpgtfs\gtfs\Agencies();

$agency = new \smartilabs\phpgtfs\model\Agency();
$agency->agency_name = 'Demo agency';
$agency->agency_url = 'http://localhost/';
$agency->agency_timezone = 'America/Los_Angeles';
$agency->agency_lang = 'en';

$agencies->add($agency);

Then simply

\smartilabs\phpgtfs\Writer::write('gtfs/', $agencies);

and an agencies.txt file will be placed in the gtfs folder. Note that even unspecified columns will be written:

agency_id,agency_name,agency_url,agency_timezone,agency_lang,agency_phone,agency_fare_url
,"Demo agency",http://localhost/,America/Los_Angeles,en,,

License

MIT

About

Data modeling and object writer for General Transit Feed Specification (GTFS)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%