Download the PHP package dant89/smite-api-php-client without Composer

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

Smite logo

Smite API PHP Client

Latest Stable Version Github Issues

A lightweight PHP client for the Smite developer API.

Installation

To install, run composer require dant89/smite-api-php-client in the root of your project or add dant89/smite-api-php-client to your composer.json.

Smite developer API Documentation

To read more about how the Smite developer API functions, please read the official documentation.

Smite developer API Access

The Smite developer API requires that you first complete this form to apply for credentials.

If your application is accepted you will receive custom credentials to access the API.

  • Smite

Usage

Use your provided DevId and AuthKey upon instantiation of this client.

To begin using the API, you will first need to establish a valid Session. To do so you will start a session (via the createsession method) and receive a SessionId. Sessions are used for authentication, security, monitoring, and throttling. Once you obtain a SessionId, you will pass it to other methods for authentication. Each session only lasts for 15 minutes and must be recreated afterward.

  • Smite

Now that you have a $sessionId you are free to make calls to the other client methods. This client takes care of signing the requests so you don't need to worry about that and can now make calls to other methods, for example to get a teams (clans) players, you would use:

Rate Limiting / Caching Suggestion

I recommend that you implement some sort of caching of your $sessionId and / or returned data, the Smite developer API has rate limits so caching will help you avoid going over those limits:

Default limits:

concurrent_sessions: 50
sessions_per_day: 500
session_time_limit: 15 minutes
request_day_limit: 7500

Helpers

languageCode values:

Tests

You can test your API key by running the PHPUnit tests included in this client.

At present there is no rate limiting or caching so a run through will use 7 of your daily sessions (this is not ideal).

PHPUnit tests:

  1. Add your devId and authKey to tests/Helper/ClientTestCase.php
  2. php vendor/phpunit/phpunit/phpunit tests

PHP CodeSniffer:

PHP MessDetector

Contributions

Contributions to the client are welcome, to contribute please:

  1. Fork this repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a new pull request

All versions of smite-api-php-client with dependencies

PHP Build Version
Package Version
Requires symfony/http-client Version ^5.0
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 dant89/smite-api-php-client contains the following files

Loading the files please wait ....