r91888 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91887‎ | r91888 | r91889 >
Date:17:03, 11 July 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
added 2 new hooks
Modified paths:
  • /trunk/extensions/Push/RELEASE-NOTES (modified) (history)
  • /trunk/extensions/Push/api/ApiPush.php (modified) (history)
  • /trunk/extensions/Push/api/ApiPushImages.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Push/RELEASE-NOTES
@@ -4,6 +4,11 @@
55 Latest version of the release notes: http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/Push/RELEASE-NOTES?view=co
66
77
 8+=== Version 1.1 ===
 9+2011-0x-xx
 10+
 11+* Added PushAPIAfterPush and PushAPIAfterImagePush hooks to the API modules.
 12+
813 === Version 1.0 ===
914 2011-05-26
1015
Index: trunk/extensions/Push/api/ApiPush.php
@@ -113,8 +113,6 @@
114114 'lgpassword' => $password
115115 );
116116
117 - //static $fail = 0;$fail++;
118 -
119117 if ( !is_null( $token ) ) {
120118 $requestData['lgtoken'] = $token;
121119 }
@@ -352,7 +350,9 @@
353351 $status = $req->execute();
354352
355353 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 ) );
357357 }
358358 else {
359359 $this->dieUsage( wfMsg( 'push-special-err-push-failed' ), 'page-push-failed' );
Index: trunk/extensions/Push/api/ApiPushImages.php
@@ -295,12 +295,16 @@
296296
297297 $status = $req->execute();
298298
299 - if ( $status->isOK() ) {
 299+ if ( $status->isOK() ) {
 300+ $response = $req->getContent();
 301+
300302 $this->getResult()->addValue(
301303 null,
302304 null,
303 - FormatJson::decode( $req->getContent() )
 305+ FormatJson::decode( $response )
304306 );
 307+
 308+ wfRunHooks( 'PushAPIAfterImagePush', array( $title, $target, $token, $response ) );
305309 }
306310 else {
307311 $this->dieUsage( wfMsg( 'push-special-err-push-failed' ), 'page-push-failed' );

Status & tagging log