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

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

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

vasyaxy/php-trello-api

Composer 安装命令:

composer require vasyaxy/php-trello-api

包简介

Trello API v2 client

关键字:

README 文档

README

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
  • Tested in Symfony 6.2

Requirements

"require": {
	"php": ">=8.0",
	"symfony/event-dispatcher": "*",
	"league/oauth1-client": "*",
	"guzzlehttp/guzzle": "*"
},

Installation

The recommended way is using composer:

$ composer require vasyaxy/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.

Make Auth URL

<?php

namespace App;

use Trello\Client;

class TrelloApi
{
    public Client|null $client;

    public function __construct()
    {
        $this->client = new Client();
    }
    
    public function setupTrelloClient(): void
    {
        $this->client->authenticate(
            'API_KEY',                            // Api key - get from https://dashboard.stripe.com/test/apikeys7
            'USER_TOKEN (empty)',                 // Empty for this exampe
            Client::AUTH_URL_CLIENT_ID            // nvm
        );
    }

    public function getAuthUrl(): string
    {
        $this->setupTrelloClient();

        return $this->client->getAuthUrl([
            'key' => 'API_KEY',                   // Api key - get from https://trello.com/power-ups/admin - NEW - get key
            'secret' => 'API_SECRET',             // ^^^ "Reveal test key"
            'callbackUrl' => '!!CALL_BACK_URL!!', // example: 'http://mymegatite.com/trello-hook/'
            'name' => 'My Mega Trello App!!!1',   // nvm
            'expiration' => 'never',              // >> MH <<
            'scope' => 'read,write',              // >> MH <<
        ]);
    }
}

Basic usage

use Trello\Client;

$client = new Client();
$client->authenticate('API_KEY', 'USER_KEY', 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', 'USER_KEY', 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', 'USER_KEY', 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

vasyaxy/php-trello-api 适用场景与选型建议

vasyaxy/php-trello-api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 102 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 02 月 28 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「trello」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

围绕 vasyaxy/php-trello-api 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 102
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 11
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 114
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-02-28