snide/php-magnum-client

Magnum CI API PHP Client

1.0.0 2014-02-20 09:46 UTC

This package is not auto-updated.

Last update: 2024-04-13 13:04:20 UTC


README

A simple PHP client for Magnum CI API

Build Status Scrutinizer Quality Score Code Coverage Latest Stable Version Total Downloads License

Installation

Installation by Composer

If you use composer, add php-magnum-client library as a dependency to the composer.json of your application

    "require": {
        ...
        "snide/php-magnum-client": "dev-master"
        ...
    },

Usage

Getting Project info :

<?php

include_once('../vendor/autoload.php');

use Snide\Magnum\Client;
use Snide\Magnum\Model\User;
use Snide\Magnum\Model\Project;

$client = new Client();
$project = new Project();
$project->setApiToken('YourProjectAPIKey');
$project = $client->fetchProject($project); // Fetch project & builds
$project = $client->fetchProject($project, false); // Fetch project without builds

Getting User info :

<?php

include_once('../vendor/autoload.php');

use Snide\Magnum\Client;
use Snide\Magnum\Model\User;
use Snide\Magnum\Model\Project;

$client = new Client();
$user = new User();
$user->setApiToken('YourProjectAPIKey');
$user = $client->fetchProject($user); // Fetch user profile

That's all!