PHPackages                             mtymek/codebasehq-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. mtymek/codebasehq-sdk

ActiveLibrary[API Development](/categories/api)

mtymek/codebasehq-sdk
=====================

PHP SDK for CodebaseHQ API

81.9k2[2 issues](https://github.com/mtymek/codebasehq-sdk/issues)PHP

Since Aug 18Pushed 12y ago4 watchersCompare

[ Source](https://github.com/mtymek/codebasehq-sdk)[ Packagist](https://packagist.org/packages/mtymek/codebasehq-sdk)[ RSS](/packages/mtymek-codebasehq-sdk/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

PHP SDK for CodebaseHQ API
==========================

[](#php-sdk-for-codebasehq-api)

[CodebaseHQ](http://www.codebasehq.com/) is software project management tool with Git, Mercurial and Subversion hosting, bug and time tracking, and more.

Installation
------------

[](#installation)

This package can be installed using Composer:

```
{
    "minimum-stability": "dev",
    "require": {
        "mtymek/codebasehq-sdk": "dev-master"
    }
}
```

Usage
-----

[](#usage)

Please refer to [this document](http://support.codebasehq.com/kb/api-documentation) for general information about CodebaseHQ API.

First, you need to create API client, and pass your account, username and API key:

```
$client = new CodebaseHq\Api('someaccount', 'mtymek', '85j9axug8r2mb42ao5rf59nrpstesdujbj05x2ih');
```

### Example: listing tickets

[](#example-listing-tickets)

Tickets are related organized in projects, so you need to begin with setting project name:

```
$client->setProject('project_name');
```

Now you're allowed to find tickets matching given query:

```
// list all closed tickets for current user
$tickets = $client->tickets()->find('assignee:me status:closed');
```

Above code will return array of `CodebaseHq\Entity\Ticket` objects.

You can also fetch single ticket:

```
$ticket = $client->tickets()->findOneById(124);
```

### XML API

[](#xml-api)

At this moment object interface supports only subset of Codebase HQ API. You can also access it directly, using low-level calls that work on XML data:

```
// Example: listing all assigned tickets
$result = $api->api('/mats-playground/tickets?query=' . urlencode('assignee:me'));
$xml = new SimpleXMLElement($result);
foreach ($xml->ticket as $ticket) {
    echo $ticket->{'ticket-id'} . ': ' . $ticket->summary, "\n";
}

// Example: tracking time session
$xml =
'
    Worked on the awesome feature
    60:00
';
$api->api('/mats-playground/time_sessions', 'POST', $xml);
```

You can avoid passing XML directly by using `buildXml()` helper method:

```
// Example: ticket update
$ticketNote = array(
    'content' => 'Lorem Ipsum dolor sit amet.',
    'time-added' => '1:00'
);
$result = $api->api(
                '/mats-playground/tickets/263/notes',
                'POST',
                $api->buildXml('ticket-note', $ticketNote)
        );
```

TODO
----

[](#todo)

- basic, low-level API access \[IMPLEMENTED\]
- nice, object-oriented interface for accessing all types of records defined by CodebaseHQ API \[IN PROGRESS\]

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 77.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/f6c602b2763105f372ab3b806222f75b1872931a3451e8192c43d22287fde726?d=identicon)[mtymek](/maintainers/mtymek)

---

Top Contributors

[![mtymek](https://avatars.githubusercontent.com/u/777893?v=4)](https://github.com/mtymek "mtymek (27 commits)")[![2bard](https://avatars.githubusercontent.com/u/457277?v=4)](https://github.com/2bard "2bard (5 commits)")[![sambernard](https://avatars.githubusercontent.com/u/170295?v=4)](https://github.com/sambernard "sambernard (3 commits)")

### Embed Badge

![Health badge](/badges/mtymek-codebasehq-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/mtymek-codebasehq-sdk/health.svg)](https://phpackages.com/packages/mtymek-codebasehq-sdk)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M271](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
