Index: trunk/extensions/Translate/tag/RenderJob.php |
— | — | @@ -63,6 +63,7 @@ |
64 | 64 | |
65 | 65 | // Do the edit |
66 | 66 | $article->doEdit( $text, $summary, $flags ); |
| 67 | + SpecialPageTranslation::superDebug( __METHOD__, 'edit', $user, $title, $flags ); |
67 | 68 | |
68 | 69 | // User hack |
69 | 70 | $wgUser = $oldUser; |
Index: trunk/extensions/Translate/tag/SpecialPageTranslation.php |
— | — | @@ -44,15 +44,14 @@ |
45 | 45 | |
46 | 46 | // Check permissions |
47 | 47 | if ( $wgRequest->wasPosted() && !$this->user->matchEditToken( $wgRequest->getText( 'token' ) ) ) { |
| 48 | + self::superDebug( __METHOD__, "token failure", $this->user ); |
48 | 49 | $wgOut->permissionRequired( 'pagetranslation' ); |
49 | | - |
50 | 50 | return; |
51 | 51 | } |
52 | 52 | |
53 | 53 | // We are processing some specific page |
54 | 54 | if ( !$title->exists() ) { |
55 | 55 | $wgOut->addWikiMsg( 'tpt-nosuchpage', $title->getPrefixedText() ); |
56 | | - |
57 | 56 | return; |
58 | 57 | } |
59 | 58 | |
— | — | @@ -65,7 +64,7 @@ |
66 | 65 | $params = array( 'user' => $wgUser->getName() ); |
67 | 66 | $logger->addEntry( 'unmark', $page->getTitle(), null, array( serialize( $params ) ) ); |
68 | 67 | $wgOut->addWikiMsg( 'tpt-unmarked', $title->getPrefixedText() ); |
69 | | - |
| 68 | + self::superDebug( __METHOD__, "unmarked page", $this->user, $title ); |
70 | 69 | return; |
71 | 70 | } |
72 | 71 | |
— | — | @@ -84,7 +83,7 @@ |
85 | 84 | if ( $revision !== intval($title->getLatestRevID()) ) { |
86 | 85 | // We do want to notify the reviewer if the underlying page changes during review |
87 | 86 | $wgOut->addWikiMsg( 'tpt-oldrevision', $title->getPrefixedText(), $revision ); |
88 | | - |
| 87 | + self::superDebug( __METHOD__, "revision mismatch while marking", $this->user, $title, $revision, intval($title->getLatestRevID()) ); |
89 | 88 | return; |
90 | 89 | } |
91 | 90 | |
— | — | @@ -113,6 +112,7 @@ |
114 | 113 | return; |
115 | 114 | } |
116 | 115 | |
| 116 | + self::superDebug( __METHOD__, "marking page", $this->user, $title, $revision ); |
117 | 117 | $this->showPage( $page, $sections ); |
118 | 118 | } |
119 | 119 | |
— | — | @@ -443,6 +443,7 @@ |
444 | 444 | ); |
445 | 445 | |
446 | 446 | if ( !$status->isOK() ) { |
| 447 | + self::superDebug( __METHOD__, 'edit-fail', $this->user, $page->getTitle(), $status ); |
447 | 448 | return array( 'tpt-edit-failed', $status->getWikiText() ); |
448 | 449 | } |
449 | 450 | |
— | — | @@ -460,6 +461,8 @@ |
461 | 462 | $newrevision = $page->getTitle()->getLatestRevId(); |
462 | 463 | } |
463 | 464 | |
| 465 | + self::superDebug( __METHOD__, 'latestrev', $page->getTitle(), $newrevision ); |
| 466 | + |
464 | 467 | $inserts = array(); |
465 | 468 | $changed = array(); |
466 | 469 | |
— | — | @@ -514,6 +517,7 @@ |
515 | 518 | |
516 | 519 | public function addFuzzyTags( $page, $changed ) { |
517 | 520 | if ( !count( $changed ) ) { |
| 521 | + self::superDebug( __METHOD__, 'nochanged', $page->getTitle() ); |
518 | 522 | return; |
519 | 523 | } |
520 | 524 | |
— | — | @@ -547,6 +551,7 @@ |
548 | 552 | } |
549 | 553 | |
550 | 554 | if ( count( $inserts ) ) { |
| 555 | + self::superDebug( __METHOD__, 'inserts', $inserts ); |
551 | 556 | $db->replace( 'revtag', array( 'rt_type_page_revision' ), $inserts, __METHOD__ ); |
552 | 557 | } |
553 | 558 | } |
— | — | @@ -556,16 +561,34 @@ |
557 | 562 | $jobs = array(); |
558 | 563 | |
559 | 564 | foreach ( $titles as $t ) { |
| 565 | + self::superDebug( __METHOD__, 'renderjob', $t ); |
560 | 566 | $jobs[] = RenderJob::newJob( $t ); |
561 | 567 | } |
562 | 568 | |
563 | 569 | if ( count( $jobs ) < 10 ) { |
| 570 | + self::superDebug( __METHOD__, 'renderjob-immediate' ); |
564 | 571 | foreach ( $jobs as $j ) { |
565 | 572 | $j->run(); |
566 | 573 | } |
567 | 574 | } else { |
568 | 575 | // Use the job queue |
| 576 | + self::superDebug( __METHOD__, 'renderjob-delayed' ); |
569 | 577 | Job::batchInsert( $jobs ); |
570 | 578 | } |
571 | 579 | } |
| 580 | + |
| 581 | + public static function superDebug( $method, $msg /* varags */ ) { |
| 582 | + $args = func_get_args(); |
| 583 | + $args = array_slice( $args, 2 ); |
| 584 | + foreach ( $args as &$arg ) { |
| 585 | + if ( $arg instanceof User ) { |
| 586 | + $arg = array( 'user' => $arg->getName(), 'id' => $arg->getId() ); |
| 587 | + } elseif ( $arg instanceof Title ) { |
| 588 | + $arg = array( 'title' => $arg->getPrefixedText(), 'aid' => $arg->getArticleID() ); |
| 589 | + } |
| 590 | + $arg = serialize( $arg ); |
| 591 | + } |
| 592 | + |
| 593 | + wfDebugLog( 'pagetranslation', "$method: $msg [" . implode( " ", $args ) . "]\n" ); |
| 594 | + } |
572 | 595 | } |
Index: trunk/extensions/Translate/tag/PageTranslationHooks.php |
— | — | @@ -64,6 +64,7 @@ |
65 | 65 | $groupKey = self::titleToGroup( $title ); |
66 | 66 | $group = MessageGroups::getGroup( $groupKey ); |
67 | 67 | if ( !$group instanceof WikiPageMessageGroup ) { |
| 68 | + SpecialPageTranslation::superDebug( __METHOD__, 'not wp-group', $title, $user, $groupKey ); |
68 | 69 | return; |
69 | 70 | } |
70 | 71 | |
— | — | @@ -79,6 +80,7 @@ |
80 | 81 | list( , $code ) = TranslateUtils::figureMessage( $title->getDBkey() ); |
81 | 82 | global $wgTranslateDocumentationLanguageCode; |
82 | 83 | if ( $code !== $wgTranslateDocumentationLanguageCode ) { |
| 84 | + SpecialPageTranslation::superDebug( __METHOD__, 'ok', $title, $user ); |
83 | 85 | self::updateTranslationPage( $page, $code, $user, $flags, $summary ); |
84 | 86 | } |
85 | 87 | |