Merge pull request #361 from ayeo/master

Change guzzle version to ~6.0
This commit is contained in:
Stéphane Goetz 2016-04-09 21:07:45 +02:00
commit 81dc46c610
5 changed files with 99 additions and 65 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
node_modules node_modules
.DS_Store .DS_Store
.idea
/sftp-config.json /sftp-config.json
static static

View File

@ -14,7 +14,7 @@
"require": { "require": {
"php": ">=5.4", "php": ">=5.4",
"league/plates": "~3.1", "league/plates": "~3.1",
"guzzlehttp/guzzle": "~5.3", "guzzlehttp/guzzle": "~6.0",
"league/commonmark": "^0.13", "league/commonmark": "^0.13",
"symfony/console": "~3.0", "symfony/console": "~3.0",
"symfony/finder": "~3.0", "symfony/finder": "~3.0",

141
composer.lock generated
View File

@ -4,39 +4,43 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"hash": "2587ec4642e574482832632b73b74202", "hash": "f56993fb68e4fc434e430eb51d888364",
"content-hash": "598abc0b07c38c31f8cc44bbf293dae3", "content-hash": "5162d1dac05611d2abcb5407954ef2df",
"packages": [ "packages": [
{ {
"name": "guzzlehttp/guzzle", "name": "guzzlehttp/guzzle",
"version": "5.3.0", "version": "6.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/guzzle.git", "url": "https://github.com/guzzle/guzzle.git",
"reference": "f3c8c22471cb55475105c14769644a49c3262b93" "reference": "d094e337976dff9d8e2424e8485872194e768662"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/f3c8c22471cb55475105c14769644a49c3262b93", "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d094e337976dff9d8e2424e8485872194e768662",
"reference": "f3c8c22471cb55475105c14769644a49c3262b93", "reference": "d094e337976dff9d8e2424e8485872194e768662",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"guzzlehttp/ringphp": "^1.1", "guzzlehttp/promises": "~1.0",
"php": ">=5.4.0" "guzzlehttp/psr7": "~1.1",
"php": ">=5.5.0"
}, },
"require-dev": { "require-dev": {
"ext-curl": "*", "ext-curl": "*",
"phpunit/phpunit": "^4.0", "phpunit/phpunit": "~4.0",
"psr/log": "^1.0" "psr/log": "~1.0"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "5.0-dev" "dev-master": "6.2-dev"
} }
}, },
"autoload": { "autoload": {
"files": [
"src/functions_include.php"
],
"psr-4": { "psr-4": {
"GuzzleHttp\\": "src/" "GuzzleHttp\\": "src/"
} }
@ -52,7 +56,7 @@
"homepage": "https://github.com/mtdowling" "homepage": "https://github.com/mtdowling"
} }
], ],
"description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", "description": "Guzzle is a PHP HTTP client library",
"homepage": "http://guzzlephp.org/", "homepage": "http://guzzlephp.org/",
"keywords": [ "keywords": [
"client", "client",
@ -63,44 +67,41 @@
"rest", "rest",
"web service" "web service"
], ],
"time": "2015-05-20 03:47:55" "time": "2016-03-21 20:02:09"
}, },
{ {
"name": "guzzlehttp/ringphp", "name": "guzzlehttp/promises",
"version": "1.1.0", "version": "1.1.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/RingPHP.git", "url": "https://github.com/guzzle/promises.git",
"reference": "dbbb91d7f6c191e5e405e900e3102ac7f261bc0b" "reference": "bb9024c526b22f3fe6ae55a561fd70653d470aa8"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/RingPHP/zipball/dbbb91d7f6c191e5e405e900e3102ac7f261bc0b", "url": "https://api.github.com/repos/guzzle/promises/zipball/bb9024c526b22f3fe6ae55a561fd70653d470aa8",
"reference": "dbbb91d7f6c191e5e405e900e3102ac7f261bc0b", "reference": "bb9024c526b22f3fe6ae55a561fd70653d470aa8",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"guzzlehttp/streams": "~3.0", "php": ">=5.5.0"
"php": ">=5.4.0",
"react/promise": "~2.0"
}, },
"require-dev": { "require-dev": {
"ext-curl": "*",
"phpunit/phpunit": "~4.0" "phpunit/phpunit": "~4.0"
}, },
"suggest": {
"ext-curl": "Guzzle will use specific adapters if cURL is present"
},
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.1-dev" "dev-master": "1.0-dev"
} }
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"GuzzleHttp\\Ring\\": "src/" "GuzzleHttp\\Promise\\": "src/"
} },
"files": [
"src/functions_include.php"
]
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
@ -113,25 +114,32 @@
"homepage": "https://github.com/mtdowling" "homepage": "https://github.com/mtdowling"
} }
], ],
"description": "Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function.", "description": "Guzzle promises library",
"time": "2015-05-20 03:37:09" "keywords": [
"promise"
],
"time": "2016-03-08 01:15:46"
}, },
{ {
"name": "guzzlehttp/streams", "name": "guzzlehttp/psr7",
"version": "3.0.0", "version": "1.2.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/streams.git", "url": "https://github.com/guzzle/psr7.git",
"reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5" "reference": "2e89629ff057ebb49492ba08e6995d3a6a80021b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/streams/zipball/47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", "url": "https://api.github.com/repos/guzzle/psr7/zipball/2e89629ff057ebb49492ba08e6995d3a6a80021b",
"reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", "reference": "2e89629ff057ebb49492ba08e6995d3a6a80021b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.4.0" "php": ">=5.4.0",
"psr/http-message": "~1.0"
},
"provide": {
"psr/http-message-implementation": "1.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "~4.0" "phpunit/phpunit": "~4.0"
@ -139,13 +147,16 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "3.0-dev" "dev-master": "1.0-dev"
} }
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"GuzzleHttp\\Stream\\": "src/" "GuzzleHttp\\Psr7\\": "src/"
} },
"files": [
"src/functions_include.php"
]
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
@ -158,13 +169,14 @@
"homepage": "https://github.com/mtdowling" "homepage": "https://github.com/mtdowling"
} }
], ],
"description": "Provides a simple abstraction over streams of data", "description": "PSR-7 message implementation",
"homepage": "http://guzzlephp.org/",
"keywords": [ "keywords": [
"Guzzle", "http",
"stream" "message",
"stream",
"uri"
], ],
"time": "2014-10-12 19:18:40" "time": "2016-02-18 21:54:00"
}, },
{ {
"name": "league/commonmark", "name": "league/commonmark",
@ -287,35 +299,32 @@
"time": "2015-07-09 02:14:40" "time": "2015-07-09 02:14:40"
}, },
{ {
"name": "react/promise", "name": "psr/http-message",
"version": "v2.4.0", "version": "1.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/reactphp/promise.git", "url": "https://github.com/php-fig/http-message.git",
"reference": "f942da7b505d1a294284ab343d05df42d02ad6d9" "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/reactphp/promise/zipball/f942da7b505d1a294284ab343d05df42d02ad6d9", "url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298",
"reference": "f942da7b505d1a294284ab343d05df42d02ad6d9", "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.4.0" "php": ">=5.3.0"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "2.0-dev" "dev-master": "1.0.x-dev"
} }
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"React\\Promise\\": "src/" "Psr\\Http\\Message\\": "src/"
}, }
"files": [
"src/functions_include.php"
]
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
@ -323,12 +332,20 @@
], ],
"authors": [ "authors": [
{ {
"name": "Jan Sorgalla", "name": "PHP-FIG",
"email": "jsorgalla@gmail.com" "homepage": "http://www.php-fig.org/"
} }
], ],
"description": "A lightweight implementation of CommonJS Promises/A for PHP", "description": "Common interface for HTTP messages",
"time": "2016-03-31 13:10:33" "keywords": [
"http",
"http-message",
"psr",
"psr-7",
"request",
"response"
],
"time": "2015-05-04 20:22:00"
}, },
{ {
"name": "symfony/console", "name": "symfony/console",

View File

@ -24,10 +24,14 @@ class Api
$this->space = $space_id; $this->space = $space_id;
} }
protected function getClient() /**
* This method is public due to test purposes
* @return Client
*/
public function getClient()
{ {
$options = [ $options = [
'base_url' => $this->base_url . 'rest/api/', 'base_uri' => $this->base_url . 'rest/api/',
'defaults' => [ 'defaults' => [
'auth' => [$this->user, $this->pass] 'auth' => [$this->user, $this->pass]
] ]

View File

@ -0,0 +1,12 @@
<?php
namespace Todaymade\Daux\Format\Confluence;
class BuilderTest extends \PHPUnit_Framework_TestCase
{
// this test supports upgrade Guzzle to version 6
public function testClientOptions()
{
$api = new Api("http://test.com/", "user", "pass");
$this->assertEquals("test.com", $api->getClient()->getConfig()['base_uri']->getHost());
}
}