phpgtfs
is a data modeling and object writer for
General Transit Feed Specification (GTFS).
Install with Composer
$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,,
MIT