pgrimaud/horaires-ratp-sdk
Composer 安装命令:
composer require pgrimaud/horaires-ratp-sdk
包简介
RATP SDK - Retrieve schedules for any given RER (train), Metro, or Tramway stop in real time. The RATP is a public transport operator based in Paris, France.
README 文档
README
Retrieve real time schedules for any given RER (train), Metro, Tramway or Bus stop in real time.
You hate SOAP protocol and want to use the official RATP API? Welcome here.
BEWARE : WSDL contains some "frenglish" such as documentation.
Translations
This README file is also available in french.
Requirements
- Access to the RATP API (see here)
- PHP >= 5.6
- Package php-soap (ext-soap extension)
Installation
composer require pgrimaud/horaires-ratp-sdk
Basic usage
Get all stations of a line.
use Ratp\Api; $reseau = new \Ratp\Reseau(); $reseau->setCode('metro'); $line = new \Ratp\Line(); $line->setReseau($reseau); $line->setCode('8'); $station = new \Ratp\Station(); $station->setLine($line); $stations = new \Ratp\Stations($station); $api = new Api(); $return = $api->getStations($stations)->getReturn(); foreach ($return->getStations() as $station) { /** @var \Ratp\Station $station */ echo $station->getName() . "\n"; }
You can see more examples here.
TODO (but la flemme)
- Unit tests
Copyrights
This project is not affiliated with or endorsed by the RATP.
Licence
Licensed under the terms of the MIT License.
统计信息
- 总下载量: 2.79k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 23
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-03-04