http://www.mediawiki.org/wiki/Special:Code/MediaWiki/70192

Revision: 70192
Author:   siebrand
Date:     2010-07-30 08:31:32 +0000 (Fri, 30 Jul 2010)

Log Message:
-----------
Remove obsolete and broken alias-export.php.

Per RobertL's analysis:
* alias-export.php uses a backend that is no longer in use and so is beyond 
repair as far as I can tell, it could probably be deprecated and deleted 
(unless there is a use I am missing);
* export-magic.php takes hideously long because it loops through every 
extension available, and then every language available for that group - causing 
~400 message loads for ~400 extensions... ~160,000 message loads per export! I 
think it would make more sense to do it the other way round, resulting in only 
400 message loads and a very efficient process.

magic-export-2.php will be the replacement of magic-export.php but is still in 
the works.

Removed Paths:
-------------
    trunk/extensions/Translate/scripts/alias-export.php

Deleted: trunk/extensions/Translate/scripts/alias-export.php
===================================================================
--- trunk/extensions/Translate/scripts/alias-export.php 2010-07-30 08:00:29 UTC 
(rev 70191)
+++ trunk/extensions/Translate/scripts/alias-export.php 2010-07-30 08:31:32 UTC 
(rev 70192)
@@ -1,75 +0,0 @@
-<?php
-/**
- * Script to export special page aliases of extensions.
- *
- * @author Niklas Laxstrom
- *
- * @copyright Copyright © 2008-2009, Niklas Laxström
- * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 
2.0 or later
- * @file
- */
-
-$optionsWithArgs = array( 'lang', 'target' );
-require( dirname( __FILE__ ) . '/cli.inc' );
-
-function showUsage() {
-       STDERR( <<<EOT
-Alias exporter.
-
-Usage: php alias-export.php [options...]
-
-Options:
-  --target      Target directory for exported files
-  --lang        Comma separated list of language codes or *
-EOT
-);
-       exit( 1 );
-}
-
-if ( isset( $options['help'] ) || $args === 1 ) {
-       showUsage();
-}
-
-if ( !isset( $options['target'] ) ) {
-       STDERR( "You need to specify target directory" );
-       exit( 1 );
-}
-if ( !isset( $options['lang'] ) ) {
-       STDERR( "You need to specify languages to export" );
-       exit( 1 );
-}
-
-if ( !is_writable( $options['target'] ) ) {
-       STDERR( "Target directory is not writable" );
-       exit( 1 );
-}
-
-$langs = Cli::parseLanguageCodes( $options['lang'] );
-
-$groups = MessageGroups::singleton()->getGroups();
-
-foreach ( $groups as $group ) {
-       if ( !$group instanceof ExtensionMessageGroup ) {
-               continue;
-       }
-
-       $file = $group->getAliasFile();
-
-       $groupId = $group->getId();
-
-       if ( $file !== null ) {
-               // Fake a group
-               $group = new AliasMessageGroup( $group->getId() );
-               $group->setMessageFile( $file );
-
-               // FIXME: getVariableNameAlias() is not read from 
mediawiki-defines.txt here apparently.
-               // Hacked this one exception in for now
-               if ( $groupId == 'ext-wikilog' ) {
-                       $group->setVariableNameAlias( 'specialPageAliases' );
-               } else {
-                       $group->setVariableName( $group->getVariableNameAlias() 
);
-               }
-               $writer = $group->getWriter();
-               $writer->fileExport( $langs, $options['target'] );
-       }
-}



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to