Download the PHP package permitcore/sdk without Composer
On this page you can find all versions of the php package permitcore/sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download permitcore/sdk
More information about permitcore/sdk
Files in permitcore/sdk
Package sdk
Short Description Official PHP client for PermitCore license management. Validate and activate license keys with built-in hardware fingerprinting and offline grace period caching.
License MIT
Homepage https://permitcore.dev
Informations about the package sdk
PermitCore PHP SDK
Official PHP client for PermitCore license management.
Requirements: PHP 8.0+, ext-curl, ext-json, ext-openssl (present on effectively every standard PHP installation — needed for offline license token verification)
Installation
Or install from source ZIP:
Quick start
Validate
Validate never consumes an activation slot. It falls back to the local disk cache when the server is unreachable, as long as the license has offlineGraceDays configured.
Activate
Call activate() once per installation. Use validate() on every subsequent launch.
Product scoping (added 1.1.0)
validate()/activate() find a key purely by the key itself — by default, any active key
belonging to your tenant validates successfully, regardless of which of your products it was
actually issued for. If your app should only accept keys issued for this product, either check
$result->productId yourself, or pass expectedProductId and let the server reject a mismatch
for you ($result->errorCode === 'WrongProduct'). Find your product's ID in the Admin panel
under Products (or on a license's own detail page).
expectedProductId is entirely optional on both validate() and activate() — omit it and
nothing changes from prior versions. $result->productId is populated on every successful
lookup regardless of whether expectedProductId was passed, so existing callers can start
checking it themselves without touching the request side at all.
Meter (usage events)
Returns true if the event was recorded on the server.
Floating licenses
Offline license tokens
An offline activation token (pc_offline_v1.<payload>.<signature>) lets your app verify a
license with zero network calls, using ECDSA P-256 signature verification against your
tenant's public key (GET /api/v1/{tenantSlug}/public-key). Useful for air-gapped or
intermittently-connected deployments.
All four methods return an array shaped ['isValid' => bool, 'message' => string, ...] — on
a valid token, the payload fields (tokenId, tenantSlug, tenantId, licenseId,
licenseKeyHash, deviceId, deviceName, productName, maxActivations, issuedAt,
expiresAt) are merged in alongside isValid/message. verifyOfflineToken() and
validateOffline() never throw — malformed, tampered, expired, or missing input all come
back as isValid = false with a descriptive message.
activateOffline()'s local cache is stored in sys_get_temp_dir() as
.permitcore_offline_<hash> (same convention as the validate()/activate() cache, keyed
by device ID instead of license key).
Version enforcement
Offline grace pattern
The cache is stored in sys_get_temp_dir() as .permitcore_cache_<hash>. It expires after offlineGraceDays days.
Constructor options
LicenseResult reference
| Property | Type | Description |
|---|---|---|
isValid |
bool |
True if the license is active and valid |
productName |
?string |
Product the license belongs to |
remainingActivations |
?int |
Slots left before MaxActivations is reached |
expiresAt |
?string |
Expiry date (ISO 8601 UTC), null if perpetual |
features |
?array |
Feature flag list, e.g. ['export','api'] |
isTrial |
bool |
True for trial licenses |
trialDaysRemaining |
?int |
Days until trial expires |
nodeLocked |
bool |
True if bound to a specific device |
offlineGraceDays |
?int |
How many days the cache is valid |
minVersion |
?string |
Minimum app version allowed |
maxVersion |
?string |
Maximum app version allowed |
vendorWarning |
?string |
Non-fatal message from the vendor |
message |
?string |
Reason when isValid = false |
isOffline |
bool |
True when result came from local cache |
errorCode |
?string |
Stable, machine-readable failure reason (e.g. "WrongProduct"), null on success |
productId |
?string |
The license's real product GUID — always present when the key was found, regardless of whether expectedProductId was passed |
hasFeature(string $feature): bool — case-insensitive feature check.
All versions of sdk with dependencies
ext-curl Version *
ext-json Version *
ext-openssl Version *