r95754 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95753‎ | r95754 | r95755 >
Date:11:22, 30 August 2011
Author:nikerabbit
Status:ok
Tags:
Comment:
Removed efTranslateCheckPT() - will just fail if tables are not installed like other extensions do
Modified paths:
  • /trunk/extensions/Translate/PageTranslation.i18n.php (modified) (history)
  • /trunk/extensions/Translate/Translate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/Translate.php
@@ -538,13 +538,6 @@
539539 // Hook for database schema.
540540 $wgHooks['LoadExtensionSchemaUpdates'][] = 'PageTranslationHooks::schemaUpdates';
541541
542 - // Do not activate hooks if not setup properly
543 - global $wgEnablePageTranslation;
544 - if ( !efTranslateCheckPT() ) {
545 - $wgEnablePageTranslation = false;
546 - return true;
547 - }
548 -
549542 // Fuzzy tags for speed.
550543 $wgHooks['ArticleSaveComplete'][] = 'TranslateEditAddons::onSave';
551544
@@ -652,52 +645,6 @@
653646 }
654647
655648 /**
656 - * Checks if page translation was set up properly.
657 - * @ingroup PageTranslation
658 - * @private
659 - */
660 -function efTranslateCheckPT() {
661 - global $wgHooks, $wgMemc, $wgCommandLineMode;
662 -
663 - # Short circuit tests on cli, useless db trip and no reporting.
664 - if ( $wgCommandLineMode ) {
665 - return true;
666 - }
667 -
668 - $version = "3"; # Must be a string
669 - $memcKey = wfMemcKey( 'pt' );
670 - $ok = $wgMemc->get( $memcKey );
671 -
672 - if ( $ok === $version ) {
673 - return true;
674 - }
675 -
676 - $dbw = wfGetDB( DB_MASTER );
677 - if ( !$dbw->tableExists( 'revtag' ) ) {
678 - $wgHooks['SiteNoticeAfter'][] = array( 'efTranslateCheckWarn', 'tpt-install' );
679 - return false;
680 - }
681 -
682 - $wgMemc->set( $memcKey, $version );
683 - return true;
684 -}
685 -
686 -/**
687 - * Replaces the sitenotice with a warning that the extension is not
688 - * set up properly. Also disables caching to avoid the notices getting
689 - * stuck.
690 - * @param $msg \string Message key
691 - * @param $sitenotice \string
692 - * @return \bool true
693 - */
694 -function efTranslateCheckWarn( $msg, &$sitenotice ) {
695 - global $wgOut;
696 - $sitenotice = wfMsg( $msg );
697 - $wgOut->enableClientCache( false );
698 - return true;
699 -}
700 -
701 -/**
702649 * Registers \<languages> tag with the parser.
703650 * @param $parser Parser
704651 * @return \bool true
Index: trunk/extensions/Translate/PageTranslation.i18n.php
@@ -78,8 +78,6 @@
7979 'tpt-unknown-page' => 'This namespace is reserved for content page translations.
8080 The page you are trying to edit does not seem to correspond any page marked for translation.',
8181
82 - 'tpt-install' => 'Run php maintenance/update.php or web install to enable page translation feature.',
83 -
8482 'tpt-render-summary' => 'Updating to match new version of source page',
8583
8684 'tpt-download-page' => 'Export page with translations',

Status & tagging log