Download the PHP package trackbasenet/dev-api without Composer

On this page you can find all versions of the php package trackbasenet/dev-api. 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 dev-api

TrackBase Developers API Library

TrackBase is hosting own APIs for developers amongst its users and for clans that want to depict TrackBase data in their very own way without having to use iframes or such. Users that have registered on the Developers Platform could already query our several APIs in any programming language they like, or through standard cURL requests. With this package, TrackBase wants to give an easier entry into gathering information from its servers, without the need of knowing how to code. All it takes for a standard request to our API is two lines of code.

Please make sure that you are registered as a developer in the first place and read through our API docs for a better idea of how we are returning information and what parameters you need to supply. Additionally, and most importantly, check out the How To Use section in this document further down.

Installation

Composer

The recommended path to installing and using our library is to use Composer.

Execute the following line of code in your terminal to install our library into your project:

Alternatively you can also add our library to your project through the composer.json file like so:

Eventually you would want to install our library through the following line executed in your terminal:

ZIP Download

If you are unfamiliar with or do not want to use Composer, you could also download the latest ZIP archive and include the src/autoload.php file. This bypasses the version system and downloads the code up to the latest commit.

Eventually you will need to require_once the autoloader like this:

How To Use

Instantiation

Before running any methods, you will need to instantiate the TrackBaseApi class and supply the necessary credentials that are required to query our APIs.

While $options currently only supports setting a game, to which you want to make query requests. Currently, only et is available. This means, you do not need to supply the $options array.

Available Methods

After you have instantiated your TrackBaseApi class, you can run any supported method directly on this object. Following methods are supported:

ranklist

toplist

clanRanklist

clanToplist

playerInfo

playerServers

playerSessions

clanInfo

serverInfo

serverSessions

serverUsage

userInfo

getUser

connectUser

collectNewUser

Global Methods

Some methods are global and can be called on any api method.

countResults

This method returns the amount of rows being returned. In some cases this might not be the expected figure. For more details, please check the API docs.

firstResult

This method returns the first result of the result set. If there are no results, or the query returned an error, NULL will be returned.

getResults

This method returns the whole result set. If there are no results, or the query returned an error, an empty [] array will be returned.

getStatusCode

This method returns the status code that is returned with any query. 200 signals a good query.

getMessage

This method returns the message that is returned with any query. It will be empty if there are errors returned.

getError

This method returns the error message that is returned with any query. It will be empty if there are no errors returned.

getErrorCode

This method returns the error code. This is extremely helpful for debugging purposes or when contacting us with an issue. For more details check the getError method.

hasErrors

This method returns whether or not errors were returned. It can be used to see easily if the query was successful. For further checks you might want to use the countResults method.

Examples

Receiving the TOP 10 players of the TSP ranklist

or quicker:

Receiving the last 5 sessions played on a server

Receiving and showing a specific player name in HTML format

Listening on TrackBase return calls with new user information

Fetching user information

or quicker:

Support

If you have questions or found an issue regarding this library, feel free to open an issue, visit our forums, join our Discord server or write us an email. Thank you for your help!

Donating

If you value our work and want to help paying our servers, please consider donating. You will receive a nice gift from us in return!


All versions of dev-api with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
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 trackbasenet/dev-api contains the following files

Loading the files please wait ....