Is there a reason a bunch of paths get set in Setup.php, rather than DefaultSettings.php? Or rather, is there any reason not to change this?
Some problems I've seen with it:
* It's confusing—people look up a variable like $wgStylePath in DefaultSettings.php only to find that it's false and magically gets set to "{$wgScriptPath}/skins" somewhere else.
* Because Setup.php is included after Local/DefaultSettings.php, you can't necessarily depend on the paths that are set there For instance, setting $wgLogo in LocalSettings.php will use the wrong path unless you set $wgStylePath too or don't rely on it at all < http://www.mediawiki.org/w/index.php?title=Manual_talk:$wgStylePath&oldi...
On Fri, Oct 23, 2009 at 11:52 PM, Benjamin Lees emufarmers@gmail.com wrote:
Is there a reason a bunch of paths get set in Setup.php, rather than DefaultSettings.php? Or rather, is there any reason not to change this?
Some problems I've seen with it:
- It's confusing—people look up a variable like $wgStylePath in
DefaultSettings.php only to find that it's false and magically gets set to "{$wgScriptPath}/skins" somewhere else.
- Because Setup.php is included after Local/DefaultSettings.php, you can't
necessarily depend on the paths that are set there For instance, setting $wgLogo in LocalSettings.php will use the wrong path unless you set $wgStylePath too or don't rely on it at all < http://www.mediawiki.org/w/index.php?title=Manual_talk:$wgStylePath&oldi... _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
If you looked more closely, you'll see that these path settings are conditionally set when the administrator does not provide a value in LocalSettings. So if you set $wgStylePath to something, it should work. If you leave it alone, it will default to $wgScriptPath/skins. I suppose it could (can it?) be done in DefaultSettings instead of Setup, but I don't think it really matters; the end result is the same.
-Chad
On Sat, Oct 24, 2009 at 12:05 AM, Chad innocentkiller@gmail.com wrote:
On Fri, Oct 23, 2009 at 11:52 PM, Benjamin Lees emufarmers@gmail.com wrote:
Is there a reason a bunch of paths get set in Setup.php, rather than DefaultSettings.php? Or rather, is there any reason not to change this?
Some problems I've seen with it:
- It's confusing—people look up a variable like $wgStylePath in
DefaultSettings.php only to find that it's false and magically gets set to "{$wgScriptPath}/skins" somewhere else.
- Because Setup.php is included after Local/DefaultSettings.php, you
can't
necessarily depend on the paths that are set there For instance, setting $wgLogo in LocalSettings.php will use the wrong path unless you set $wgStylePath too or don't rely on it at all <
http://www.mediawiki.org/w/index.php?title=Manual_talk:$wgStylePath&oldi...
If you looked more closely, you'll see that these path settings are conditionally set when the administrator does not provide a value in LocalSettings. So if you set $wgStylePath to something, it should work. If you leave it alone, it will default to $wgScriptPath/skins. I suppose it could (can it?) be done in DefaultSettings instead of Setup, but I don't think it really matters; the end result is the same.
-Chad
It will get set to $wgScriptPath/skins by default, but not until it's too late if you're trying to define another path relative to it (and since that's what the default does, that's what most people will try to do).
Benjamin Lees wrote:
Is there a reason a bunch of paths get set in Setup.php, rather than DefaultSettings.php?
Because the default values of these paths depend on multiple sources. Your own example shows that. The default value for $wgStylePath is "{$wgScriptPath}/skins". That means that both $wgStylePath or $wgScriptPath can be set in order to change the resulting value of $wgStylePath.
And it is pretty common to set only $wgScriptPath in LocalSettings.php and have all the other paths automatically set to their defaults based on this value. That wouldn't be possible if these other paths were set in DefaultSettings.php, since by the time $wgScriptPath is reset in LocalSettings.php their values would be already fixed.
On Sat, Oct 24, 2009 at 9:49 AM, Juliano F. Ravasi ml@juliano.info wrote:
Benjamin Lees wrote:
Is there a reason a bunch of paths get set in Setup.php, rather than DefaultSettings.php?
Because the default values of these paths depend on multiple sources. Your own example shows that. The default value for $wgStylePath is "{$wgScriptPath}/skins". That means that both $wgStylePath or $wgScriptPath can be set in order to change the resulting value of $wgStylePath.
And it is pretty common to set only $wgScriptPath in LocalSettings.php and have all the other paths automatically set to their defaults based on this value. That wouldn't be possible if these other paths were set in DefaultSettings.php, since by the time $wgScriptPath is reset in LocalSettings.php their values would be already fixed.
I see. Thanks for the explanation.
I'd still like to fix the logo issue. Since $wgScriptPath is already set in LocalSettings.php by default, is there any reason not to add $wgLogo (and $wgStylePath, unless $wgLogo is changed to use $wgScriptPath/styles by default) too?
Benjamin Lees wrote:
I'd still like to fix the logo issue. Since $wgScriptPath is already set in LocalSettings.php by default, is there any reason not to add $wgLogo (and $wgStylePath, unless $wgLogo is changed to use $wgScriptPath/styles by default) too?
I'm not sure I understand your question correctly. You can set $wgLogo in LocalSettings.php, there is no problem with that. $wgLogo works exactly like the other variables: you may override its value directly, or you may override only $wgStylePath or $wgScriptPath. In the later case, it will use the default path, but relative to the script or style path you provide.
Juliano F. Ravasi wrote:
Benjamin Lees wrote:
I'd still like to fix the logo issue. Since $wgScriptPath is already set in LocalSettings.php by default, is there any reason not to add $wgLogo (and $wgStylePath, unless $wgLogo is changed to use $wgScriptPath/styles by default) too?
I'm not sure I understand your question correctly. You can set $wgLogo in LocalSettings.php, there is no problem with that. $wgLogo works exactly like the other variables: you may override its value directly, or you may override only $wgStylePath or $wgScriptPath. In the later case, it will use the default path, but relative to the script or style path you provide.
The problem people are running into is that the "default setting" (though its not set in DefaultSettings.php) for the logo uses $wgStylePath. However, you cannot use $wgStylePath in LocalSettings without overriding it, even if you want to use the default of "$wgScriptPath/skins".
On Sun, Oct 25, 2009 at 1:35 PM, Alex mrzmanwiki@gmail.com wrote:
The problem people are running into is that the "default setting" (though its not set in DefaultSettings.php) for the logo uses $wgStylePath. However, you cannot use $wgStylePath in LocalSettings without overriding it, even if you want to use the default of "$wgScriptPath/skins".
Right. I've added $wgStylePath and $wgLogo to the default LocalSettings.php file (r58133).
On Sun, Oct 25, 2009 at 11:30 AM, Steve VanSlyck s.vanslyck@spamcop.net wrote:
This issue was raised last there. Someone wrote in with a very nice email about some things need to be put in LocalSettings.php if for no other purpose than helping newbies learn. Logo path was one of these that should not have been droped from LocalSettings.php because it has to be explained over and over and over again, as this message thread shows.
This is another good point: people tend to get confused about the whole
"copy the setting from DefaultSettings.php to LocalSettings.php" thing. Do you have a link to or a copy of that email?
mediawiki-l@lists.wikimedia.org