1. Go to this page and download the library: Download licensetorun/php-sdk 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/ */
licensetorun / php-sdk example snippets
use Licensetorun\LicenseSdk\LicenseClient;
$license = new LicenseClient([
'api_base' => 'https://licensetorun.com',
'product_id' => 'PRODUCT-PUBLIC-UUID', // from the product page in the dashboard
'license_key' => 'CUSTOMER-KEY',
'instance' => 'customer-instance', // optional — defaults to gethostname()
]);
// Activate once (consumes a seat):
$result = $license->activate();
if ($result->failed()) {
exit('Activation failed: ' . $result->message());
}
// Gate a feature:
if ($license->isValid()) {
// ...licensed feature...
}
// Inspect the full result:
$result = $license->validate();
$result->ok(); // bool
$result->error(); // e.g. "license_expired", "ip_not_allowed"
$result->get('license.status');// dot-access into the response