jellybool / po.et
Po.et PHP 集成
1.01
2018-02-13 06:47 UTC
Requires
- guzzlehttp/guzzle: ^6.3
This package is auto-updated.
Last update: 2024-09-19 06:05:27 UTC
README
使用方法
开始前请参考 frost:https://docs.frost.po.et/docs/getting-started
安装
composer require jellybool/po.et
方法
1.createWork
// You can get your apiToken from here: https://frost.po.et/token $poet = new \JellyBool\Poet\Client($apiToken); $work = $poet->createWork([ 'name' => 'PHP Poet', 'datePublished' => '2018-02-12T16:39:46+00:00', 'dateCreated' => '2018-02-12T14:39:46+00:00', 'author' => 'JellyBool', 'tags' => 'php', 'content' => 'Po.et PHP Integrations' ]);
它返回一个包含 workId
的 array
['workId' => '5e11b417b01f0db810d81f7a8f3cbdd13c9b876512a9f26dbd7d380573c700d0']
2.getWork
$poet = new \JellyBool\Poet\Client($apiToken); $work = $poet->getWork($workId);
它返回一个包含 work
详细信息的 array
[ 'name' => "PHP Poet" 'datePublished' => "2018-02-12T16:39:46+00:00" 'dateCreated' => "2018-02-12T14:39:46+00:00" 'author' => "JellyBool" 'tags' => "php" 'content' => "Po.et PHP Integrations" ];
3.getAllWorks
$poet = new \JellyBool\Poet\Client($apiToken); $work = $poet->getAllWorks();
它返回每个 work
详细信息的 array
集合
[ [ 'name' => "PHP Poet" 'datePublished' => "2018-02-12T16:39:46+00:00" 'dateCreated' => "2018-02-12T14:39:46+00:00" 'author' => "JellyBool" 'tags' => "php" 'content' => "Po.et PHP Integrations" ], [ 'name' => "PHP Poet 2" 'datePublished' => "2018-02-12T17:39:46+00:00" 'dateCreated' => "2018-02-12T15:39:46+00:00" 'author' => "JellyBool" 'tags' => "po.et" 'content' => "Po.et interactions with PHP" ], ];
许可证
MIT 许可证。