First API implementation

This commit is contained in:
Frédéric Guillot
2014-06-20 15:41:05 -03:00
parent efdc959c55
commit 7c5b900bd8
28 changed files with 1285 additions and 63 deletions

20
scripts/api-client.php Executable file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/env php
<?php
require 'vendor/JsonRPC/Client.php';
if ($argc !== 3) {
die('Usage: '.$argv[0].' <url> <token>'.PHP_EOL);
}
$client = new JsonRPC\Client($argv[1], 5, true);
$client->authentication('jsonrpc', $argv[2]);
$client->createProject('Test API');
$r = $client->getAllProjects();
var_dump($r);