r78601 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78600‎ | r78601 | r78602 >
Date:15:56, 19 December 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Added two little hooks
Modified paths:
  • /trunk/extensions/Push/api/ApiPush.php (modified) (history)
  • /trunk/extensions/Push/api/ApiPushImages.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Push/api/ApiPush.php
@@ -217,9 +217,15 @@
218218 protected function doPush( Title $title, array $revision, array $targets ) {
219219 foreach ( $targets as $target ) {
220220 $token = $this->getEditToken( $title, $target );
221 -
 221+
222222 if ( $token !== false ) {
223 - $this->pushToTarget( $title, $revision, $target, $token );
 223+ $doPush = true;
 224+
 225+ wfRunHooks( 'PushAPIBeforePush', array( &$title, &$revision, &$target, &$token, &$doPush ) );
 226+
 227+ if ( $doPush ) {
 228+ $this->pushToTarget( $title, $revision, $target, $token );
 229+ }
224230 }
225231 }
226232 }
Index: trunk/extensions/Push/api/ApiPushImages.php
@@ -152,7 +152,13 @@
153153 $token = $this->getEditToken( $title, $target );
154154
155155 if ( $token !== false ) {
156 - $this->pushToTarget( $title, $target, $token );
 156+ $doPush = true;
 157+
 158+ wfRunHooks( 'PushAPIBeforeImagePush', array( &$title, &$target, &$token, &$doPush ) );
 159+
 160+ if ( $doPush ) {
 161+ $this->pushToTarget( $title, $target, $token );
 162+ }
157163 }
158164 }
159165 }

Status & tagging log