Yaron Koren has uploaded a new change for review. https://gerrit.wikimedia.org/r/312837
Change subject: SMW 1.9 required ...................................................................... SMW 1.9 required Change-Id: I9439511ffc966cfc54d4fa393ac34e592e7833f0 --- M ED_ParserFunctions.php M README 2 files changed, 7 insertions(+), 46 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ExternalData refs/changes/37/312837/2 diff --git a/ED_ParserFunctions.php b/ED_ParserFunctions.php index 2fb5d61..d26979d 100644 --- a/ED_ParserFunctions.php +++ b/ED_ParserFunctions.php @@ -581,36 +581,16 @@ if ( $i == 0 ) continue; $subobjectArgs[] = $value; } - if ( class_exists( 'SMW\SubobjectParserFunction' ) ) { - // SMW 1.9+ - $instance = \SMW\ParserFunctionFactory::newFromParser( $parser )->getSubobjectParser(); - return $instance->parse( new SMW\ParserParameterFormatter( $subobjectArgs ) ); - } elseif ( class_exists( 'SMW\SubobjectHandler' ) ) { - // Old version of SMW 1.9 - can be removed at some point - call_user_func_array( array( 'SMW\SubobjectHandler', 'render' ), $subobjectArgs ); - } elseif ( class_exists( 'SMW\SubobjectParser' ) ) { - // Old version of SMW 1.9 - can be removed at some point - call_user_func_array( array( 'SMW\SubobjectParser', 'render' ), $subobjectArgs ); - } elseif ( class_exists( 'SMW\Subobject' ) ) { - // Old version of SMW 1.9 - can be removed at some point - call_user_func_array( array( 'SMW\Subobject', 'render' ), $subobjectArgs ); - } else { - // SMW 1.8 - call_user_func_array( array( 'SMWSubobject', 'render' ), $subobjectArgs ); - } - return; + + // SMW 1.9+ + $instance = \SMW\ParserFunctionFactory::newFromParser( $parser )->getSubobjectParser(); + return $instance->parse( new SMW\ParserParameterFormatter( $subobjectArgs ) ); } /** * Render the #store_external_table parser function */ static function doStoreExternalTable( &$parser ) { - global $smwgDefaultStore; - - if ( $smwgDefaultStore != 'SMWSQLStore3' && ! class_exists( 'SIOHandler' ) ) { - // If SQLStore3 is not installed, we need SIO. - return EDUtils::formatErrorMessage( 'Semantic Internal Objects is not installed' ); - } global $edgValues; $params = func_get_args(); @@ -651,26 +631,7 @@ } } - // If SQLStore3 is being used, we can call #subobject - - // that's what #set_internal would call anyway, so - // we're cutting out the middleman. - if ( $smwgDefaultStore == 'SMWSQLStore3' ) { - self::callSubobject( $parser, $params ); - continue; - } - - // Add $parser to the beginning of the $params array, - // and pass the whole thing in as arguments to - // doSetInternal, to mimic a call to #set_internal. - array_unshift( $params, $parser ); - // As of PHP 5.3.1, call_user_func_array() requires that - // the function params be references. Workaround via - // http://stackoverflow.com/questions/2045875/pass-by-reference-problem-with-php-5-3-1 - $refParams = array(); - foreach ( $params as $key => $value ) { - $refParams[$key] = &$params[$key]; - } - call_user_func_array( array( 'SIOHandler', 'doSetInternal' ), $refParams ); + self::callSubobject( $parser, $params ); } return null; } diff --git a/README b/README index ce4a4fa..15f2141 100644 --- a/README +++ b/README @@ -42,8 +42,8 @@ * #display_external_table is like #for_external_table, but passes the values of each row to a template, which handles the formatting. -* #store_external_table mimics a call to the Semantic Internal Objects -extension's #set_internal parser function onto each row retrieved by +* #store_external_table mimics a call to the Semantic MediaWiki +extension's #subobject parser function onto each row retrieved by any of the #get_*_data functions, in order to store the entire array of data semantically. -- To view, visit https://gerrit.wikimedia.org/r/312837 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9439511ffc966cfc54d4fa393ac34e592e7833f0 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/ExternalData Gerrit-Branch: master Gerrit-Owner: Yaron Koren <yaro...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits