Skip to content

Commit

Permalink
Remove documentation for cURL support
Browse files Browse the repository at this point in the history
Support for cURL was removed in version 3.0.0 of this client
without us realising.

To make the docs correct, we are therefore removing the instructions
on how to use it.

We may decide to add back in cURL support but haven't commited to
doing so right at this point.

For more context, see:
#111 (comment)
  • Loading branch information
idavidmcdonald committed Jun 28, 2022
1 parent 853aacf commit b233902
Showing 1 changed file with 1 addition and 26 deletions.
27 changes: 1 addition & 26 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This documentation is for developers interested in using the GOV.UK Notify PHP c

## Set up the client

The Notify PHP Client is based on a [PSR-7 HTTP model](https://www.php-fig.org/psr/psr-7/) [external link]. To install it, you must select your preferred HTTP client. You can follow these instructions to use [Guzzle v6 and v5](http://docs.guzzlephp.org/en/stable/) and [cURL](http://php.net/manual/en/book.curl.php) [external links].
The Notify PHP Client is based on a [PSR-7 HTTP model](https://www.php-fig.org/psr/psr-7/) [external link]. To install it, you must select your preferred PSR-7 compatible HTTP client. You can follow these instructions to use [Guzzle v6 and v5](http://docs.guzzlephp.org/en/stable/)[external link].

### Guzzle v6

Expand Down Expand Up @@ -53,31 +53,6 @@ To get an API key, [sign in to GOV.UK Notify](https://www.notifications.service.

To get an API key, [sign in to GOV.UK Notify](https://www.notifications.service.gov.uk/sign-in) and go to the __API integration__ page. You can find more information in the [API keys](#api-keys) section of this documentation.

### cURL

1. Use [Composer](https://getcomposer.org/) [external link] to install the GOV.UK Notify PHP client. Run the following in the command line:

```sh
composer require php-http/curl-client php-http/message alphagov/notifications-php-client
```

You can now use the [autoloader](https://getcomposer.org/doc/01-basic-usage.md#autoloading) [external link] to download the GOV.UK Notify PHP client.

1. Add the following code to your application to create a new instance of the client:

```
$notifyClient = new \Alphagov\Notifications\Client([
'apiKey' => '{your api key}',
'httpClient' => new \Http\Client\Curl\Client(
new \Http\Message\MessageFactory\GuzzleMessageFactory,
new \Http\Message\StreamFactory\GuzzleStreamFactory
),
]);
```

1. Run `$notifyClient` to access the GOV.UK Notify API.

To get an API key, [sign in to GOV.UK Notify](https://www.notifications.service.gov.uk/sign-in) and go to the __API integration__ page. You can find more information in the [API keys](#api-keys) section of this documentation.

## Send a message

Expand Down

0 comments on commit b233902

Please sign in to comment.