matteocacciola/php-trello-api 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

matteocacciola/php-trello-api

最新稳定版本:2.0.0

Composer 安装命令:

composer require matteocacciola/php-trello-api

包简介

Trello API v2 client

关键字:

README 文档

README

Build Status Code Coverage Code Quality Packagist

A simple Object Oriented wrapper for the Trello API, written in PHP7.4.

Uses Trello API v1. The object API is very similar to the RESTful API.

Features

  • Follows PSR-0 conventions and coding standards: autoload friendly
  • Light and fast thanks to lazy loading of API classes
  • Extensively tested
  • Ready for Symfony 5

Requirements

  • PHP >= 7.4 with cURL extension,
  • Guzzle 5.3 library,
  • (optional) PHPUnit to run tests.

Installation

The recommended way is using composer:

$ composer require matteocacciola/php-trello-api

However, php-trello-api follows the PSR-0 naming conventions, which means you can easily integrate php-trello-api class loading in your own autoloader.

Basic usage

use Trello\Client;

$client = new Client();
$client->authenticate('api_key', 'token', Client::AUTH_URL_CLIENT_ID);

$boards = $client->api('member')->boards()->all();

The $client object gives you access to the entire Trello API.

Advanced usage with the Trello manager

This package includes a simple model layer above the API with a nice chainable API allowing following manipulation of Trello objects:

use Trello\Client;
use Trello\Manager;

$client = new Client();
$client->authenticate('api_key', 'token', Client::AUTH_URL_CLIENT_ID);

$manager = new Manager($client);

$card = $manager->getCard('547440ad3f8b882bc11f0497');

$card
    ->setName('Test card')
    ->setDescription('Test description')
    ->save();

Dispatching Trello events to your app

The service uses the Symfony EventDispatcher component to dispatch events occuring on incoming webhooks.

Take a look at the Events class constants for names and associated event classes.

use Trello\Client;
use Trello\Service;
use Trello\Events;

$client = new Client();
$client->authenticate('api_key', 'token', Client::AUTH_URL_CLIENT_ID);

$service = new Service($client);

// Bind a callable to a given event...
$service->addListener(Events::BOARD_UPDATE, function ($event) {
    $board = $event->getBoard();

    // do something
});

// Check if the current request was made by a Trello webhook
// This will dispatch any Trello event to listeners defined above
$service->handleWebhook();

Documentation

Contributing

Feel free to make any comments, file issues or make pull requests.

License

php-trello-api is licensed under the MIT License - see the LICENSE file for details

Credits

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 120
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-12-09