PHP code example of mipxtx / redmine-api

1. Go to this page and download the library: Download mipxtx/redmine-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mipxtx / redmine-api example snippets


use RedmineApi\Factory;
use RedmineApi\HttpClient;
use RedmineApi\Sql\MysqlClient;

$client = new \RedmineApi\HttpClient(
    "https://redmine.example.com",             // server url
    "bbb09b217bf17a905a16caa4ce7d4a23a3a0036d" // redmine api key
);

$acc = new MysqlClient("example.com", "user", "pass", "dbname"); // mysql client direct access

$factory = new Factory($client, $acc);

$uids = [];
foreach ($factory->getIssues()->findByIds([1, 2, 3]) as $issue) {  // multiget of given issues
    $uids[] = $ussue["author_id"];
}

$users = $factory->getUsers()->findByIds($uids); //finding users for issues