se/redmine

Access layer for for Redmine. Available Clients: REST Api, Database

dev-master 2013-09-14 07:41 UTC

This package is not auto-updated.

Last update: 2020-07-05 18:43:06 UTC


README

Latest Stable Version

Access layer for for Redmine, written in PHP.

Dev branch is master branch.

Build Status

Installation

The recommended way to install is through Composer.

{
    "require": {
        "se/redmine": "dev-master"
    }
}

Usage

Pick a Client
<?php

use SE\Component\Redmine\Client\RestClient();

$client = new RestClient('www.example.org/redmine', 'apiKey=c42ahcfg');

// Or coming soon
use SE\Component\Redmine\Client\DbClient();

$client = new DbClient('www.example.org:3306', 'redmine_v21', 'user', 'pass');
Unified API for all Clients
<?php

$repository = $client->getRepository('issues');

// Find all by criteria
$issues = $repository->findAll(array('status_id' => 'closed')); 
// $issues instanceof SE\Component\Redmine\Entity\Collection\Issues

// Find one by id & persist changes
$issue = $repository->find(2); // find by id
$issue->setSubject('New Title');
$repository->persist($issue);

// Create new Issue & save it
use SE\Component\Redmine\Entity\Issue;

$issue = new Issue();
$issue->setSubject('My First Issue');
$repository->persist($issue);

print $issue->getId(); // returns Id of newly create Issue, similar to Doctrine

Implemented Entities

Running Tests

vendor/bin/phpunit -c phpunit.xml.dist

Run a set of tests against a running redmine via editing constants in test/config.dist.php and calling phpunit with --group=live.

vendor/bin/phpunit -c phpunit.xml.dist --group=live