1. Go to this page and download the library: Download raise-studio/license-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/ */
raise-studio / license-client example snippets
use RaiseStudio\License\LicenseClient;
use RaiseStudio\License\FeatureGate;
use RaiseStudio\License\Adapters\Laravel\LaravelCache;
use RaiseStudio\License\Adapters\Laravel\LaravelHttp;
// Laravel ServiceProvider 中注册
$this->app->singleton(LicenseClient::class, function () {
$config =
if ($gate->canUse('pipeline')) { /* Pro 功能 */ }
use RaiseStudio\License\LicenseClient;
use RaiseStudio\License\FeatureGate;
use RaiseStudio\License\Adapters\WordPress\WordPressCache;
use RaiseStudio\License\Adapters\WordPress\WordPressHttp;
$client = new LicenseClient(
productCode: 'raise-import',
publicKeyBase64: 'YOUR_PUBLIC_KEY_BASE64',
cache: new WordPressCache(),
http: new WordPressHttp(),
);
$gate = new FeatureGate($client);
$gate->setFreeFeatures(['basic_import', 'csv_support']);
$gate->setAllProFeatures(['pipeline', 'advanced_mapping', 'queue']);
if ($gate->canUse('pipeline')) {
// Pro 功能
}
use RaiseStudio\License\LicenseClient;
use RaiseStudio\License\Adapters\Native\FileCache;
use RaiseStudio\License\Adapters\Native\CurlHttp;
$client = new LicenseClient(
productCode: 'raise-import',
publicKeyBase64: 'YOUR_PUBLIC_KEY_BASE64',
cache: new FileCache(),
http: new CurlHttp(),
siteUrl: 'https://example.com', // 显式指定站点 URL
);
use RaiseStudio\License\Contracts\CacheInterface;
use RaiseStudio\License\Contracts\HttpClientInterface;
use RaiseStudio\License\Contracts\HttpClientResponse;
// 自定义 Redis 缓存
class RedisCache implements CacheInterface { /* ... */ }
// 自定义 Guzzle HTTP
class GuzzleHttp implements HttpClientInterface { /* ... */ }
$client = new LicenseClient(
productCode: 'my-product',
publicKeyBase64: '...',
cache: new RedisCache(),
http: new GuzzleHttp(),
);