Download the PHP package mwgg/iracing-php without Composer
On this page you can find all versions of the php package mwgg/iracing-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package iracing-php
iracing-php
iRacing Data API wrapper for PHP. API documentation and additional information can be found on the iRacing Forums.
Basic usage
Install with composer:
The names of all API services and methods match their API endpoints.
API Documentation excerpt:
iRacingPHP:
Note that the cust_id
parameter is optional in this case, thus may be omitted. All parameters that are denoted as required by the API documentation must be passed as separate parameters to the API method, optional parameters are grouped into a separate array parameter. This makes it easier to deal with methods that have a large number of optional parameters.
API Documentation excerpt:
iRacingPHP:
Rate Limits
After making a request it is possible to check current rate limit values.
Note that these rate limit values will update after all requests, except the $iracing->constants->
endpoints, since those are retrieved locally.
Cookies
iRacingPHP makes use of cookies to persist authentication between requests and executions. By default, cookies are stored in /tmp/iracingphpcookie
.
If you wish to change the location of the cookie file, you may do so when instantiating the iRacing object:
As long as the same path is used across all requests and executions, authentication will persist.
Exceptions
iRacingPHP throws the following exceptions:
iRacingPHP\Exceptions\ApiServiceNotFoundException
is thrown when attempting to access a non-existent API service.
iRacingPHP\Exceptions\AuthenticationRequestFailedException
is thrown when authentication request fails for any reason.
iRacingPHP\Exceptions\AuthenticationFailedException
is thrown when the authentication HTTP request succeeded but authentication did not happen (wrong username or password, etc).
iRacingPHP\Exceptions\RequestFailedException
is thrown when the API endpoint request fails.
iRacingPHP\Exceptions\DataRequestFailedException
is thrown when a request to retrieve cached data fails.
iRacingPHP\Exceptions\RequestRateLimitedException
is thrown when a request failed due to rate limiting.
iRacingPHP\Exceptions\SiteMaintenanceException
is thrown when iRacing services are down for maintenance.
In all cases you can view the error message using $e->getMessage();
In all cases but the iRacingPHP\Exceptions\ApiServiceNotFoundException
exception, the parent Guzzle exception is chained with the iRacingPHP exception.