php-extended / php-api-fr-gouv-datatourisme-diffuseur-object
实现了php-extended/php-api-fr-gouv-datatourisme-diffuseur-interface库的库
7.0.5
2024-07-31 15:03 UTC
Requires
Requires (Dev)
- dev-master
- 7.0.5
- 7.0.4
- 7.0.3
- 7.0.2
- 7.0.1
- 7.0.0
- 6.3.17
- 6.3.16
- 6.3.15
- 6.3.14
- 6.3.13
- 6.3.12
- 6.3.11
- 6.3.10
- 6.3.9
- 6.3.8
- 6.3.7
- 6.3.6
- 6.3.5
- 6.3.4
- 6.3.3
- 6.3.2
- 6.3.1
- 6.3.0
- 6.2.1
- 6.2.0
- 6.1.7
- 6.1.6
- 6.1.5
- 6.1.4
- 6.1.3
- 6.1.2
- 6.1.1
- 6.1.0
- 6.0.0
- 5.0.0
- 4.0.3
- 4.0.2
- 4.0.1
- 4.0.0
- 3.2.6
- 3.2.5
- 3.2.4
- 3.2.3
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.6
- 3.1.5
- 3.1.4
- 3.1.3
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.11
- 3.0.10
- 3.0.9
- 3.0.8
- 3.0.7
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
This package is auto-updated.
Last update: 2024-08-31 13:16:44 UTC
README
实现了php-extended/php-api-fr-gouv-datatourisme-diffuseur-interface库的库。
安装
此库的安装是通过composer完成的,所有类的自动加载都是通过它们的自动加载器完成的。
- 从他们的网站下载
composer.phar
。 - 然后运行以下命令以将此库作为依赖项安装
php composer.phar require php-extended/php-api-fr-gouv-datatourisme-diffuseur-object ^7
基本用法
此库可以按以下方式使用
use PhpExtended\DatatourismeDiffuseurApi\DtDiffApiEndpoint;
use PhpExtended\Endpoint\HttpEndpoint;
/** @var $client \Psr\Http\Client\ClientInterface */
// note, the client or the endpoint must do gzip
// uncompressing when retrieving the file. You may use the
// \PhpExtended\Endpoint\GzipHttpEndpoint as wrapper around
// the HttpEndpoint to do the job if the client does not.
// note2 : the client must support the X-Php-Download-File
// custm header to specify a temporary location, or do gzip
// uncompressing on the fly (as the following unzipping is
// done by this endpoint on the temp folder and the php-zip
// library needs a file to operate).
$endpoint = new DtDiffApiEndpoint('/tmp/', new GzipHttpEndpoint(new HttpEndpoint($client)));
$iterator = $endpoint->downloadFlux($fluxKey, $apiKey);
foreach($iterator as $line)
{
try
{
$poi = $iterator->getPointOfInterestData($resume);
// do something with poi object
}
catch(\Throwable $exc)
{
// do something in case object cannot be read
}
}
许可证
MIT (见许可证文件)。