r64584 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64583‎ | r64584 | r64585 >
Date:23:09, 3 April 2010
Author:siebrand
Status:deferred
Tags:
Comment:
* stylize.php, trailing whitespace removed
* i18n for description message
* add support for ApiSVGProxy to Translate
Modified paths:
  • /trunk/extensions/ApiSVGProxy/ApiSVGProxy.body.php (modified) (history)
  • /trunk/extensions/ApiSVGProxy/ApiSVGProxy.i18n.php (added) (history)
  • /trunk/extensions/ApiSVGProxy/ApiSVGProxy.php (modified) (history)
  • /trunk/extensions/Translate/groups/mediawiki-defines.txt (modified) (history)

Diff [purge]

Index: trunk/extensions/ApiSVGProxy/ApiSVGProxy.i18n.php
@@ -0,0 +1,15 @@
 2+<?php
 3+/**
 4+ * Internationalisation file for extension ApiSVGProxy.
 5+ *
 6+ * @addtogroup Extensions
 7+*/
 8+
 9+$messages = array();
 10+
 11+/** English
 12+ * @author Roan Kattouw
 13+ */
 14+$messages['en'] = array(
 15+ 'apisvgproxy-desc' => 'Proxies SVG files from a (possibly remote) file repository to the local domain',
 16+);
Property changes on: trunk/extensions/ApiSVGProxy/ApiSVGProxy.i18n.php
___________________________________________________________________
Name: svn:eol-style
117 + native
Name: svn:keywords
218 + Id
Index: trunk/extensions/ApiSVGProxy/ApiSVGProxy.php
@@ -12,7 +12,7 @@
1313 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
1414 */
1515 # Alert the user that this is not a valid entry point to MediaWiki if they try to access the extension file directly.
16 -if( !defined( 'MEDIAWIKI' ) ) {
 16+if ( !defined( 'MEDIAWIKI' ) ) {
1717 echo <<<EOT
1818 To install the ApiSVGProxy extension, put the following line in LocalSettings.php:
1919 require_once( "\$IP/extensions/ApiSVGProxy/ApiSVGProxy.php" );
@@ -27,10 +27,12 @@
2828 'author' => 'Roan Kattouw',
2929 'url' => 'http://www.mediawiki.org/wiki/Extension:ApiSVGProxy',
3030 'version' => '1.0',
31 - 'description' => 'Proxies SVG files from a (possibly remote) file repository to the local domain',
 31+ 'descriptionmsg' => 'apisvgproxy-desc',
3232 );
3333
3434 // Set up the new special page
3535 $dir = dirname( __FILE__ ) . '/';
3636 $wgAutoloadClasses['ApiSVGProxy'] = $dir . 'ApiSVGProxy.body.php';
37 -$wgAPIModules['svgproxy'] = 'ApiSVGProxy';
\ No newline at end of file
 37+$wgAPIModules['svgproxy'] = 'ApiSVGProxy';
 38+
 39+$wgExtensionMessagesFiles['ApiSVGProxy'] = dirname( __FILE__ ) . '/ApiSVGProxy.i18n.php';
Index: trunk/extensions/ApiSVGProxy/ApiSVGProxy.body.php
@@ -11,8 +11,10 @@
1212 * @copyright Copyright © 2009 Roan Kattouw
1313 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
1414 */
15 -# Alert the user that this is not a valid entry point to MediaWiki if they try to access the extension file directly.
16 -if( !defined( 'MEDIAWIKI' ) ) {
 15+
 16+# Alert the user that this is not a valid entry point to MediaWiki if they try
 17+# to access the extension file directly.
 18+if ( !defined( 'MEDIAWIKI' ) ) {
1719 echo <<<EOT
1820 To install the ApiSVGProxy extension, put the following line in LocalSettings.php:
1921 require_once( "\$IP/extensions/ApiSVGProxy/ApiSVGProxy.php" );
@@ -31,20 +33,20 @@
3234 $file = wfFindFile( $title );
3335
3436 // Verify that the file exists and is an SVG file
35 - if( !$file ) {
36 - $this->dieUsage('The specified file does not exist',
37 - 'nosuchfile', 404);
 37+ if ( !$file ) {
 38+ $this->dieUsage( 'The specified file does not exist',
 39+ 'nosuchfile', 404 );
3840 }
39 - if( $file->getExtension() != 'svg' || $file->getMimeType() != 'image/svg+xml' ) {
40 - $this->dieUsage('The specified file is not an SVG file',
41 - 'notsvg', 403);
 41+ if ( $file->getExtension() != 'svg' || $file->getMimeType() != 'image/svg+xml' ) {
 42+ $this->dieUsage( 'The specified file is not an SVG file',
 43+ 'notsvg', 403 );
4244 }
4345
4446 // Grab the file's contents
4547 $contents = Http::get( $file->getFullUrl() );
46 - if( $contents === false ) {
47 - $this->dieUsage('The specified file could not be fetched',
48 - 'fetchfailed', 500);
 48+ if ( $contents === false ) {
 49+ $this->dieUsage( 'The specified file could not be fetched',
 50+ 'fetchfailed', 500 );
4951 }
5052
5153 // Output the file's contents raw
Index: trunk/extensions/Translate/groups/mediawiki-defines.txt
@@ -37,6 +37,8 @@
3838 aliasfile = APC/ViewAPC.alias.php
3939 descmsg = viewapc-desc
4040
 41+Api SVG Proxy
 42+
4143 Asksql
4244 aliasfile = Asksql/Asksql.alias.php
4345

Status & tagging log