Cicalese has submitted this change and it was merged. Change subject: moved setup function into class ......................................................................
moved setup function into class Change-Id: I58aa81a90e30b759f8bd4f8f27ac034184ffeb8d --- M SemanticDependency.class.php M SemanticDependency.php 2 files changed, 21 insertions(+), 12 deletions(-) Approvals: Cicalese: Verified; Looks good to me, approved diff --git a/SemanticDependency.class.php b/SemanticDependency.class.php index 4ee1826..52c3ce2 100644 --- a/SemanticDependency.class.php +++ b/SemanticDependency.class.php @@ -27,6 +27,25 @@ /** * @since 1.0 * + * @param Parser &$parser + */ + public static function setup( &$parser ) { + + if ( !isset( $GLOBALS['SemanticDependency_Properties'] ) ) { + $GLOBALS['SemanticDependency_Properties'] = array(); + } + + if ( !isset( $GLOBALS['SemanticDependency_JobThreshold'] ) ) { + $GLOBALS['SemanticDependency_JobThreshold'] = 1; + } + + return true; + + } + + /** + * @since 1.0 + * * @param Store $store * @param SemanticData $semanticData */ diff --git a/SemanticDependency.php b/SemanticDependency.php index 25ef4dc..00365bd 100644 --- a/SemanticDependency.php +++ b/SemanticDependency.php @@ -40,20 +40,10 @@ $GLOBALS['wgAutoloadClasses']['SemanticDependency'] = __DIR__ . '/SemanticDependency.class.php'; -$GLOBALS['wgHooks']['ParserFirstCallInit'][] = - 'efSemanticDependencyParserFunction_Setup'; +$GLOBALS['wgHooks']['ParserFirstCallInit'][] = 'SemanticDependency::setup'; $GLOBALS['wgHooks']['SMWStore::updateDataAfter'][] = 'SemanticDependency::updateDataAfter'; + $GLOBALS['wgMessagesDirs']['SemanticDependency'] = __DIR__ . '/i18n'; $GLOBALS['wgExtensionMessagesFiles']['SemanticDependency'] = __DIR__ . '/SemanticDependency.i18n.php'; - -function efSemanticDependencyParserFunction_Setup ( & $parser ) { - if ( !isset( $GLOBALS['SemanticDependency_Properties'] ) ) { - $GLOBALS['SemanticDependency_Properties'] = array(); - } - if ( !isset( $GLOBALS['SemanticDependency_JobThreshold'] ) ) { - $GLOBALS['SemanticDependency_JobThreshold'] = 1; - } - return true; -} -- To view, visit https://gerrit.wikimedia.org/r/169562 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I58aa81a90e30b759f8bd4f8f27ac034184ffeb8d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SemanticDependency Gerrit-Branch: master Gerrit-Owner: Cicalese <cical...@mitre.org> Gerrit-Reviewer: Cicalese <cical...@mitre.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits