http://www.mediawiki.org/wiki/Special:Code/MediaWiki/95754
Revision: 95754
Author: nikerabbit
Date: 2011-08-30 11:22:56 +0000 (Tue, 30 Aug 2011)
Log Message:
-----------
Removed efTranslateCheckPT() - will just fail if tables are not installed like
other extensions do
Modified Paths:
--------------
trunk/extensions/Translate/PageTranslation.i18n.php
trunk/extensions/Translate/Translate.php
Modified: trunk/extensions/Translate/PageTranslation.i18n.php
===================================================================
--- trunk/extensions/Translate/PageTranslation.i18n.php 2011-08-30 11:21:24 UTC
(rev 95753)
+++ trunk/extensions/Translate/PageTranslation.i18n.php 2011-08-30 11:22:56 UTC
(rev 95754)
@@ -78,8 +78,6 @@
'tpt-unknown-page' => 'This namespace is reserved for content page
translations.
The page you are trying to edit does not seem to correspond any page marked
for translation.',
- 'tpt-install' => 'Run php maintenance/update.php or web install to
enable page translation feature.',
-
'tpt-render-summary' => 'Updating to match new version of source page',
'tpt-download-page' => 'Export page with translations',
Modified: trunk/extensions/Translate/Translate.php
===================================================================
--- trunk/extensions/Translate/Translate.php 2011-08-30 11:21:24 UTC (rev
95753)
+++ trunk/extensions/Translate/Translate.php 2011-08-30 11:22:56 UTC (rev
95754)
@@ -538,13 +538,6 @@
// Hook for database schema.
$wgHooks['LoadExtensionSchemaUpdates'][] =
'PageTranslationHooks::schemaUpdates';
- // Do not activate hooks if not setup properly
- global $wgEnablePageTranslation;
- if ( !efTranslateCheckPT() ) {
- $wgEnablePageTranslation = false;
- return true;
- }
-
// Fuzzy tags for speed.
$wgHooks['ArticleSaveComplete'][] = 'TranslateEditAddons::onSave';
@@ -652,52 +645,6 @@
}
/**
- * Checks if page translation was set up properly.
- * @ingroup PageTranslation
- * @private
- */
-function efTranslateCheckPT() {
- global $wgHooks, $wgMemc, $wgCommandLineMode;
-
- # Short circuit tests on cli, useless db trip and no reporting.
- if ( $wgCommandLineMode ) {
- return true;
- }
-
- $version = "3"; # Must be a string
- $memcKey = wfMemcKey( 'pt' );
- $ok = $wgMemc->get( $memcKey );
-
- if ( $ok === $version ) {
- return true;
- }
-
- $dbw = wfGetDB( DB_MASTER );
- if ( !$dbw->tableExists( 'revtag' ) ) {
- $wgHooks['SiteNoticeAfter'][] = array( 'efTranslateCheckWarn',
'tpt-install' );
- return false;
- }
-
- $wgMemc->set( $memcKey, $version );
- return true;
-}
-
-/**
- * Replaces the sitenotice with a warning that the extension is not
- * set up properly. Also disables caching to avoid the notices getting
- * stuck.
- * @param $msg \string Message key
- * @param $sitenotice \string
- * @return \bool true
- */
-function efTranslateCheckWarn( $msg, &$sitenotice ) {
- global $wgOut;
- $sitenotice = wfMsg( $msg );
- $wgOut->enableClientCache( false );
- return true;
-}
-
-/**
* Registers \<languages> tag with the parser.
* @param $parser Parser
* @return \bool true
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs