Or you could create your own database table for your extension.
Depending on how formal you want to be, you can just ask installers to
run some SQL before installing, or follow the conventions here:
http://www.mediawiki.org/wiki/Manual:Extensions#Adding_database_tables
What are you really trying to do though? Your question feels a bit off,
like what you're doing could be better accomplished another way.
On 04/08/2010 05:40 AM, Roan Kattouw wrote:
2010/4/8 Prince Gerald Albert - ERS, HCL Tech
<princegeralda(a)hcl.in>in>:
Hi Geeks,
I want to know the best option to store a application wide setting / options in mediawiki
for an custom developed extension.
Say for example in my extension I need to create a global variable, if it does not exists
and reuse it.
I can't keep this in Localsettings.php file, since I need to generate on the fly
(once) and use it throughout the application
Right now it is one option and I may require to create multiple options and use it,
please guide me or give some links to go through
Do you need the variable to be application-wide and persists over
multiple requests? In that case, you could store it in the cache; it's
not technically guaranteed to last but it'll be pretty solid on most
setups.
global $wgMemc;
// to set
$wgMemc->set( wfMemcKey( 'yourKeyHere', 'maybeWithAParameter',
'orTwo'
), 'value' ); // Optional third param: expiry time in seconds
// to get, returns false if not set
$var = $wgMemc->get( wfMemcKey( 'yourKeyHere', 'maybeWithAParameter',
'orTwo' ) );
Roan Kattouw (Catrope)
_______________________________________________
Wikitech-l mailing list
Wikitech-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
--
Neil Kandalgaonkar ( <neilk(a)wikimedia.org>