r73252 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73251‎ | r73252 | r73253 >
Date:21:56, 17 September 2010
Author:tparscal
Status:ok (Comments)
Tags:
Comment:
Skeleton extension code
Modified paths:
  • /trunk/extensions/Entities/Entities.alias.php (added) (history)
  • /trunk/extensions/Entities/Entities.hooks.php (added) (history)
  • /trunk/extensions/Entities/Entities.i18n.php (added) (history)
  • /trunk/extensions/Entities/Entities.php (added) (history)
  • /trunk/extensions/Entities/SpecialEntities.php (added) (history)

Diff [purge]

Index: trunk/extensions/Entities/Entities.alias.php
@@ -0,0 +1,13 @@
 2+<?php
 3+/**
 4+ * Special page aliases for Entities extension
 5+ *
 6+ * @file
 7+ * @ingroup Extensions
 8+ */
 9+
 10+$aliases = array();
 11+
 12+$aliases['en'] = array(
 13+ 'Entities' => array( 'Entities' ),
 14+);
\ No newline at end of file
Property changes on: trunk/extensions/Entities/Entities.alias.php
___________________________________________________________________
Added: svn:eol-style
115 + native
Index: trunk/extensions/Entities/Entities.i18n.php
@@ -0,0 +1,25 @@
 2+<?php
 3+/**
 4+ * Internationalisation for Entities extension
 5+ *
 6+ * @file
 7+ * @ingroup Extensions
 8+ */
 9+
 10+$messages = array();
 11+
 12+/** English
 13+ * @author Trevor Parscal
 14+ */
 15+$messages['en'] = array(
 16+ 'entities' => 'Entities',
 17+ 'entities-desc' => 'Access entity information',
 18+ 'entities-title' => 'Entities',
 19+);
 20+
 21+/** Message documentation (Message documentation)
 22+ * @author Trevor Parscal
 23+ */
 24+$messages['qqq'] = array(
 25+ 'entities-desc' => '{{desc}}',
 26+);
Property changes on: trunk/extensions/Entities/Entities.i18n.php
___________________________________________________________________
Added: svn:eol-style
127 + native
Index: trunk/extensions/Entities/Entities.php
@@ -0,0 +1,28 @@
 2+<?php
 3+/**
 4+ * Entities extension
 5+ *
 6+ * @file
 7+ * @ingroup Extensions
 8+ *
 9+ * @author Trevor Parscal <tparscal.kattouw@gmail.com>
 10+ * @license GPL v2 or later
 11+ * @version 0.1.0
 12+ */
 13+
 14+/* Setup */
 15+
 16+$wgExtensionCredits['other'][] = array(
 17+ 'path' => __FILE__,
 18+ 'name' => 'Entities',
 19+ 'author' => array( 'Trevor Parscal' ),
 20+ 'version' => '0.1.0',
 21+ 'url' => 'http://www.mediawiki.org/wiki/Extension:Entities',
 22+ 'descriptionmsg' => 'entities-desc',
 23+);
 24+$wgAutoloadClasses['EntitiesHooks'] = dirname( __FILE__ ) . '/Entities.hooks.php';
 25+$wgAutoloadClasses['SpecialEntities'] = dirname( __FILE__ ) . '/SpecialEntities.php';
 26+$wgSpecialPages['Entities'] = 'SpecialEntities';
 27+$wgSpecialPageGroups['Entities'] = 'wiki';
 28+$wgExtensionMessagesFiles['Entities'] = dirname( __FILE__ ) . '/Entities.i18n.php';
 29+$wgExtensionAliasesFiles['Entities'] = dirname( __FILE__ ) . '/Entities.alias.php';
Property changes on: trunk/extensions/Entities/Entities.php
___________________________________________________________________
Added: svn:eol-style
130 + native
Index: trunk/extensions/Entities/SpecialEntities.php
@@ -0,0 +1,26 @@
 2+<?php
 3+/**
 4+ * Special:Entities
 5+ *
 6+ * @file
 7+ * @ingroup Extensions
 8+ */
 9+
 10+class SpecialEntities extends SpecialPage {
 11+
 12+ /* Methods */
 13+
 14+ function __construct() {
 15+ parent::__construct( 'Entities' );
 16+ }
 17+
 18+ function execute( $par ) {
 19+ global $wgOut;
 20+
 21+ $this->setHeaders();
 22+
 23+ $wgOut->setPageTitle( wfMsg( 'entities-title' ) );
 24+
 25+ $wgOut->addHtml( '<p>Hello special page!</p>' );
 26+ }
 27+}
Property changes on: trunk/extensions/Entities/SpecialEntities.php
___________________________________________________________________
Added: svn:eol-style
128 + native
Index: trunk/extensions/Entities/Entities.hooks.php
@@ -0,0 +1,13 @@
 2+<?php
 3+/**
 4+ * Hooks for Entities extension
 5+ *
 6+ * @file
 7+ * @ingroup Extensions
 8+ */
 9+
 10+class EntitiesHooks {
 11+
 12+ /* Static Methods */
 13+
 14+}
Property changes on: trunk/extensions/Entities/Entities.hooks.php
___________________________________________________________________
Added: svn:eol-style
115 + native

Comments

#Comment by Nikerabbit (talk | contribs)   06:33, 18 September 2010

It seems you often don't have a trailing new line in files, like Entities.alias.php in this case. I also wonder if three level version numbers for extensions are really necessary, I'd go for two or even one. Even MediaWiki practically uses only two levels. Maybe if the first level would be the same as latest MediaWiki version it is compatible with...?

#Comment by Trevor Parscal (WMF) (talk | contribs)   17:35, 20 September 2010

Yeah, I should add the trailing newlines for sure. As for the version numbers, I'm not perfectly following but generally believe in http://semver.org/ - perhaps there should be more discussion about our use of version numbers in various places.

Status & tagging log