Method: Soft Validate - 10quality/license-keys-php-client GitHub Wiki
License string validation method. This method doesn't call any API endpoint, it validates the license based on a given string.
Call and parameters
$isValid = Api::softValidate($getClosure);
Parameters
Parameter | Type | Description |
---|---|---|
$getClosure | Closure (callable on php5) |
A function that should return an instance of LicenseRequest . |
Returns
Type | Description |
---|---|
bool |
Flag indicating if the license key is valid or not. |
Usage
The following example will show how to validate an activated license key.
$isValid = Api::softValidate(
function() {
// ---------------------------------------------
// Code here...
// Code to load the LICENSE STRING saved on activation.
// Apply decryption if necessary.
// ---------------------------------------------
// MUST RETURN AN INSTANCE OF LicenseRequest
return new LicenseRequest($licenseString);
} // getClosure
);