<commit_before>h1. Basecamp API Wrapper for php 5.3+

This is a php library to access the 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.

h2. 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

h2. Requirements

* php 5.3+ (uses namespaces)
* Recent version of zend framework (tested with 1.10) > uses Zend_Http_Client & Zend_Log (optional)

h2. Getting Started

Please find plenty of working examples in the __basecamp/example/basecamp__ directory and adjust __basecamp/example/basecamp/_config.php__ with your own settings. Here's the basics:

h3. Setup

bc.. $config = array(
	'baseUri' => 'https://xxx.basecamphq.com',
	'username' => 'xxx',
	'password' => '<PASSWORD>'
);

require_once 'Sirprize/Basecamp.php';
$basecamp = new \Sirprize\Basecamp($config);

h3. Fetch all projects

bc.. $projects = $basecamp->getProjectsInstance()->startAll();

foreach($projects as $project)
{
	print $project->getName()."\n";
}

h3. Copy a project

bc.. /*
 *
 * populate the target-project with the milestones,
 * todo-lists and todo-items from the source-project
 *
 */

require_once 'Sirprize/Basecamp/Id.php';
$sourceProjectId = new \Sirprize\Basecamp\Id('xxx');
$targetProjectId = new \Sirprize\Basecamp\Id('yyy');

$projects = $basecamp->getProjectsInstance();
$sourceProject = $projects->startById($sourceProjectId);
$sourceProject->copy($targetProjectId);

h3. Replicate a project (push deadlines to a new date)

bc.. /*
 *
 * 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
 *
 */

require_once 'Sirprize/Basecamp/Id.php';
$sourceProjectId = new \Sirprize\Basecamp\Id('xxx');
$targetProjectId = new \Sirprize\Basecamp\Id('yyy');

$projects = $basecamp->getProjectsInstance();
$sourceProject = $projects->startById($sourceProjectId);

require_once 'Sirprize/Basecamp/Date.php';
$referenceDate = new \Sirprize\Basecamp\Date('2010-12-30');

require_once 'Sirprize/Basecamp/Schema/Export.php';
$referenceMilestone = \Sirprize\Basecamp\Schema\Export::REFERENCE_EXTREMITY_LAST;
$sourceProject->replicate($targetProjectId, $referenceDate, $referenceMilestone);

h3. Create a new milestone

bc.. $milestones = $basecamp->getMilestonesInstance();
$milestone = $milestones->getMilestoneInstance();

require_once 'Sirprize/Basecamp/Date.php';
$deadline = new \Sirprize\Basecamp\Date('2010-03-01');

require_once 'Sirprize/Basecamp/Id.php';
$projectId = new \Sirprize\Basecamp\Id('xxx');
$userId = new \Sirprize\Basecamp\Id('xxx');

$milestone
	->setProjectId($projectId)
	->setResponsiblePartyId($userId)
	->setDeadline($deadline)
	->setTitle('Milestoners Everywhere')
	->setWantsNotification(true)
	->create()
;

h2. Todo

* Account
* Companies
* Categories
* Messages
* Comments
* Time tracking<commit_msg>update documentation<commit_after>h1. Basecamp API Wrapper for php 5.3+

This is a php library to access the 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 the current activity to the terminal.

h2. 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

h2. Requirements

* php 5.3+ (uses namespaces)
* Recent version of zend framework (tested with 1.10) > uses Zend_Http_Client & Zend_Log (optional)

h2. Getting Started

Please find plenty of working examples in the __basecamp/example/basecamp__ directory and adjust __basecamp/example/basecamp/_config.php__ with your own settings. Here's the basics:

h3. Setup

bc.. $config = array(
	'baseUri' => 'https://xxx.basecamphq.com',
	'username' => 'xxx',
	'password' => '<PASSWORD>'
);

require_once 'Sirprize/Basecamp.php';
$basecamp = new \Sirprize\Basecamp($config);

h3. Fetch all projects

bc.. $projects = $basecamp->getProjectsInstance()->startAll();

foreach($projects as $project)
{
	print $project->getName()."\n";
}

h3. Copy a project

bc.. /*
 *
 * populate the target-project with the milestones,
 * todo-lists and todo-items from the source-project
 *
 */

require_once 'Sirprize/Basecamp/Id.php';
$sourceProjectId = new \Sirprize\Basecamp\Id('xxx');
$targetProjectId = new \Sirprize\Basecamp\Id('yyy');

$projects = $basecamp->getProjectsInstance();
$sourceProject = $projects->startById($sourceProjectId);
$sourceProject->copy($targetProjectId);

h3. Replicate a project (push deadlines to a new date)

bc.. /*
 *
 * 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
 *
 */

require_once 'Sirprize/Basecamp/Id.php';
$sourceProjectId = new \Sirprize\Basecamp\Id('xxx');
$targetProjectId = new \Sirprize\Basecamp\Id('yyy');

$projects = $basecamp->getProjectsInstance();
$sourceProject = $projects->startById($sourceProjectId);

require_once 'Sirprize/Basecamp/Date.php';
$referenceDate = new \Sirprize\Basecamp\Date('2010-12-30');

require_once 'Sirprize/Basecamp/Schema/Export.php';
$referenceMilestone = \Sirprize\Basecamp\Schema\Export::REFERENCE_EXTREMITY_LAST;
$sourceProject->replicate($targetProjectId, $referenceDate, $referenceMilestone);

h3. Create a new milestone

bc.. $milestones = $basecamp->getMilestonesInstance();
$milestone = $milestones->getMilestoneInstance();

require_once 'Sirprize/Basecamp/Date.php';
$deadline = new \Sirprize\Basecamp\Date('2010-03-01');

require_once 'Sirprize/Basecamp/Id.php';
$projectId = new \Sirprize\Basecamp\Id('xxx');
$userId = new \Sirprize\Basecamp\Id('xxx');

$milestone
	->setProjectId($projectId)
	->setResponsiblePartyId($userId)
	->setDeadline($deadline)
	->setTitle('Milestoners Everywhere')
	->setWantsNotification(true)
	->create()
;

h2. Todo

* Account
* Companies
* Categories
* Messages
* Comments
* Time tracking
{'fraction_non_alphanumeric': 0.13490843002935832, 'fraction_numerical': 0.011463721515448064, 'mean_word_length': 5.539305301645339, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 47, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2075076', 'n_tokens_mistral': 2339, 'n_tokens_neox': 2214, 'n_words': 626}