Index: trunk/extensions/Push/RELEASE-NOTES |
— | — | @@ -4,6 +4,11 @@ |
5 | 5 | Latest version of the release notes: http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/Push/RELEASE-NOTES?view=co |
6 | 6 | |
7 | 7 | |
| 8 | +=== Version 1.1 === |
| 9 | +2011-0x-xx |
| 10 | + |
| 11 | +* Added PushAPIAfterPush and PushAPIAfterImagePush hooks to the API modules. |
| 12 | + |
8 | 13 | === Version 1.0 === |
9 | 14 | 2011-05-26 |
10 | 15 | |
Index: trunk/extensions/Push/api/ApiPush.php |
— | — | @@ -113,8 +113,6 @@ |
114 | 114 | 'lgpassword' => $password |
115 | 115 | ); |
116 | 116 | |
117 | | - //static $fail = 0;$fail++; |
118 | | - |
119 | 117 | if ( !is_null( $token ) ) { |
120 | 118 | $requestData['lgtoken'] = $token; |
121 | 119 | } |
— | — | @@ -352,7 +350,9 @@ |
353 | 351 | $status = $req->execute(); |
354 | 352 | |
355 | 353 | if ( $status->isOK() ) { |
356 | | - $this->editResponses[] = $req->getContent(); |
| 354 | + $response = $req->getContent(); |
| 355 | + $this->editResponses[] = $response; |
| 356 | + wfRunHooks( 'PushAPIAfterPush', array( $title, $revision, $target, $token, $response ) ); |
357 | 357 | } |
358 | 358 | else { |
359 | 359 | $this->dieUsage( wfMsg( 'push-special-err-push-failed' ), 'page-push-failed' ); |
Index: trunk/extensions/Push/api/ApiPushImages.php |
— | — | @@ -295,12 +295,16 @@ |
296 | 296 | |
297 | 297 | $status = $req->execute(); |
298 | 298 | |
299 | | - if ( $status->isOK() ) { |
| 299 | + if ( $status->isOK() ) { |
| 300 | + $response = $req->getContent(); |
| 301 | + |
300 | 302 | $this->getResult()->addValue( |
301 | 303 | null, |
302 | 304 | null, |
303 | | - FormatJson::decode( $req->getContent() ) |
| 305 | + FormatJson::decode( $response ) |
304 | 306 | ); |
| 307 | + |
| 308 | + wfRunHooks( 'PushAPIAfterImagePush', array( $title, $target, $token, $response ) ); |
305 | 309 | } |
306 | 310 | else { |
307 | 311 | $this->dieUsage( wfMsg( 'push-special-err-push-failed' ), 'page-push-failed' ); |