From 71e341484f5bc2c6c3d69f842f4b4dde2af82551 Mon Sep 17 00:00:00 2001 From: Chris Neale Date: Fri, 8 Apr 2016 13:45:12 +0100 Subject: [PATCH 1/3] Added docs to explain how to use markdown to display images --- docs/01_Features/GitHub_Flavored_Markdown.md | 9 +++++++++ docs/01_Features/sampleimage.png | Bin 0 -> 3220 bytes 2 files changed, 9 insertions(+) create mode 100644 docs/01_Features/sampleimage.png diff --git a/docs/01_Features/GitHub_Flavored_Markdown.md b/docs/01_Features/GitHub_Flavored_Markdown.md index 0aba7d6..b97c0af 100644 --- a/docs/01_Features/GitHub_Flavored_Markdown.md +++ b/docs/01_Features/GitHub_Flavored_Markdown.md @@ -104,4 +104,13 @@ I get 10 times more traffic from [Google] [1] than from [2]: http://search.yahoo.com/ "Yahoo 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).* diff --git a/docs/01_Features/sampleimage.png b/docs/01_Features/sampleimage.png new file mode 100644 index 0000000000000000000000000000000000000000..71c8f509efdce11f8079677133fe54cd112d7da2 GIT binary patch literal 3220 zcmZ`+dpy(YA0G}eQf`&IMpnp}kN?1Y7QZ($RsI^M)bcCtVLs(KaP^EM(x%X4G^KvZgP@B#7*kMIbCLC)?J zcRO1IHY`Nj*FVe;r%eqZ^4I_Xl8WFhLvR#d6>3OuC>cRD27O~7c4v*oXpOCm-BYUAUuUaL_i=>QBm4adfH*6K!`3J z4u|MKAyDW^9^)iAI+Wr|JsCQEu;doVlQ|o?L{}cPpM?&@r|3@SK>hd>~ z*JcwS67u&aGXYjlL&pICpu3fssWX*tsURj;p+k|`@~m;=@+ce}s=zc1dhqGMovbry z8q%ulpDl{(Ve}^`J7pkYa9`z!^$yF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sJ z_{^nAE%6sc@J;4gX1j2a*zDU3tY1D#1G~DrefZdz<-Sw8b}mkxrm;aC933R|dUlNj z-CA1T>?0xLW z!hD!(bL_gCwPmi;=J6}}K4WRhRbRIrs%DlLueLq!V^!Aso6h5m*6ii{ZcL6aE#O+xPx7I+&| zbz14DytWzZ{x!lt60ZC$;GyR2sEIa~~C_TA3(WER& z6x&(b=AJqc*}Q;T_*$FjFY5P*l#Cf1%^jStujB;zBr&~_i!cQ}m9z@f=#f$Qn z*7>W7l0K}1R1#+gpD4xDb=Drg@#%*hqMFhWt>)uQ_nAJR%er+$VVmDtxo`Tu z1U}>9PpN(r0(w$wr>K4jW>uZQC~w~doMJ;1mixqMuDBu z@%DALgYQFrx)>95*XDlITjdXWj}hrMt2zI?s{Qlkwi_n0ec*auP1OAKuU&h;3RdR! KW>qMkgnt2SN6cXW literal 0 HcmV?d00001 From 10569180da129b450832512ce705f944ce984694 Mon Sep 17 00:00:00 2001 From: ayeo Date: Fri, 8 Apr 2016 19:17:32 +0200 Subject: [PATCH 2/3] Change guzzle version to ~6.0 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 4c28e03..a9487c3 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "require": { "php": ">=5.4", "league/plates": "~3.1", - "guzzlehttp/guzzle": "~5.3", + "guzzlehttp/guzzle": "~6.0", "league/commonmark": "^0.13", "symfony/console": "~3.0", "symfony/finder": "~3.0", From fa38e68045a0a3476b9ae2980f58336729554c80 Mon Sep 17 00:00:00 2001 From: ayeo Date: Sat, 9 Apr 2016 16:42:46 +0200 Subject: [PATCH 3/3] Adjust API to work with Guzzle 6 --- .gitignore | 1 + composer.lock | 141 ++++++++++++++++------------ libs/Format/Confluence/Api.php | 8 +- tests/Format/Confluence/ApiTest.php | 12 +++ 4 files changed, 98 insertions(+), 64 deletions(-) create mode 100644 tests/Format/Confluence/ApiTest.php diff --git a/.gitignore b/.gitignore index b8d6458..329fbcd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ node_modules .DS_Store +.idea /sftp-config.json static diff --git a/composer.lock b/composer.lock index 97a7ba5..a6040a2 100644 --- a/composer.lock +++ b/composer.lock @@ -4,39 +4,43 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "2587ec4642e574482832632b73b74202", - "content-hash": "598abc0b07c38c31f8cc44bbf293dae3", + "hash": "f56993fb68e4fc434e430eb51d888364", + "content-hash": "5162d1dac05611d2abcb5407954ef2df", "packages": [ { "name": "guzzlehttp/guzzle", - "version": "5.3.0", + "version": "6.2.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "f3c8c22471cb55475105c14769644a49c3262b93" + "reference": "d094e337976dff9d8e2424e8485872194e768662" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f3c8c22471cb55475105c14769644a49c3262b93", - "reference": "f3c8c22471cb55475105c14769644a49c3262b93", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d094e337976dff9d8e2424e8485872194e768662", + "reference": "d094e337976dff9d8e2424e8485872194e768662", "shasum": "" }, "require": { - "guzzlehttp/ringphp": "^1.1", - "php": ">=5.4.0" + "guzzlehttp/promises": "~1.0", + "guzzlehttp/psr7": "~1.1", + "php": ">=5.5.0" }, "require-dev": { "ext-curl": "*", - "phpunit/phpunit": "^4.0", - "psr/log": "^1.0" + "phpunit/phpunit": "~4.0", + "psr/log": "~1.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "6.2-dev" } }, "autoload": { + "files": [ + "src/functions_include.php" + ], "psr-4": { "GuzzleHttp\\": "src/" } @@ -52,7 +56,7 @@ "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/", "keywords": [ "client", @@ -63,44 +67,41 @@ "rest", "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", "source": { "type": "git", - "url": "https://github.com/guzzle/RingPHP.git", - "reference": "dbbb91d7f6c191e5e405e900e3102ac7f261bc0b" + "url": "https://github.com/guzzle/promises.git", + "reference": "bb9024c526b22f3fe6ae55a561fd70653d470aa8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/RingPHP/zipball/dbbb91d7f6c191e5e405e900e3102ac7f261bc0b", - "reference": "dbbb91d7f6c191e5e405e900e3102ac7f261bc0b", + "url": "https://api.github.com/repos/guzzle/promises/zipball/bb9024c526b22f3fe6ae55a561fd70653d470aa8", + "reference": "bb9024c526b22f3fe6ae55a561fd70653d470aa8", "shasum": "" }, "require": { - "guzzlehttp/streams": "~3.0", - "php": ">=5.4.0", - "react/promise": "~2.0" + "php": ">=5.5.0" }, "require-dev": { - "ext-curl": "*", "phpunit/phpunit": "~4.0" }, - "suggest": { - "ext-curl": "Guzzle will use specific adapters if cURL is present" - }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "1.0-dev" } }, "autoload": { "psr-4": { - "GuzzleHttp\\Ring\\": "src/" - } + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -113,25 +114,32 @@ "homepage": "https://github.com/mtdowling" } ], - "description": "Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function.", - "time": "2015-05-20 03:37:09" + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-03-08 01:15:46" }, { - "name": "guzzlehttp/streams", - "version": "3.0.0", + "name": "guzzlehttp/psr7", + "version": "1.2.3", "source": { "type": "git", - "url": "https://github.com/guzzle/streams.git", - "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5" + "url": "https://github.com/guzzle/psr7.git", + "reference": "2e89629ff057ebb49492ba08e6995d3a6a80021b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/streams/zipball/47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", - "reference": "47aaa48e27dae43d39fc1cea0ccf0d84ac1a2ba5", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/2e89629ff057ebb49492ba08e6995d3a6a80021b", + "reference": "2e89629ff057ebb49492ba08e6995d3a6a80021b", "shasum": "" }, "require": { - "php": ">=5.4.0" + "php": ">=5.4.0", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" }, "require-dev": { "phpunit/phpunit": "~4.0" @@ -139,13 +147,16 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "1.0-dev" } }, "autoload": { "psr-4": { - "GuzzleHttp\\Stream\\": "src/" - } + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -158,13 +169,14 @@ "homepage": "https://github.com/mtdowling" } ], - "description": "Provides a simple abstraction over streams of data", - "homepage": "http://guzzlephp.org/", + "description": "PSR-7 message implementation", "keywords": [ - "Guzzle", - "stream" + "http", + "message", + "stream", + "uri" ], - "time": "2014-10-12 19:18:40" + "time": "2016-02-18 21:54:00" }, { "name": "league/commonmark", @@ -287,35 +299,32 @@ "time": "2015-07-09 02:14:40" }, { - "name": "react/promise", - "version": "v2.4.0", + "name": "psr/http-message", + "version": "1.0", "source": { "type": "git", - "url": "https://github.com/reactphp/promise.git", - "reference": "f942da7b505d1a294284ab343d05df42d02ad6d9" + "url": "https://github.com/php-fig/http-message.git", + "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/f942da7b505d1a294284ab343d05df42d02ad6d9", - "reference": "f942da7b505d1a294284ab343d05df42d02ad6d9", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", + "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", "shasum": "" }, "require": { - "php": ">=5.4.0" + "php": ">=5.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { - "React\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] + "Psr\\Http\\Message\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -323,12 +332,20 @@ ], "authors": [ { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com" + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" } ], - "description": "A lightweight implementation of CommonJS Promises/A for PHP", - "time": "2016-03-31 13:10:33" + "description": "Common interface for HTTP messages", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2015-05-04 20:22:00" }, { "name": "symfony/console", diff --git a/libs/Format/Confluence/Api.php b/libs/Format/Confluence/Api.php index 403fa04..952f534 100644 --- a/libs/Format/Confluence/Api.php +++ b/libs/Format/Confluence/Api.php @@ -24,10 +24,14 @@ class Api $this->space = $space_id; } - protected function getClient() + /** + * This method is public due to test purposes + * @return Client + */ + public function getClient() { $options = [ - 'base_url' => $this->base_url . 'rest/api/', + 'base_uri' => $this->base_url . 'rest/api/', 'defaults' => [ 'auth' => [$this->user, $this->pass] ] diff --git a/tests/Format/Confluence/ApiTest.php b/tests/Format/Confluence/ApiTest.php new file mode 100644 index 0000000..694066b --- /dev/null +++ b/tests/Format/Confluence/ApiTest.php @@ -0,0 +1,12 @@ +assertEquals("test.com", $api->getClient()->getConfig()['base_uri']->getHost()); + } +} \ No newline at end of file