Merge branch 'master' into development

* master:
  Adjust API to work with Guzzle 6
  Change guzzle version to ~6.0
  Added docs to explain how to use markdown to display images

# Conflicts:
#	composer.lock
This commit is contained in:
Stéphane Goetz 2016-04-14 21:28:52 +02:00
commit a2f5d89201
7 changed files with 108 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": "5d99c57e9efe49df55a765026a15f586", "hash": "bd4fe65872a143039090e3c62b4c5a40",
"content-hash": "88197b6eaf8fc4b266eb8c72b115580a", "content-hash": "de3684c6c65b1602b52e6534aa5e6eda",
"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.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/streams.git", "url": "https://github.com/guzzle/psr7.git",
"reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5" "reference": "31382fef2889136415751badebbd1cb022a4ed72"
}, },
"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/31382fef2889136415751badebbd1cb022a4ed72",
"reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", "reference": "31382fef2889136415751badebbd1cb022a4ed72",
"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-04-13 19:56:01"
}, },
{ {
"name": "league/commonmark", "name": "league/commonmark",
@ -329,35 +341,32 @@
"time": "2015-11-07 22:20:37" "time": "2015-11-07 22:20:37"
}, },
{ {
"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": [
@ -365,12 +374,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

@ -104,4 +104,13 @@ I get 10 times more traffic from [Google] [1] than from
[2]: http://search.yahoo.com/ "Yahoo Search" [2]: http://search.yahoo.com/ "Yahoo Search"
[3]: http://search.msn.com/ "MSN Search" [3]: http://search.msn.com/ "MSN Search"
Images
------
Here's an image.
![This is an image](sampleimage.png)
Note: to use images on a landing page (index.md), prefix the image URL with the name of the directory it appears in, omitting the numerical prefix used to order the sections. For example in this section, to display this image on the landing page (index.md), the URL for the image would be "Features/sampleimage.png" to display the same image.
*View the [source of this content](http://github.github.com/github-flavored-markdown/sample_content.html).* *View the [source of this content](http://github.github.com/github-flavored-markdown/sample_content.html).*

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

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());
}
}