Skip to content

thiagorb/codeship

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Codeship API Client

A PHP Client to use the Codeship API.

Requirements

  • PHP 7.1 or newer
  • Composer

Installing

This project follows the PSR-18 convention, which means you can use any HTTP client implementation with it.

If you don't know which one to choose, you can use the guzzle adapter.

To install the client with guzzle using composer run:

composer require thiagorb/codeship php-http/guzzle6-adapter

Usage

  1. Instantiate a factory

    • Using guzzle:
    $factory = new \Thiagorb\Codeship\Guzzle\Factory;
    
    • Using another client:
    $factory = new \Thiagorb\Codeship\Factory($client, $requestFactory);
    
  2. Instantiate the client

$codeship = $factory->build('user@example.com', 'password');
  1. Ready to use
$firstOrganization = $codeship->accountOrganizations()->read()[0];

$projects = $codeship->organizations()
    ->find($firstOrganization->getUuid())
    ->projects()
    ->read();

foreach ($projects->getProjects() as $project) {
    var_dump($project->getName());
}

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the MIT License - see the LICENSE file for details

About

A PHP Client to use the Codeship API.

Resources

License

Stars

Watchers

Forks

Packages

No packages published