r99864 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99863‎ | r99864 | r99865 >
Date:09:40, 15 October 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
rem compat code and added version check
Modified paths:
  • /trunk/extensions/SemanticResultFormats/SemanticResultFormats.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/compat (deleted) (history)

Diff [purge]

Index: trunk/extensions/SemanticResultFormats/SemanticResultFormats.php
@@ -20,16 +20,20 @@
2121 die( 'Not an entry point.' );
2222 }
2323
 24+if ( version_compare( $wgVersion, '1.16', '<' ) ) {
 25+ die( '<b>Error:</b> This version of Maps requires MediaWiki 1.16 or above; use SRF 1.6.x for older versions.' );
 26+}
 27+
2428 // Show a warning if Semantic MediaWiki is not loaded.
2529 if ( ! defined( 'SMW_VERSION' ) ) {
2630 die( '<b>Error:</b> You need to have <a href="http://semantic-mediawiki.org/wiki/Semantic_MediaWiki">Semantic MediaWiki</a> installed in order to use <a href="http://www.mediawiki.org/wiki/Extension:Semantic Result Formats">Semantic Result Formats</a>.<br />' );
2731 }
2832
2933 if ( version_compare( SMW_VERSION, '1.6.2 alpha', '<' ) ) {
30 - die( '<b>Error:</b> This version of Semantic Result Formats requires Semantic MediaWiki 1.6.3 or above; use Semantic Result Formats <= 1.6.2 for older versions of SMW.' );
 34+ die( '<b>Error:</b> This version of Semantic Result Formats requires Semantic MediaWiki 1.7 or above; use Semantic Result Formats 1.6.1 for older versions of SMW.' );
3135 }
3236
33 -define( 'SRF_VERSION', '1.6.3 alpha' );
 37+define( 'SRF_VERSION', '1.7 alpha' );
3438
3539 // Require the settings file.
3640 require dirname( __FILE__ ) . '/SRF_Settings.php';
@@ -39,11 +43,6 @@
4044
4145 $wgExtensionMessagesFiles['SemanticResultFormats'] = dirname( __FILE__ ) . '/SRF_Messages.php';
4246
43 -// To ensure Semantic Result Formats works with pre-1.16 MediaWiki versions.
44 -if ( !class_exists( 'Html' ) ) {
45 - $wgAutoloadClasses['Html'] = dirname( __FILE__ ) . '/compat/Html.php';
46 -}
47 -
4847 // FIXME: hardcoded path
4948 $srfgScriptPath = $wgScriptPath . '/extensions/SemanticResultFormats';
5049 $srfgIP = dirname( __FILE__ );

Follow-up revisions

RevisionCommit summaryAuthorDate
r99865Follow up to r99864;jeroendedauw09:42, 15 October 2011