File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -20,21 +20,20 @@ addwiki/mediawiki-api-base is a PHP HTTP client wrapped around guzzle that makes
20
20
21
21
Use composer to install the library and all its dependencies:
22
22
23
- composer require "addwiki/mediawiki-api-base:~1 .0"
23
+ composer require "addwiki/mediawiki-api-base:~2 .0"
24
24
25
25
## Example Usage
26
26
27
- You can construct an api object by simply passing the api endpoint:
27
+ You can get an api object by simply passing the api endpoint:
28
28
29
29
``` php
30
- $api = new MediawikiApi( 'http://localhost/w/api.php' );
30
+ $api = MediawikiApi::newFromApiEndpoint ( 'http://localhost/w/api.php' );
31
31
```
32
32
33
- You can also pass a custom Guzzle ClientInterface :
33
+ You can event just pass a page :
34
34
35
35
``` php
36
- $client = new Client();
37
- $api = new MediawikiApi( 'http://localhost/w/api.php', $client );
36
+ $api = MediawikiApi::newFromPage( 'https://en.wikipedia.org/wiki/Berlin' );
38
37
```
39
38
40
39
You can easily log in and out:
Original file line number Diff line number Diff line change 1
1
These are the release notes for the [ mediawiki-api-base] ( README.md ) .
2
2
3
- ## Version 2.0.0
3
+ ## Version 2.0.0 (18 December 2015)
4
4
* Added ` MediawikiApi::newFromApiEndpoint ` and ` MediawikiApi::newFromPage `
5
5
* MediawikiApi constructor access marked as private (please use static factory methods)
6
6
* Added async methods to MediawikiApi ` getRequestAsync ` & ` postRequestAsync `
7
7
* Requires "guzzlehttp/guzzle": "~ 6.0" ( From "guzzle/guzzle": "~ 5.2" )
8
8
* Requires "guzzlehttp/promises": "~ 1.0"
9
9
10
- ## Version 1.1.0 (5 september 2015)
10
+ ## Version 1.1.0 (5 September 2015)
11
11
* Requests that encounter a connection exception are now retried
12
12
* Requests that result in non blocking mediawiki api error codes are now retried (ratelimited, readonly, internal_api_error_DBQueryError)
13
13
* MediawikiApi now implements PSR-3 LoggerAwareInterface
You can’t perform that action at this time.
0 commit comments