PHPackages                             drsdre/yii2-xmlsoccer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. drsdre/yii2-xmlsoccer

ActiveYii2-extension[API Development](/categories/api)

drsdre/yii2-xmlsoccer
=====================

Yii2 Extension for XMLSoccer.com API access

1.0.0(8y ago)1782[1 PRs](https://github.com/drsdre/yii2-xmlsoccer/pulls)BSD-3-ClausePHPPHP &gt;=5.5.0

Since Jul 6Pushed 8y ago1 watchersCompare

[ Source](https://github.com/drsdre/yii2-xmlsoccer)[ Packagist](https://packagist.org/packages/drsdre/yii2-xmlsoccer)[ Docs](https://github.com/drsdre/yii2-xmlsoccer)[ RSS](/packages/drsdre-yii2-xmlsoccer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (8)Used By (0)

Yii2-xmlsoccer
==============

[](#yii2-xmlsoccer)

Yii2 client for [XMLSoccer](http://XMLSoccer.com) API

Full API Documentation here: [http://xmlsoccer.wikia.com/wiki/API\_Documentation](http://xmlsoccer.wikia.com/wiki/API_Documentation)

Requirements:
=============

[](#requirements)

PHP5 with CURL, SimpleXML extensions.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
$ composer require --prefer-dist drsdre/yii2-xmlsoccer "*"
```

or add

```
"drsdre/yii2-xmlsoccer": "*"
```

to the `require` section of your `composer.json` file.

Usage
-----

[](#usage)

You need to setup the client as application component:

```
'components' => [
    'xmlsoccerApi' => [
        'class' => '\drsdre\yii\xmlsoccer\Client',
        'apiKey' => 'xxx',
        'serviceUrl' => 'http://www.xmlsoccer.com/FootballData.asmx',
    ]
    ...
]
```

or define the client directly in the code:

```
$client = new \drsdre\yii\xmlsoccer\Client([
    'apiKey' => 'xxx',
    'serviceUrl' => 'http://www.xmlsoccer.com/FootballData.asmx',
]);
```

By default client url is setup to demo API (). For demo access use  as url.

Configuration
-------------

[](#configuration)

Optionally a cache component can be added to keep the client returning data during call time-out:

```
'components' => [
    'xmlsoccerApi' => [
        'class' => '\drsdre\yii\xmlsoccer\Client',
        'apiKey' => 'xxx',
        'cache' => [
            'class' => '\yii\caching\FileCache'
        ],
    ]
    ...
]
```

To facilitate quicker processing of the data, a content hash can be generated by setting the parameter 'generate\_hash' to true. The XML ouput will then include two new attributes:

- contentHash: MD5 hash
- sourceURL: URL used to retrieve the data

If you need to have the API be executed via a specific network adapter it's possible the specify the outgoing IP:

```
$client = new \drsdre\yii\xmlsoccer\Client([
    'apiKey' => 'xxx',
    'serviceUrl' => 'http://www.xmlsoccer.com/FootballData.asmx',
    'serviceIp' => '192.168.1.1',
]);
```

How to use API:
===============

[](#how-to-use-api)

Go to [Getting started](http://xmlsoccer.wikia.com/wiki/Getting_started) and receive API key for access to XMLSoccer.com API.

Include the module, and call one of available methods.

Methods Available
-----------------

[](#methods-available)

Go to  for more info about methods and parameters including online testing. See [input data formats](http://xmlsoccer.wikia.com/wiki/Input_data_formats) to find out how the input parameters need to be formatted.

Examples:
=========

[](#examples)

List players for team with id 49
--------------------------------

[](#list-players-for-team-with-id-49)

```
try {
    $client = new \drsdre\yii\xmlsoccer\Client([
        'apiKey' => 'xxx',
    ]);
    $players = $client->getPlayersByTeam('49');
    echo "Players List:";
    foreach($players as $key => $value) {
        echo "".$value->Name." ".$value->Position."";
    }
}
catch(Exception $e) {
    echo "XMLSoccer Exception: ".$e->getMessage();
}
```

If your server has multiple IP's available, you can set any IP for request:
---------------------------------------------------------------------------

[](#if-your-server-has-multiple-ips-available-you-can-set-any-ip-for-request)

```
try {
    $client = new \drsdre\yii\xmlsoccer\Client([
        'apiKey' => 'xxx',
    ]);
    $client->setRequestIp("ip_for_request");
    $leagues = $client->getLeagueStandingsBySeason('3', '1516'));
    var_dump($leagues);
}
catch(Exception $e) {
    echo "XMLSoccer Exception: ".$e->getMessage();
}
```

If you have a trial/free demo feed, use it like this:
-----------------------------------------------------

[](#if-you-have-a-trialfree-demo-feed-use-it-like-this)

```
try{
    $client = new \drsdre\yii\xmlsoccer\Client([
        'apiKey' => 'xxx',
        'serviceUrl' => 'http://www.xmlsoccer.com/FootballDataDemo.asmx',
    ]);
    $fixtures = $client->getFixturesByDateIntervalAndLeague('2016-01-01 00:00', '2016-02-01 00:00', '3'));
    var_dump($fixtures);
}
catch(Exception $e){
    echo "XMLSoccer Exception: ".$e->getMessage();
}
```

**That's all!**

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~172 days

Recently: every ~257 days

Total

7

Last Release

2939d ago

Major Versions

0.0.6 → 1.0.02018-05-01

PHP version history (2 changes)0.0.1PHP &gt;=5.4.0

1.0.0PHP &gt;=5.5.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/af1ce9c639e6df7041d55842e18825a11d3864f176a9a273dfd86fca5549d7fa?d=identicon)[drsdre](/maintainers/drsdre)

---

Top Contributors

[![drsdre](https://avatars.githubusercontent.com/u/809827?v=4)](https://github.com/drsdre "drsdre (20 commits)")

---

Tags

apisoapyii2extensionconsumerlive football scoresXMLSoccer.com

### Embed Badge

![Health badge](/badges/drsdre-yii2-xmlsoccer/health.svg)

```
[![Health](https://phpackages.com/badges/drsdre-yii2-xmlsoccer/health.svg)](https://phpackages.com/packages/drsdre-yii2-xmlsoccer)
```

###  Alternatives

[mongosoft/yii2-soap-client

SOAP Client Extension for Yii 2

37404.9k](/packages/mongosoft-yii2-soap-client)[dotzero/yii2-amocrm

Расширение для Yii Framework 2 реализующее клиент для работы с API amoCRM

1639.7k](/packages/dotzero-yii2-amocrm)[conquer/services

Yii2 soap wsdl web services

1632.5k](/packages/conquer-services)[mikemadisonweb/yii2-elasticsearch

Yii2 extension for integration with Elasticsearch version 5.0 and above.

153.9k](/packages/mikemadisonweb-yii2-elasticsearch)[apexwire/yii2-restclient

Tools to use API as ActiveRecord for Yii2

143.5k](/packages/apexwire-yii2-restclient)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
