droogle / gci-php
Google Code-in API 任务管理
1.0.4
2018-10-22 16:21 UTC
Requires
- guzzlehttp/guzzle: ^6.2
README
此API可用于访问Google Code-in的Task API,以请求、更新和修改任务定义。
Drupal
此工具由Drupal社区维护。特别感谢Shitiz Garg创建了此SDK。
安装
库可以通过composer安装,使用composer require droogle/gci-php
或将droogle/gci-php
添加到您的composer依赖项
示例
这是通过API处理任务的简化示例
$client = new Droogle\GCI\Client('<api key>'); $taskList = $client->getTasks(2); // Get tasks from second page foreach ($taskList as $task) { echo $task->getId() . ' ' . $task->getName(); // See src/TaskInterface.php for full function list } $nextPage = $taskList->getNextPage(); // Get the details of a single task $id = 123; // Task ID $task = $client->getTask($id); echo $task->getDescription(); // Create a new task $task = new Droogle\GCI\Task([ 'name' => 'Test task', 'description' => 'Adding a new task', 'status' => Droogle\GCI\TaskInterface::STATUS_DRAFTED, ... ]); $client->createTask($task);
许可证
MIT许可证(见LICENSE)