In your extension.json have something like
You should also register your config variables in extension.json. For instance:
The callback is executed during the setup process, after the LocalSettings has been processed in total. It is not called directly when wfLoadExtension('Iframe') is called. So you can add your setting after the wfLoadExtension('Iframe')-call:
$wgIFrameExternalJSONFile = __DIR__ . '/nice.json';
Inside the onRegistration() method, you can either use $GLOBALS or use the ConfigFactory to access the setting:
$json = $GLOBALS['wgIFrameExternalJSONFile']
$configFactory = MediaWikiServices::getInstance()->getConfigFactory();
$configFactory->register( 'IFrame', 'GlobalVarConfig::newInstance' ); // this is necessary due to a bug in the extension registration process, see 
$myConfig = $configFactory->makeConfig( 'Iframe' );
$json = $myConfig->get( 'IFrameExternalJSONFile' )
I know, the use of the config factory looks like a little bit of an overkill, however since mw wants to steer away from using globals, this is the safer way to go.
If this email is rather brief, it is not meant to be impolite but to respect your time.
http://five.sentenc.es No trees were killed to send this message, but a large number of electrons were terribly inconvenienced
> -----Ursprüngliche Nachricht-----
> Von: MediaWiki-l [mailto:[hidden email]] Im
> Auftrag von Sigbert Klinke
> Gesendet: Dienstag, 13. Februar 2018 10:22
> An: MediaWiki announcements and site admin list <mediawiki-
> [hidden email]>
> Betreff: [MediaWiki-l] extension.json, onRegistration
> for my Iframe extension I need to load some data. Since the data come from
> a file I did not put it into extension.json, but I defined in my class a function
> onRegistration with sets a global variable.
> However, it turned out that in LocalSettings.php I can not set the global
> variable (after calling wfLoadExtesnion('Iframe') ), var_dump delivers NULL
> rather than my file data.
> Question: where I have to put the reading of my file data (if not into
> onRegistration) ?
> Thanks Sigbert
> https://hu.berlin/sk > https://hu.berlin/mmstat3 >
> MediaWiki-l mailing list
> To unsubscribe, go to: