pete001/frost-php-sdk
Composer 安装命令:
composer require pete001/frost-php-sdk
包简介
PHP SDK for the Poet Frost API
README 文档
README
You think blockchain is cool? Check √
You're a techie publisher who wants to stamp and protect their work? Check √
You think Po.et is the most awesome platform to do this on? Check √
You ignore the haters, and pursue your love for sweet fresh PHP 7? Check √
Well alright then, sounds like you're in the right place!
Background
You already passed the check test, so all you need are the official docs.
Installing
composer require pete001/frost-php-sdk
Configuration
Dont check in dat private key yo, use the dot env!
Sign up and fetch your API key from here.
Add it to the .env in the project root.
Usage
Because i like xmas, i made a simple factory to save time:
$api = (new FrostFactory)->api();
So far there are 3 juicy methods:
Create Work
$work = $api->createWork([ 'name' => 'I am a pickle', 'datePublished' => '2018-02-15T20:12:01+00:00', 'dateCreated' => '2018-02-14T19:50:21+00:00', 'author' => 'Pickle Rick', 'tags' => 'pickle rick morty unimpressed', 'content' => 'Rick tells Morty to come to the garage, and Morty discovers that Rick has turned himself into a pickle but is unimpressed.' ]); print_r($work); Array ( [workId] => 46b6144b7fc6825caa3cf4b83149226f8d3f7bc0b20e6780c5d80423d1a5b86a )
Get Work
$work = $api->getWorkById('46b6144b7fc6825caa3cf4b83149226f8d3f7bc0b20e6780c5d80423d1a5b86a'); print_r($work); Array ( [name] => I am a pickle [datePublished] => 2018-02-15T20:12:01+00:00 [dateCreated] => 2018-02-14T19:50:21+00:00 [author] => Pickle Rick [tags] => pickle rick morty unimpressed [content] => Rick tells Morty to come to the garage, and Morty discovers that Rick has turned himself into a pickle but is unimpressed. )
Get All Works
$work = $api->getWorks(); print_r($work); Array ( [0] => Array ( [name] => I am a pickle [datePublished] => 2018-02-15T20:12:01+00:00 [dateCreated] => 2018-02-14T19:50:21+00:00 [author] => Pickle Rick [tags] => pickle rick morty unimpressed [content] => Rick tells Morty to come to the garage, and Morty discovers that Rick has turned himself into a pickle but is unimpressed. ) [1] => Array ( [name] => I am still a pickle [datePublished] => 2018-02-15T21:12:01+00:00 [dateCreated] => 2018-02-14T20:50:21+00:00 [author] => Pickle Rick [tags] => pickle rick morty unimpressed repetitive [content] => Rick tells Morty once again, to come to the garage, and Morty discovers that Rick is still a pickle. He remains unimpressed. ) )
Tests
Project has 100% test coverage, but due to my hipster nature, the CI is run over at Gitlab. So you'll just have to take my word for it.
To run the test suites, simply execute:
vendor/bin/phpunit
If you wanna get fancy and check code coverage:
vendor/bin/phpunit --coverage-html tests/coverage
If you're as OCD as i am, you might wanna run some static analysis:
vendor/bin/phpmetrics --report-html="tests/static" .
Contributing
All contributions are welcome! Just fire up a PR and pinky swear the code passes the tests, has new tests written to maintain 100% coverage and make sure its PSR-2 compliant:
vendor/bin/php-cs-fixer fix --verbose
License
As tempting as it is to troll the world by centralising the distribution of an app for the decentralised world... This is free, free for all!
MIT License
pete001/frost-php-sdk 适用场景与选型建议
pete001/frost-php-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 02 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「api」 「sdk」 「crypto」 「blockchain」 「poet」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 pete001/frost-php-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 pete001/frost-php-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 pete001/frost-php-sdk 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PSR-7 compatible library for making CRUD API endpoints
Alfabank REST API integration
Zero-dependency raw PHP DNS resolver, domain-ownership verification, and intoDNS/MxToolbox-style diagnostics. Queries authoritative nameservers directly over sockets — never trusts the recursive cache for ownership checks.
A lightweight plain-PHP framework for database-backed CRUD APIs.
bughq error tracking - PHP SDK
ABsurge PHP SDK for feature flags and A/B testing
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-02-15