RedmineApiBundle
, (*1)
This bundle integrate the Redmine API Wrapper into your Symfony Project, (*2)
Step1: Install RedmineApiBundle
The preffered way to install this bundle is to rely on composer., (*3)
{
"require": {
// ...
"limetecbiotechnologies/redmineapibundle": "~1.0"
}
}
Step2: Enable the bundle
Finally, enable the bundle in the kernel:, (*4)
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new LimetecBiotechnologies\RedmineApiBundle\RedmineApiBundle(),
);
}
Add RedmineApiBundle settings in app/config/config.yml:, (*5)
redmine_api:
clients:
firstclient:
token: your-api-token
url: http://example.org/api/v3/
secondclient:
token: your-api-token
url: http://example.com/api/v3/
The first client is defined automatically as your default client., (*6)
Step4: Use the redmine api
you want to use the default client, you can easy getting the client by the "redmine_api" service-id., (*7)
$api = $this->get('redmine_api');
$api->issue->show($ticket);
If you want to get one of the other clients, you can getting the specific client by the "redmineapi.client.CLIENT_NAME" service id., (*8)
$api = $this->get('redmineapi.client.secondclient');
$api->issue->show($ticket);