定制 ahead4/licensing 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

ahead4/licensing

Composer 安装命令:

composer require ahead4/licensing

包简介

A package to assist with the generation and validation of license keys.

README 文档

README

Creating a new keypair.

Before you're able to create a license, you must create a private and public keypair. The private key should be kept in secure storage and should only be used to generate new licenses. The public key will need to be generated alongside the license key in order to perform verification on the license data.

<?php

$licensing = new \Ahead4\Licensing\Licensing;
$licensing->createKeypair('/path/to/store/private.key', '/path/to/store/public.key');

?>

Creating a license.

A license is a simple array of data, which gets signed by the private key you previously created. This signature is then embedded into the license to allow you to verify it later to ensure the license has not been modified or tampered with in any way.

<?php

$licensing = new \Ahead4\Licensing\Licensing;
$data = [
	'licensee' => [
		'name' => 'Joe Bloggs',
	],
	'features' => [
		'gallery',
		'shop',
	],
];
$license = $licensing->createLicense($data, '/path/to/private.key');

?>

Verifying a license.

A license can be verified by providing the path to the license and the path to the public key.

<?php

$licensing = new \Ahead4\Licensing\Licensing;
$verified = $licensing->verifyLicense('/path/to/license.txt', '/path/to/public.key');

?>

Getting the data from a license.

In most cases you will simply want to get back the original array of data that you created the license with. NOTE: You do not need to verify the license before calling this method as it will automatically perform this check and will instead return null if the license is invalid.

<?php

$licensing = new \Ahead4\Licensing\Licensing;
$data = $licensing->getLicenseData('/path/to/license.txt', '/path/to/public.key');

?>

ahead4/licensing 适用场景与选型建议

ahead4/licensing 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 13.35k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2016 年 02 月 09 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 ahead4/licensing 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 ahead4/licensing 我们能提供哪些服务?
定制开发 / 二次开发

基于 ahead4/licensing 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 13.35k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 21
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 5
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2016-02-09