sirprize/basecamp
Composer 安装命令:
composer require sirprize/basecamp
包简介
Basecamp Classic API Wrapper for PHP 5.3+
README 文档
README
This is a php library to access the classic Basecamp API. Collection classes provide methods to query the api and wrap each result item in an entity object. Entity objects come with methods such as update() and delete() to persist themselfes via the api. Functionality is provided to attach and detach observers to collections and entities – this is useful for logging or to print current activity to the terminal.
Supported Features
- Person: startMe(), startById(), startAllByProjectId(), startAll() etc
- Project: startById(), startAll(), copy(), replicate() etc
- Milestone: startAllByProjectId(), create(), update(), delete(), complete(), uncomplete() etc
- Todolist: startById(), startAllByProjectId(), startAllByResponsibiltyParty(), create(), update(), delete() etc
- Todoitems: startAllByTodoListId(), startById(), create(), update(), delete(), complete(), uncomplete() etc
- Comments: startAllByResourceId(), startById()
- Timetracking: startAllByProjectId(), startById()
Requirements
- php 5.3+ (uses namespaces)
Getting Started
Please find plenty of working examples in the basecamp/example/basecamp directory. Here’s the basics:
First Steps
- git clone git://github.com/sirprize/basecamp.git sirprize-basecamp
- cd sirprize-basecamp
- curl -sS https://getcomposer.org/installer | php
- php composer.phar install
- create a dummy project in your basecamp account
- adjust sirprize-basecamp/example/basecamp/_config.php with your own settings
- make files executable in sirprize-basecamp/example/basecamp/(milestone|person|project|todoitem|todolist)/*
- make writeable sirprize-basecamp/example/_logs
- run examples
Setup
use Sirprize\Basecamp\Service;$config = array( 'baseUri' => 'https://xxx.basecamphq.com', 'username' => 'xxx', 'password' => 'xxx' );$service = new Service($config);
Fetch all projects
$projects = $service->getProjectsInstance()->startAll();foreach($projects as $project) { print $project->getName()."\n"; }
Copy a project
use Sirprize\Basecamp\Id;/* * * populate the target-project with the milestones, * todo-lists and todo-items from the source-project * */$sourceProjectId = new Id('xxx'); $targetProjectId = new Id('yyy');$projects = $service->getProjectsInstance(); $sourceProject = $projects->startById($sourceProjectId); $sourceProject->copy($targetProjectId);
Replicate a project (push deadlines to a new date)
use Sirprize\Basecamp\Id; use Sirprize\Basecamp\Date; use Sirprize\Basecamp\Schema\Export;/* * * populate the target-project with the milestones, * todo-lists and todo-items from the source-project. * the last milestone deadline is pushed to 2010-12-30 and * all other deadlines will be calculated relative to it * */$sourceProjectId = new Id('xxx'); $targetProjectId = new Id('yyy');$projects = $service->getProjectsInstance(); $sourceProject = $projects->startById($sourceProjectId); $referenceDate = new Date('2010-12-30'); $referenceMilestone = Export::REFERENCE_EXTREMITY_LAST; $sourceProject->replicate($targetProjectId, $referenceDate, $referenceMilestone);
Create a new milestone
use Sirprize\Basecamp\Id; use Sirprize\Basecamp\Date;$milestones = $service->getMilestonesInstance(); $milestone = $milestones->getMilestoneInstance(); $deadline = new Date('2010-03-01'); $projectId = new Id('xxx'); $userId = new Id('xxx');$milestone ->setProjectId($projectId) ->setResponsiblePartyId($userId) ->setDeadline($deadline) ->setTitle('Milestoners Everywhere') ->setWantsNotification(true) ->create() ;
Todo
- Account
- Companies
- Categories
- Messages
- Comments: create(), update(), delete()
- Time tracking: startAllByTodoItemId(), create(), update(), delete()
Contributors
sirprize/basecamp 适用场景与选型建议
sirprize/basecamp 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 282 次下载、GitHub Stars 达 66, 最近一次更新时间为 2012 年 07 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「basecamp」 「basecamp classic」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 sirprize/basecamp 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 sirprize/basecamp 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 sirprize/basecamp 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Basecamp OAuth 2.0 Client Provider for The PHP League OAuth2-Client
This is the Classic invoice skin for the Nails Invoice & Payments module
A PSR-7 compatible library for making CRUD API endpoints
Basecamp OAuth 2.0 Client Provider for The PHP League OAuth2-Client
Installs the TinyMCE plugin loader and the missing default plugins known from TinyMCE 3 (anchor, colorpicker, emoticons, textcolor).
Special TinyMCE setup which creates the toolbars known from TinyMCE 3.
统计信息
- 总下载量: 282
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 66
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2012-07-17