承接 licensetorun/php-sdk 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

licensetorun/php-sdk

Composer 安装命令:

composer require licensetorun/php-sdk

包简介

Framework-agnostic PHP SDK for Licensetorun.com — activate, validate, swap and check updates for your licensed product. Zero dependencies.

README 文档

README

A framework-agnostic PHP client for Licensetorun.com. Zero dependencies — just PHP 8.0+, cURL and JSON. Use it in plain PHP, Symfony, Slim, a CLI, or anywhere you don't have the Laravel package.

Install

composer require licensetorun/php-sdk

Or vendor it without Composer — the SDK is two files:

require __DIR__ . '/src/LicenseResult.php';
require __DIR__ . '/src/LicenseClient.php';

Usage

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

Move a seat to a new server

$license->swap('old-server.com', 'new-server.com');

Check for updates

$update = $license->checkForUpdate('1.2.0');
if ($update->get('update_available')) {
    $downloadUrl = $update->get('download_url'); // short-lived signed URL
}

Notes

  • Every method returns a LicenseResult and never throws on HTTP/network errors — a failed request comes back as error() === 'network_error'.
  • validate() is not cached here (unlike the Laravel package). Call it on a schedule or cache the result yourself (e.g. for a few hours) if you check on every request, so you don't hit the API each time.

MIT licensed.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固