andinger/openligadb-api

OpenLigaDB 的 PHP API

1.0.6 2016-04-05 07:48 UTC

This package is not auto-updated.

Last update: 2024-09-14 19:20:02 UTC


README

封装了基于 SOAP 的 API 的 http://www.openligadb.de/ 并返回易于使用的 PHP 对象。目前,这个小项目并不支持所有提供的方法。请随意通过 pull-request 添加缺失的方法。

安装

composer require andinger/openligadb-api

使用

1. 创建一个新的 Client-Object

// use the standard wsdl url
$client = new Andinger\OpenLigaDbApi\Client();

// use another wsdl url
$client = new Andinger\OpenLigaDbApi\Client('https://my.custom.wsdl.url.com/...wsdl');

// use additional SoapClient-Config
// @see https://php.ac.cn/manual/de/soapclient.soapclient.php for further information
$options = [
    'local_cert' => 'cert_key.pem'
];

$client = new Andinger\OpenLigaDbApi\Client('https://my.custom.wsdl.url.com/...wsdl', $options);

2. 调用方法

$client->getAvailableLeagues()
$client->getAvailableSports()
$client->getAvailableGroups($league, $season)
$client->getAvailableLeaguesBySport($sportId)
$client->getGoalsByMatch($matchId)
$client->getGoalsByLeagueSeason($league, $season)
$client->getCurrentGroup($league)
$client->getMatchesByGroupLeagueSeason($groupOrderId, $league, $season)
$client->getMatchesByLeagueSeason($league, $season)
$client->getTeamsByLeagueSeason($league, $season)
$client->getMatchesByTeams($teamId1, $teamId2)

Client-Class 中的所有方法都有文档说明

更多信息

有关更多信息,请参阅 http://www.openligadb.de