2017 © Pedro Peláez
 

library knkv-webservice-api

KNKV Webservice API

image

fruitcakestudio/knkv-webservice-api

KNKV Webservice API

  • Saturday, August 5, 2017
  • by Barryvdh
  • Repository
  • 4 Watchers
  • 0 Stars
  • 30 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

KNKV Webservice API Wrapper

Use Composer to install this package ("fruitcakestudio/knkv-webservice-api": "0.1.x@dev",) and require the autoloader., (*1)

You can use the HttpClient to make requests to the API directly or use the API object to get more abstracted results., (*2)

All objects have public properties, matching the key/value from the API directly. getProgam, getResults and getStandings can be called on the API directly, or on a team. The Team ID is then passed on automatically., (*3)

See the documentation on http://www.onswebbond.nl/userfiles/knkv/webservice.zip, (*4)

You need a subscription to the Onsweb Clubplugin for KNKV: http://www.onswebbond.nl/, (*5)

Note: the API limits unique requests to 1 per hour. See Cache usage below., (*6)

Note: the page parameter on getResults doesn't seem to be working yet., (*7)

Simple example:, (*8)

require_once __DIR__ .'/../vendor/autoload.php';

use KNKV\Webservice\Api;

// Create a new API instance
$api = new Api($code);

$program = $api->getProgram(true);

foreach($api->getTeams() as $team){
    echo $team->getName();
    $results = $team->getResults();

    foreach($team->getStandings() as $standing){
        echo $standing->poule->getName();
        foreach ($standing->lines as $line) {
            echo $line->position .'. ' . $line->team_name;
        }
    }
}

Cache

You can use the cache component from Laravel (illuminate/cache). By default, an ArrayCache is used, which only caches for the current request. If you want to use a FileCache for example, composer require "illuminate/filesystem": "~4.0 and do the following:, (*9)

$filesystem = new \Illuminate\Filesystem\Filesystem;
$cacheStore = new \Illuminate\Cache\FileStore($filesystem, __DIR__.'/cache');

// Create a new API instance
$api = new Api($code, $cacheStore);

When using Laravel, you can use Cache::getStore() to get the Cache store., (*10)

The Versions

05/08 2017

dev-master

9999999-dev

KNKV Webservice API

  Sources   Download

MIT

The Requires

 

sportlink knkv korfbal onsweb

30/12 2014

v0.1.0

0.1.0.0

KNKV Webservice API

  Sources   Download

MIT

The Requires

 

sportlink knkv korfbal onsweb