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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

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

PHP Build Version
Package Version
Requires php Version >=8.0
ext-curl Version *
ext-json Version *
ext-openssl Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package permitcore/sdk contains the following files

Loading the files please wait ...