All Projects → kbsali → Php Redmine Api

kbsali / Php Redmine Api

Licence: mit
A simple PHP Redmine API client, Object Oriented

Projects that are alternatives of or similar to Php Redmine Api

Redmine Net Api
.Net API for Redmine bug/task management systems.
Stars: ✭ 131 (-66.58%)
Mutual labels:  api-client, redmine
Python Redmine
Python Redmine is a library for communicating with a Redmine project management application
Stars: ✭ 440 (+12.24%)
Mutual labels:  api-client, redmine
toggl2redmine
Import time from Toggl 2 Redmine.
Stars: ✭ 23 (-94.13%)
Mutual labels:  redmine
Redmine Theme Gitmike
This is github-like theme for Redmine.
Stars: ✭ 333 (-15.05%)
Mutual labels:  redmine
Aiodocker
Python Docker API client based on asyncio and aiohttp
Stars: ✭ 288 (-26.53%)
Mutual labels:  api-client
kaggler
🏁 API client for Kaggle
Stars: ✭ 50 (-87.24%)
Mutual labels:  api-client
Malsub
A Python RESTful API framework for online malware analysis and threat intelligence services.
Stars: ✭ 308 (-21.43%)
Mutual labels:  api-client
pixela
Pixela API client for Ruby
Stars: ✭ 23 (-94.13%)
Mutual labels:  api-client
Wptools
Wikipedia tools (for Humans): easily extract data from Wikipedia, Wikidata, and other MediaWikis
Stars: ✭ 371 (-5.36%)
Mutual labels:  api-client
Insomnia
The open-source, cross-platform API client for GraphQL, REST, and gRPC.
Stars: ✭ 18,969 (+4739.03%)
Mutual labels:  api-client
Octokit.swift
A Swift API Client for GitHub and GitHub Enterprise
Stars: ✭ 325 (-17.09%)
Mutual labels:  api-client
Hubspot Php
HubSpot PHP API Client
Stars: ✭ 273 (-30.36%)
Mutual labels:  api-client
cl-kraken
A Common Lisp API wrapper for the Kraken cryptocurrency exchange.
Stars: ✭ 12 (-96.94%)
Mutual labels:  api-client
Node Imdb Api
A non-scraping, functional node.js interface to imdb (mirror of gitlab.com/worr/node-imdb-api)
Stars: ✭ 314 (-19.9%)
Mutual labels:  api-client
connect
CLI tool and Go client library for the Kafka Connect REST API
Stars: ✭ 45 (-88.52%)
Mutual labels:  api-client
Amazon Product Api
💳 Amazon Product Advertising API client
Stars: ✭ 353 (-9.95%)
Mutual labels:  api-client
dwolla-v2-node
Official Node Wrapper for Dwolla's API: https://developers.dwolla.com/api-reference/
Stars: ✭ 30 (-92.35%)
Mutual labels:  api-client
Php Curl Class
PHP Curl Class makes it easy to send HTTP requests and integrate with web APIs
Stars: ✭ 2,903 (+640.56%)
Mutual labels:  api-client
Flatly light redmine
Flatly light redmine theme
Stars: ✭ 296 (-24.49%)
Mutual labels:  redmine
Node Vault
Client for HashiCorp's Vault
Stars: ✭ 391 (-0.26%)
Mutual labels:  api-client

PHP Redmine API

A simple PHP Object Oriented wrapper for Redmine API.

Uses Redmine API.

Features

  • Follows PSR-0 conventions and coding standard: autoload friendly
  • API entry points implementation state :
  • OK Attachments
  • OK Groups
  • OK Custom Fields
  • OK Issues
  • OK Issue Categories
  • OK Issue Priorities
  • NOK Issue Relations - only partially implemented
  • OK Issue Statuses
  • OK News
  • OK Projects
  • OK Project Memberships
  • OK Queries
  • OK Roles
  • OK Time Entries
  • OK Time Entry Activities
  • OK Trackers
  • OK Users
  • OK Versions
  • OK Wiki

Todo

Limitations

Redmine is missing some APIs for a full remote management of the data :

A possible solution to this would be to create an extra APIs implementing the missing entry points. See existing effort in doing so : https://github.com/rschobbert/redmine-miss-api

Requirements

  • PHP >= 5.4
  • The PHP cURL extension
  • The PHP SimpleXML extension
  • The PHP JSON extension
  • PHPUnit >= 4.0 (optional) to run the test suite
  • "Enable REST web service" for your Redmine project (/settings/edit?tab=authentication)
  • then obtain your API access key in your profile page : /my/account
  • or use your username & password

Install

Composer

Composer users can simply run:

$ php composer.phar require kbsali/redmine-api:~1.0

at the root of their projects. To utilize the library, include Composer's vendor/autoload.php in the scripts that will use the Redmine classes.

For example,

<?php
// This file is generated by Composer
require_once 'vendor/autoload.php';
$client = new Redmine\Client('http://redmine.example.com', 'username', 'password');

Manual

It is also possible to install the library oneself, either locally to a project or globally; say, in /usr/share/php.

First, download and extract the library somewhere. For example, the following steps extract v1.5.18 of the library into the vendor/php-redmine-api-1.5.18 directory:

$ mkdir vendor
$ wget -q https://github.com/kbsali/php-redmine-api/archive/v1.5.18.tar.gz
$ tar -xf v1.5.18.tar.gz -C vendor/
$ rm v1.5.18.tar.gz

Now, in any scripts that will use the Redmine classes, include the src/autoload.php file from the php-redmine-api directory. For example,

<?php
// This file ships with php-redmine-api
require 'vendor/php-redmine-api-1.5.18/src/autoload.php';
$client = new Redmine\Client('http://redmine.example.com', 'username', 'password');

Running the test suite

You can run test suite to make sure the library will work properly on your system. Simply run vendor/bin/phpunit in the project's directory :

$ vendor/bin/phpunit
PHPUnit 6.5.14 by Sebastian Bergmann and contributors.

Error:         No code coverage driver is available

...............................................................  63 / 285 ( 22%)
............................................................... 126 / 285 ( 44%)
............................................................... 189 / 285 ( 66%)
............................................................... 252 / 285 ( 88%)
.................................                               285 / 285 (100%)

Time: 107 ms, Memory: 8.00MB

OK (285 tests, 662 assertions)

Basic usage of php-redmine-api client

<?php

// For Composer users (this file is generated by Composer)
require_once 'vendor/autoload.php';

// Or if you've installed the library manually, use this instead.
// require 'vendor/php-redmine-api-x.y.z/src/autoload.php';

$client = new Redmine\Client('http://redmine.example.com', 'API_ACCESS_KEY');
//-- OR --
$client = new Redmine\Client('http://redmine.example.com', 'username', 'password');

$client->user->all();
$client->user->listing();

$client->issue->create([
    'project_id'  => 'test',
    'subject'     => 'some subject',
    'description' => 'a long description blablabla',
    'assigned_to_id' => 123, // or 'assigned_to' => 'user1'
]);
$client->issue->all([
    'limit' => 1000
]);

See example.php for further examples.

User Impersonation

As of Redmine V2.2 you can impersonate user through the REST API :

$client = new Redmine\Client('http://redmine.example.com', 'API_ACCESS_KEY');

// impersonate user
$client->setImpersonateUser('jsmith');

// create a time entry for jsmith
$client->time_entry->create($data);

// remove impersonation for further calls
$client->setImpersonateUser(null);

Thanks!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].