-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbasic.php
More file actions
32 lines (28 loc) · 781 Bytes
/
Copy pathbasic.php
File metadata and controls
32 lines (28 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
/**
* This example should be executed in console.
*/
namespace Comindware\Tracker\API\Examples;
use Comindware\Tracker\API\Api;
use Comindware\Tracker\API\Client;
use Http\Discovery\HttpClientDiscovery;
use Http\Discovery\MessageFactoryDiscovery;
use Http\Discovery\StreamFactoryDiscovery;
require __DIR__ . '/inc/init.php';
$client = new Client(
getenv('TRACKER_URI'),
getenv('TRACKER_TOKEN'),
HttpClientDiscovery::find(),
MessageFactoryDiscovery::find(),
StreamFactoryDiscovery::find()
);
$tracker = new Api($client);
$workspaces = $tracker->workspaces()->getAll();
foreach ($workspaces as $workspace) {
printf(
"%s: %s (%s)\n",
$workspace->getId(),
$workspace->getName(),
$workspace->getDescription()
);
}