Last modified: 2013-10-23 18:33:50 UTC
Please declare all globals used or created in this extension. When this extension is included within a function rather than at file-scope, then globals are not being created/referenced correctly. Here's what I added to my version 1.8 SemanticMnediawiki.php to make it work in a wikifarm: global $wgExtensionCredits, $wgExtensionFunctions, $wgHooks, $wgExtensionMessagesFiles, $wgAutoloadClasses, $wgSpecialPageGroups, $wgSpecialPages, $wgGroupPermissions, $wgAvailableRights, $wgReservedUsernames, $wgResourceModules, $wgLogTypes, $wgLogNames, $wgLogHeaders, $wgLogActions, $wgAPIModules, $useJQuery, $wgAPIListModules, $wgVersion, $wgExtraNamespaces, $wgNamespacesWithSubpages, $wgActions, $wgJobClasses, $wgAjaxExportList, $wgEditPageFrameOptions, $wgLanguageCode, $wgParserTestFiles, $wgDefaultUserOptions, $wgExtensionAssetsPath, $wgExtensionAssetsFullPath, $useJQuery, $wgExtensionAliasesFiles ; Here is what I added to version 1.8 SMW_Settings.php: global $smwgScriptPath, $smwgScriptUrl; global $wgExtensionAssetsPath, $wgExtensionAssetsUrl; global $smwgIP, $smwgDefaultStore, $smwgSparqlDatabase, $smwgSparqlQueryEndpoint, $smwgSparqlUpdateEndpoint, $smwgSparqlDataEndpoint, $smwgSparqlDefaultGraph, $smwgHistoricTypeNamespace, $smwgNamespaceIndex, $smwgShowFactbox, $smwgShowFactboxEdit, $smwgToolboxBrowseLink, $smwgInlineErrors, $smwgUseCategoryHierarchy, $smwgCategoriesAsInstances, $smwgLinksInValues, $smwgDefaultNumRecurringEvents, $smwgMaxNumRecurringEvents, $smwgBrowseShowInverse, $smwgBrowseShowAll, $smwgSearchByPropertyFuzzy, $smwgTypePagingLimit, $smwgConceptPagingLimit, $smwgPropertyPagingLimit, $smwgMaxPropertyValues, $smwgQEnabled, $smwgQMaxLimit, $smwgIgnoreQueryErrors, $smwgQSubcategoryDepth, $smwgQSubpropertyDepth, $smwgQEqualitySupport, $smwgQSortingSupport, $smwgQRandSortingSupport, $smwgQDefaultNamespaces, $smwgQComparators, $smwStrictComparators, $smwgQMaxSize, $smwgQMaxDepth, $smwgQDefaultLimit, $smwgQMaxInlineLimit, $smwgQPrintoutLimit, $smwgQDefaultLinking, $smwgQConceptCaching, $smwgQConceptMaxSize, $smwgQConceptMaxDepth, $smwgQConceptFeatures, $smwgQConceptCacheLifetime, $smwgResultFormats, $smwgResultAliases, $smwgQuerySources, $smwgPDefaultType, $smwgRSSEnabled, $smwgRSSWithPages, $smwgAllowRecursiveExport, $smwgExportBacklinks, $smwgNamespace, $smwgMaxNonExpNumber, $smwgEnableUpdateJobs, $smwgNamespacesWithSemanticLinks, $smwgPageSpecialProperties, $smwgDeclarationProperties, $smwgTranslate, $smwgRAPPath, $smwgAdminRefreshStore, $smwgAutocompleteInSpecialAsk, $smwgAutoRefreshSubject, $smwgQFeatures ; To 1.8 SMW_Resources.php I've added: global $wgResourceModules; There may be other places because I'm getting unexpected results from queries.
Issues with declarative GLOBALS are not evident in the available unit tests [0], [1]. [0] https://integration.wikimedia.org/ci/job/mwext-SemanticMediaWiki-testextensions-master/1311/console [1] https://travis-ci.org/wikimedia/mediawiki-extensions-SemanticMediaWiki PS: As for the current master, Settings are no longer used as GLOBALSand provided explicitly through an interface [0] an either used during injection or through the ContextResource [2]. For more for information about GLOBALS, see [3]. [0] https://github.com/wikimedia/mediawiki-extensions-SemanticMediaWiki/blob/master/includes/Settings.php [1] https://github.com/wikimedia/mediawiki-extensions-SemanticMediaWiki/blob/master/includes/Setup.php#L117 [2] https://github.com/wikimedia/mediawiki-extensions-SemanticMediaWiki/blob/master/includes/context/BaseContext.php#L47 [3] http://php.net/manual/en/reserved.variables.globals.php