Skip to content

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

Notifications You must be signed in to change notification settings

cookieguru/phpgtfs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 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 \cookieguru\phpgtfs\gtfs\Agencies();

$agency = new \cookieguru\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

\cookieguru\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)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages