This package was created for a project I am working on and does not fully support random.org services (or the way you may want it to). Feel free to add functionality by creating a pull request. See contributing.
You can install the package via composer:
$ composer require basecardhero/randoms
You will need to configure the Random.org API Key.
require_once '/project/path/vendor/autoload.php';
$apiKey = '00000000-0000-0000-0000-0000000000';
$httpClient = new \BaseCardHero\Randoms\HttpClient();
$randomOrgClient = new \BaseCardHero\Randoms\RandomOrg\Client($apiKey, $httpClient);
$response = $randomOrgClient->generateSignedIntegers(5, 0, 4, false, 10, 'some-id');
echo get_class($response); // \Psr\Http\Message\ResponseInterface
You can get the json response with the following.
$json_response = json_decode((string) $response->getBody(), true);
See generateSignedIntegers for the respons structure.
$response = $randomOrgClient->getUsage('some-id');
echo get_class($response); // \Psr\Http\Message\ResponseInterface
You can get the json response with the following.
$json_response = json_decode((string) $response->getBody(), true);
See getUsage for the respons structure.
Before using the command line examples, be sure to set your api key.
export RANDOM_ORG_API_KEY=00000000-0000-0000-0000-0000000000
php bin/generate-signed-integers.php
php bin/get-usage.php
composer all
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
This package was generated using the PHP Package Boilerplate.