Skip to content

Commit

Permalink
Merge f454daf into aed86d2
Browse files Browse the repository at this point in the history
  • Loading branch information
typhonius committed Dec 4, 2019
2 parents aed86d2 + f454daf commit 9bd4925
Show file tree
Hide file tree
Showing 69 changed files with 4,615 additions and 2,519 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ language: php

php:
- 7.1
- 7.2
- 7.3

before_install:
- composer self-update
Expand All @@ -16,6 +18,7 @@ script:
- composer lint
- composer sniff
- composer test
- composer stan

after_script:
- cd ${TRAVIS_BUILD_DIR}
Expand Down
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ Acquia PHP SDK for CloudAPI v2
[![Build Status](https://travis-ci.org/typhonius/acquia-php-sdk-v2.svg?branch=master)](https://travis-ci.org/typhonius/acquia-php-sdk-v2)
[![Total Downloads](https://poser.pugx.org/typhonius/acquia-php-sdk-v2/downloads.png)](https://packagist.org/packages/typhonius/acquia-php-sdk-v2)
[![Coverage Status](https://coveralls.io/repos/github/typhonius/acquia-php-sdk-v2/badge.svg?branch=master)](https://coveralls.io/github/typhonius/acquia-php-sdk-v2?branch=master)
[![License](https://poser.pugx.org/typhonius/acquia-php-sdk-v2/license.png)](https://www.versioneye.com/user/projects/5a18bd670fb24f2125873c86#tab-dependencies)
[![Quality Status](https://scrutinizer-ci.com/g/typhonius/acquia-php-sdk-v2/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/typhonius/acquia-php-sdk-v2/)

[![License](https://poser.pugx.org/typhonius/acquia-php-sdk-v2/license.png)](https://www.versioneye.com/user/projects/5a18bd670fb24f2125873c86#tab-dependencies)
[![Latest Stable Version](https://poser.pugx.org/typhonius/acquia-php-sdk-v2/v/stable.png)](https://packagist.org/packages/typhonius/acquia-php-sdk-v2)
[![Latest Unstable Version](https://poser.pugx.org/typhonius/acquia-php-sdk-v2/v/unstable.png)](https://packagist.org/packages/typhonius/acquia-php-sdk-v2)

Expand Down Expand Up @@ -42,8 +43,10 @@ Basic usage examples for the SDK.

require 'vendor/autoload.php';

use AcquiaCloudApi\CloudApi\Client;
use AcquiaCloudApi\CloudApi\Connector;
use AcquiaCloudApi\Connector\Client;
use AcquiaCloudApi\Connector\Connector;
use AcquiaCloudApi\Endpoints\Applications;
use AcquiaCloudApi\Endpoints\Environments;

$key = 'd0697bfc-7f56-4942-9205-b5686bf5b3f5';
$secret = 'D5UfO/4FfNBWn4+0cUwpLOoFzfP7Qqib4AoY+wYGsKE=';
Expand All @@ -52,17 +55,21 @@ $config = [
'key' => $key,
'secret' => $secret,
];

$connector = new Connector($config);
$cloudapi = Client::factory($connector);
$client = Client::factory($connector);

$application = new Applications($client);
$environment = new Environments($client);

// Get all applications.
$applications = $cloudapi->applications();
$applications = $application->getApplications();

// Get all environments of an application.
$environments = $cloudapi->environments($application->uuid);
$environments = $application->getEnvironments($application->uuid);

// Get all servers in an environment.
$servers = $cloudapi->servers($environment->uuid);
$servers = $environment->servers($environment->uuid);

```

Expand Down
14 changes: 9 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,20 @@
"license": "MIT",
"require": {
"guzzlehttp/guzzle": "^6.3",
"php": ">=5.6",
"php": ">=7.1",
"league/oauth2-client": "^2.4"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.0.0",
"phpunit/phpunit": "^6.4",
"squizlabs/php_codesniffer": "^2.7"
"phpunit/phpunit": "^7.0",
"squizlabs/php_codesniffer": "^2.7",
"phpstan/phpstan": "^0.11.19",
"phpstan/phpstan-phpunit": "^0.11.2"
},
"autoload":{
"psr-4":{
"AcquiaCloudApi\\CloudApi\\":"src/CloudApi",
"AcquiaCloudApi\\Connector\\":"src/Connector",
"AcquiaCloudApi\\Endpoints\\":"src/Endpoints",
"AcquiaCloudApi\\Response\\":"src/Response"
}
},
Expand All @@ -31,8 +34,9 @@
},
"scripts": {
"lint": "php -l ./src/",
"sniff": "./vendor/bin/phpcs -s --standard=PSR2 ./src/",
"sniff": "./vendor/bin/phpcs -s --standard=PSR2 ./src/ ./tests/",
"test": "./vendor/bin/phpunit --coverage-clover ./tests/logs/clover.xml",
"stan": "./vendor/bin/phpstan analyse --level 5 src tests",
"coveralls": "php ./vendor/bin/php-coveralls -v"
}
}
Loading

0 comments on commit 9bd4925

Please sign in to comment.