MaxSem has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/205606

Change subject: Set calling function name in OAIHook::updatePage()
......................................................................

Set calling function name in OAIHook::updatePage()

Previously, it was set to an old function name before the OOP refactoring.
Now, all callers that cause a 'modify' action identify themselves clearly
in SQL log.

Change-Id: Ifac725734f10d9b4440d887691a11f8b03c94241
---
M OAIHooks.php
1 file changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OAI 
refs/changes/06/205606/1

diff --git a/OAIHooks.php b/OAIHooks.php
index e9ff9e4..a57a23f 100644
--- a/OAIHooks.php
+++ b/OAIHooks.php
@@ -1,6 +1,6 @@
 <?php
 class OAIHook {
-       static function updatePage( $id, $action ) {
+       static function updatePage( $id, $action, $fname = __METHOD__ ) {
                $dbw = wfGetDB( DB_MASTER );
                $dbw->replace( 'updates',
                        array( 'up_page' ),
@@ -8,7 +8,7 @@
                                'up_action'    => $action,
                                'up_timestamp' => $dbw->timestamp(),
                                'up_sequence'  => null ), # FIXME
-                       'oaiUpdatePage' );
+                       $fname );
                return true;
        }
 
@@ -56,7 +56,7 @@
                if( $revision ) {
                        // Only save a record for real updates, not null edits.
                        $id = $article->getID();
-                       self::updatePage( $id, 'modify' );
+                       self::updatePage( $id, 'modify', __METHOD__ );
                }
                return true;
        }
@@ -75,8 +75,8 @@
        }
 
        static function updateMove( $from, $to, $user, $fromid, $toid ) {
-               self::updatePage( $fromid, 'modify' );
-               self::updatePage( $toid, 'modify' );
+               self::updatePage( $fromid, 'modify', __METHOD__ . '-from' );
+               self::updatePage( $toid, 'modify', __METHOD__ . '-to' );
                return true;
        }
 
@@ -93,7 +93,7 @@
        static function updateUndelete( $title, $isnewid ) {
                $article = new Article($title);
                $id = $article->getID();
-               self::updatePage( $id, 'modify' );
+               self::updatePage( $id, 'modify', __METHOD__ );
                return true;
        }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/205606
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifac725734f10d9b4440d887691a11f8b03c94241
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OAI
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to