Skip to content

Commit

Permalink
Merge tag '2.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
typhonius committed Dec 26, 2019
2 parents e8b4c87 + 66d8399 commit 8553ce9
Show file tree
Hide file tree
Showing 214 changed files with 8,357 additions and 3,310 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
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
30 changes: 22 additions & 8 deletions README.md
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 All @@ -20,7 +21,7 @@ library as a dependency to your composer.json file.
```json
{
"require": {
"typhonius/acquia-php-sdk-v2": "^1.0.0"
"typhonius/acquia-php-sdk-v2": "^2.0.0"
}
}
```
Expand All @@ -42,8 +43,12 @@ 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;
use AcquiaCloudApi\Endpoints\Servers;
use AcquiaCloudApi\Endpoints\DatabaseBackups;

$key = 'd0697bfc-7f56-4942-9205-b5686bf5b3f5';
$secret = 'D5UfO/4FfNBWn4+0cUwpLOoFzfP7Qqib4AoY+wYGsKE=';
Expand All @@ -52,17 +57,26 @@ $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);
$server = new Servers($client);
$backup = new DatabaseBackups($client);

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

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

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

// Create DB backup
$backup->create($environmentUuid, $dbName);

```

Expand Down
17 changes: 11 additions & 6 deletions composer.json
Expand Up @@ -10,18 +10,22 @@
"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\\Response\\":"src/Response"
"AcquiaCloudApi\\Connector\\":"src/Connector",
"AcquiaCloudApi\\Endpoints\\":"src/Endpoints",
"AcquiaCloudApi\\Response\\":"src/Response",
"AcquiaCloudApi\\Exception\\":"src/Exception"
}
},
"autoload-dev": {
Expand All @@ -31,8 +35,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"
}
}

0 comments on commit 8553ce9

Please sign in to comment.