themewizz/twz-software-license-manager-library
Composer 安装命令:
composer require themewizz/twz-software-license-manager-library
包简介
This class can be used in a PHP application to contact a WordPress based license server.
README 文档
README
This class can be used in a PHP application to contact a WordPress based license server using the TWZ Software License Manager Plugin.
Usage
- Install WordPress on your license server
- Install the TWZ Software License Manager Plugin on that server
- Configure the plugin, e.g. setting the secret key for validation
- Include TWZ_License class in your PHP application
- Instantiate the class in your script, e.g.
$twz_license = new TWZ_License(); - Set the license server URL property, e.g.
$twz_license->setLicenseServerURL('5766474b540'); - Set the license server verification key property, e.g.
$twz_license->setVerificationKey('5766474b540'); - Set the license key property, e.g.
$twz_license->setLicenseKey('5766474b540'); - Load the details for that license from the license server, e.g.
$LIC->load(); - Use other methods as needed, e.g.:
$LIC->activate();$LIC->daysToExpiry();$LIC->deactivate();$LIC->domainRegistered();$LIC->getKey();$LIC->load();$LIC->readKey();$LIC->saveKey();$LIC->setKey('5766474b540');$LIC->show();$LIC->status();
$LIC->activate()
This method will sumbit the license key in $this->key to the license server for activation plus domain registration. Example:
$LIC->setKey('5766474b540'); $LIC->activate();
$LIC->daysToExpiry()
This method will count and return the number of days from 'today' to the expiry date of the license. Example:
$LIC->setKey('5766474b540'); $LIC->load(); echo $LIC->daysToExpiry();
$LIC->deactivate()
This method will sumbit the license key in $this->key to the license server for deactivation. Example:
$LIC->setKey('5766474b540'); $LIC->deactivate();
$LIC->domainRegistered()
This method will check whether the current domain is registered for the license. Example:
$LIC->setKey('5766474b540'); $LIC->load(); if ($LIC->domainRegistered()) { echo "Domain is registered"; else { echo "Domain is not registered"; }
$LIC->getKey()
This method will retrieve the class viarable 'key' that is supposed to hold the license key. Example:
$LIC->setKey('5766474b540'); echo $LIC->getKey();
$LIC->load()
This method will load the license details from the license server. Example:
$LIC->setKey('5766474b540'); $LIC->load();
$LIC->readKey()
This method is a placeholder for code you might want to add to read the license key from your own database.
$LIC->saveKey()
This method is a placeholder for code you might want to add to save the license key to your own database.
$LIC->setKey()
This method will set the class viarable 'key' that is supposed to hold the license key. Example:
$LIC->setKey('5766474b540');
$LIC->show()
This method assumes that you use Bootstrap 4 in your PHP application. It will display the license status in a Bootstrap 4 alert box. If you set the second parameter to 'true', a table with the license details will be shown as well inside that box. Example:
$LIC->setKey('5766474b540'); $LIC->load(); $LIC->show($LIC->details, true);
$LIC->status()
The status() method returns one of these these values:
- active (the license is active and registered for the domain the validation request came from)
- blocked (the license is blocked)
- expired (the license is expired)
- invalid (an empty or invalid license key was submitted)
- pending (the license is valid but not activated yet)
- unregisterd (the license is active but not registered for the domain the validation request came from) Example:
$LIC->setKey('5766474b540'); $LIC->load(); echo $LIC->status();
Credits
Thanks to Tips and Tricks HQ for the Software License Manager Plugin for WordPress
themewizz/twz-software-license-manager-library 适用场景与选型建议
themewizz/twz-software-license-manager-library 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 246 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 05 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「license」 「tracking」 「plugin usage」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 themewizz/twz-software-license-manager-library 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 themewizz/twz-software-license-manager-library 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 themewizz/twz-software-license-manager-library 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
CakePHP 4.x AdminLTE Theme.
HiDev plugin for license generation
PHP SDK for the Parcel Monkey UK API
Cpanel Licensing Class
Fantastico Licensing Class
Cloudlinux Licensing Class
统计信息
- 总下载量: 246
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2023-05-29