r94494 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94493‎ | r94494 | r94495 >
Date:08:05, 15 August 2011
Author:yaron
Status:deferred
Tags:
Comment:
Moved checking of existence of Semantic MediaWiki out of SF_FormLinker.php and into main file, SemanticForms.php - provides better checking if SMW is included after SF (which should result in an error message).
Modified paths:
  • /trunk/extensions/SemanticForms/SemanticForms.php (modified) (history)
  • /trunk/extensions/SemanticForms/includes/SF_FormLinker.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/SemanticForms.php
@@ -36,6 +36,10 @@
3737
3838 if ( !defined( 'MEDIAWIKI' ) ) die();
3939
 40+if ( !defined( 'SMW_VERSION' ) ) {
 41+ die( "ERROR: <a href=\"http://semantic-mediawiki.org\">Semantic MediaWiki</a> must be installed for Semantic Forms to run!" );
 42+}
 43+
4044 define( 'SF_VERSION', '2.2.1' );
4145
4246 $wgExtensionCredits[defined( 'SEMANTIC_EXTENSION_TYPE' ) ? 'semantic' : 'specialpage'][] = array(
Index: trunk/extensions/SemanticForms/includes/SF_FormLinker.php
@@ -28,10 +28,6 @@
2929 * in the wiki.
3030 */
3131 static function getIncomingProperties( $title ) {
32 - // produce a useful error message if SMW isn't installed
33 - if ( ! function_exists( 'smwfGetStore' ) ) {
34 - die( "ERROR: <a href=\"http://semantic-mediawiki.org\">Semantic MediaWiki</a> must be installed for Semantic Forms to run!" );
35 - }
3632 $store = smwfGetStore();
3733 // SMW 1.6+
3834 if ( class_exists( 'SMWDataItem' ) ) {
@@ -138,11 +134,6 @@
139135
140136 global $sfgContLang;
141137
142 - // Produce a useful error message if SMW isn't installed.
143 - if ( ! function_exists( 'smwfGetStore' ) ) {
144 - die( "ERROR: <a href=\"http://semantic-mediawiki.org\">Semantic MediaWiki</a> must be installed for Semantic Forms to run!" );
145 - }
146 -
147138 $store = smwfGetStore();
148139 $subject = Title::makeTitleSafe( $page_namespace, $page_name );
149140 $form_names = SFUtils::getSMWPropertyValues( $store, $subject, $prop_smw_id );