From 6077d1dc06bc36fff1cb862d5167e4cecd4a5d45 Mon Sep 17 00:00:00 2001 From: Niklas Keller Date: Thu, 13 Jul 2017 12:07:01 +0200 Subject: [PATCH 1/2] Add docs for artax-adapter --- clients.rst | 9 ++++++++ clients/artax-adapter.rst | 43 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 clients/artax-adapter.rst diff --git a/clients.rst b/clients.rst index a26bef3..19585ab 100644 --- a/clients.rst +++ b/clients.rst @@ -16,6 +16,7 @@ interface and forwarding the calls to an HTTP client not implementing the interf clients/curl-client clients/socket-client clients/mock-client + clients/artax-adapter clients/buzz-adapter clients/cakephp-adapter clients/guzzle5-adapter @@ -30,6 +31,7 @@ interface and forwarding the calls to an HTTP client not implementing the interf "``php-http/curl-client``", "Client", ":doc:`Docs `, `Repo `__", "|curl_version| |curl_downloads| " "``php-http/socket-client``", "Client", ":doc:`Docs `, `Repo `__", "|socket_version| |socket_downloads| " "``php-http/mock-client``", "Client", ":doc:`Docs `, `Repo `__", "|mock_version| |mock_downloads| " + "``php-http/artax-adapter``", "Adapter", ":doc:`Docs `, `Repo `__", "|artax_version| |artax_downloads| " "``php-http/buzz-adapter``", "Adapter", ":doc:`Docs `, `Repo `__", "|buzz_version| |buzz_downloads| " "``php-http/cakephp-adapter``", "Adapter", ":doc:`Docs `, `Repo `__", "|cakephp_version| |cakephp_downloads| " "``php-http/guzzle5-adapter``", "Adapter", ":doc:`Docs `, `Repo `__", "|guzzle5_version| |guzzle5_downloads| " @@ -74,6 +76,13 @@ HTTPlug use the ``provide`` section to tell composer that they do provide the cl :target: https://github.com/php-http/mock-client/releases :alt: Latest Version +.. |artax_downloads| image:: https://img.shields.io/packagist/dt/php-http/artax-adapter.svg?style=flat-square + :target: https://packagist.org/packages/php-http/artax-adapter + :alt: Total Downloads +.. |artax_version| image:: https://img.shields.io/github/release/php-http/artax-adapter.svg?style=flat-square + :target: https://github.com/php-http/artax-adapter/releases + :alt: Latest Version + .. |buzz_downloads| image:: https://img.shields.io/packagist/dt/php-http/buzz-adapter.svg?style=flat-square :target: https://packagist.org/packages/php-http/buzz-adapter :alt: Total Downloads diff --git a/clients/artax-adapter.rst b/clients/artax-adapter.rst new file mode 100644 index 0000000..b7962c5 --- /dev/null +++ b/clients/artax-adapter.rst @@ -0,0 +1,43 @@ +Artax Adapter +============= + +An HTTPlug adapter for the `Artax HTTP client`_. + +Installation +------------ + +To install the Artax adapter, which will also install Artax itself (if it was +not yet included in your project), run: + +.. code-block:: bash + + $ composer require php-http/artax-adapter + +.. include:: includes/install-message-factory.inc + +.. include:: includes/install-discovery.inc + +Usage +----- + +Begin by creating a Artax adapter:: + + use Amp\Artax\DefaultClient; + use Http\Adapter\Artax\Client as ArtaxAdapter; + use Http\Message\MessageFactory\GuzzleMessageFactory; + + $adapter = new ArtaxAdapter(new DefaultClient(), new GuzzleMessageFactory()); + +Or if you installed the :doc:`discovery ` layer:: + + use Http\Adapter\Artax\Client as ArtaxAdapter; + + $adapter = new ArtaxAdapter(); + +.. warning:: + + The message factory parameter is mandatory if the discovery layer is not installed. + +.. include:: includes/further-reading-sync.inc + +.. _Artax HTTP client: https://github.com/amphp/artax From e65ad6a8ab25dd5da626b918447df72bce758573 Mon Sep 17 00:00:00 2001 From: Niklas Keller Date: Thu, 13 Jul 2017 12:49:20 +0200 Subject: [PATCH 2/2] Add Artax to spelling_word_list.txt --- spelling_word_list.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/spelling_word_list.txt b/spelling_word_list.txt index 68458eb..9439461 100644 --- a/spelling_word_list.txt +++ b/spelling_word_list.txt @@ -1,3 +1,4 @@ +Artax async auth backtrace