Re: [Wikitech-l] LocalSettings.php can set messages too?

2009-03-18 Thread Daniel Kinzler
jida...@jidanni.org schrieb:
 Reading http://meta.wikimedia.org/wiki/Help:System_messages, one
 wonders if one can set messages in LocalSettings.php instead of
 editing MediaWiki:Copyrightpage. However I just get 'Call to a member
 function addMessages() on a non-object'.

That's because the object isn't there yet when LocalSettings.php is read. The
config is read *before* initialization, of course. You can register a function
in wgExtensionFunctions, that will get called after setup. you can inject
messages there. But editing the system message on the wiki seems the much nicer
solution, don't you think?

-- daniel

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Re: [Wikitech-l] LocalSettings.php can set messages too?

2009-03-18 Thread Roan Kattouw
Daniel Kinzler schreef:
 jida...@jidanni.org schrieb:
 Reading http://meta.wikimedia.org/wiki/Help:System_messages, one
 wonders if one can set messages in LocalSettings.php instead of
 editing MediaWiki:Copyrightpage. However I just get 'Call to a member
 function addMessages() on a non-object'.
 
 That's because the object isn't there yet when LocalSettings.php is read. The
 config is read *before* initialization, of course. You can register a function
 in wgExtensionFunctions, that will get called after setup. you can inject
 messages there. But editing the system message on the wiki seems the much 
 nicer
 solution, don't you think?
 
Yeah, why would you want that? You can protect MediaWiki: pages too 
(although editing them is already restricted to sysops by default), so 
you could protect this particular page so that only you can edit it (add 
a right to $wgRestrictionLevels and make sure only you have it).

Roan Kattouw (Catrope)

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Re: [Wikitech-l] LocalSettings.php can set messages too?

2009-03-18 Thread Ilmari Karonen
Roan Kattouw wrote:

 Yeah, why would you want that? You can protect MediaWiki: pages too 
 (although editing them is already restricted to sysops by default), so 
 you could protect this particular page so that only you can edit it (add 
 a right to $wgRestrictionLevels and make sure only you have it).

Presumably he's not using memcached, and would like to avoid the extra 
database hits.  For such uses, it'd be kind of nice to have a simple way 
of customizing system messages via LocalSettings.php.

-- 
Ilmari Karonen

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Re: [Wikitech-l] LocalSettings.php can set messages too?

2009-03-18 Thread Daniel Kinzler
Ilmari Karonen schrieb:
 Roan Kattouw wrote:
 Yeah, why would you want that? You can protect MediaWiki: pages too 
 (although editing them is already restricted to sysops by default), so 
 you could protect this particular page so that only you can edit it (add 
 a right to $wgRestrictionLevels and make sure only you have it).
 
 Presumably he's not using memcached, and would like to avoid the extra 
 database hits.  For such uses, it'd be kind of nice to have a simple way 
 of customizing system messages via LocalSettings.php.

That db will be hit anyway, it needs to see if the message was overridden by
editing the wiki page.

-- daniel

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Re: [Wikitech-l] LocalSettings.php can set messages too?

2009-03-18 Thread Aryeh Gregor
On Wed, Mar 18, 2009 at 6:22 PM, Daniel Kinzler dan...@brightbyte.de wrote:
 That db will be hit anyway, it needs to see if the message was overridden by
 editing the wiki page.

Not if you disable $wgUseDatabaseMessages.

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


[Wikitech-l] LocalSettings.php can set messages too?

2009-03-17 Thread jidanni
Reading http://meta.wikimedia.org/wiki/Help:System_messages, one
wonders if one can set messages in LocalSettings.php instead of
editing MediaWiki:Copyrightpage. However I just get 'Call to a member
function addMessages() on a non-object'.

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l