Download the PHP package christohill/cfl-api-php without Composer

On this page you can find all versions of the php package christohill/cfl-api-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cfl-api-php

CFL.ca API wrapper for PHP

This is a simple PHP SDK for interacting with the CFL API. All API documentation can be found at http://api.cfl.ca.

Installation

composer install christohill/cfl-api-php dev-master

Usage

Note: none of the API keys below are valid

You can request access to the API at api.cfl.ca/key-request

All endpoints in the API are mapped to their own methods in the wrapper. You can see all the folder full of examples to reference.

Simple usage

Setting API key

There are a few ways to set an API key.

  1. Set an .env variable (CFLPHP_Key): CFLPHP_Key="edf59be9216e66eb17093574376d4c5f"
  2. Set as an argument to the constructor: $teams = new Teams('edf59be9216e66eb17093574376d4c5f')
  3. Use setKey setter method after the class has been instantiated:

Request configuration

Most methods/endpoints accept some sort of configuration (include, sort, filter, pagination). Refer to method names below to see which accept these. These are set as a multidimensional array like this:

There is some special formatting for each config type:

Include

The API accepts comma separated values, so just a simple array will work for this:

Sort

The API accepts comma separated values, so just a simple array will work for this:

Note: Using - in front of the sort term will reverse the order

Filter

The API can accept multiple filters to try and narrow down the data you need. There is a slight change here from the original API to help keep these filters legible.

Instead of using the [property][operator] format, the wrapper uses simple strings with PHP style operators. The operators are as follows:

See how the operators work here

Pagination

Pagination is as simple as passing a page number and size to the config array.

Methods

Method Description Docs
getGames($season, $config) Get a list of all games in a particular season Read docs
getSingleGame($season, $gameID, $config) Get data for a specific game Read docs
getLeaders($season, $category, $config) Get a list of leaders based on a statistical category Read docs
getTeamLeaders($season, $category, $config) Get a list of team leaders based on a statistical category Read docs
getPlayers($config) Get a list of all players Read docs
getSinglePlayer($player_id, $config) Get all data for a specific player Read docs
getStandings($season) Get the team standings for a given season Read docs
getCrossoverStandings($season) Get the crossover team standings for a given season Read docs
getTeams Get a list of all teams Read docs
getTeamByID($team_id) Get a CFL team by unique ID N/A
getTeamByAbbr($abbreviation) Get a CFL team by team abbreviation N/A

TODO:

  1. Finish all examples
  2. Add a helper class for converting property ID to string. ie: Position ID > Position name
  3. Play-by-play

All versions of cfl-api-php with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ^6.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package christohill/cfl-api-php contains the following files

Loading the files please wait ....