1. Go to this page and download the library: Download cervon/tms-php-client library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Cervon\Tms\Tms;
$CLIENT_ID = 'MY_CLIENT_ID';
$CLIENT_SECRET = 'MY_CLIENT_SECRET';
$TMS_BASE_URL = 'https://my-tms-url.com/'
$tms = new Tms($CLIENT_ID, $CLIENT_SECRET, $TMS_BASE_URL);
$authenticator = $tms->getAccessToken();
$tms = new Tms($CLIENT_ID, $CLIENT_SECRET, $TMS_BASE_URL, verifySsl: false);
use Cervon\Tms\Tms;
use Illuminate\Support\Facades\Cache;
$tms = new Tms($CLIENT_ID, $CLIENT_SECRET, $TMS_BASE_URL);
$authenticator = Cache::remember('tms_authenticator', 3600, function () use ($tms) {
// Fresh token when cache is empty
return $tms->getAccessToken();
});
// Refresh token when expired
if ($authenticator->hasExpired()) {
$authenticator = $tms->getAccessToken();
Cache::put('tms_authenticator', $authenticator, 3600);
}
$tms->authenticate($authenticator);
bash
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.