Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Wikipedia: Mediawiki

Default path settings

 

 

Wikipedia mediawiki RSS feed   Index | Next | Previous | View Threaded


emufarmers at gmail

Oct 23, 2009, 8:52 PM

Post #1 of 15 (861 views)
Permalink
Default path settings

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&oldid=282848
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


innocentkiller at gmail

Oct 23, 2009, 9:05 PM

Post #2 of 15 (834 views)
Permalink
Re: Default path settings [In reply to]

On Fri, Oct 23, 2009 at 11:52 PM, Benjamin Lees <emufarmers[at]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&oldid=282848
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l[at]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

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


emufarmers at gmail

Oct 23, 2009, 9:42 PM

Post #3 of 15 (834 views)
Permalink
Re: Default path settings [In reply to]

On Sat, Oct 24, 2009 at 12:05 AM, Chad <innocentkiller[at]gmail.com> wrote:

> On Fri, Oct 23, 2009 at 11:52 PM, Benjamin Lees <emufarmers[at]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&oldid=282848
>
> 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).
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


ml at juliano

Oct 24, 2009, 6:49 AM

Post #4 of 15 (822 views)
Permalink
Re: Default path settings [In reply to]

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.


--
Juliano F. Ravasi ·· http://juliano.info/
5105 46CC B2B7 F0CD 5F47 E740 72CA 54F4 DF37 9E96

"A candle loses nothing by lighting another candle." -- Erin Majors

* NOTE: Don't try to reach me through this address, use "contact@" instead.

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


emufarmers at gmail

Oct 25, 2009, 12:31 AM

Post #5 of 15 (812 views)
Permalink
Re: Default path settings [In reply to]

On Sat, Oct 24, 2009 at 9:49 AM, Juliano F. Ravasi <ml[at]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?
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


ml at juliano

Oct 25, 2009, 8:21 AM

Post #6 of 15 (800 views)
Permalink
Re: Default path settings [In reply to]

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 ·· http://juliano.info/
5105 46CC B2B7 F0CD 5F47 E740 72CA 54F4 DF37 9E96

"A candle loses nothing by lighting another candle." -- Erin Majors

* NOTE: Don't try to reach me through this address, use "contact@" instead.

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


s.vanslyck at spamcop

Oct 25, 2009, 8:30 AM

Post #7 of 15 (799 views)
Permalink
Re: Default path settings [In reply to]

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.

----- Original Message -----
From: "Juliano F. Ravasi" <ml[at]juliano.info>
To: MediaWiki announcements and site admin list <mediawiki-l[at]lists.wikimedia.org>
Date: Sun, 25 Oct 2009 13:21:12 -0200
Subject: Re: [Mediawiki-l] Default path settings

> 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 ·· http://juliano.info/
> 5105 46CC B2B7 F0CD 5F47 E740 72CA 54F4 DF37 9E96
>
> "A candle loses nothing by lighting another candle." -- Erin Majors
>
> * NOTE: Don't try to reach me through this address, use "contact@" instead.
>
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l[at]lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>


mrzmanwiki at gmail

Oct 25, 2009, 10:35 AM

Post #8 of 15 (796 views)
Permalink
Re: Default path settings [In reply to]

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".

--
Alex (wikipedia:en:User:Mr.Z-man)

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


emufarmers at gmail

Oct 25, 2009, 2:22 PM

Post #9 of 15 (795 views)
Permalink
Re: Default path settings [In reply to]

On Sun, Oct 25, 2009 at 1:35 PM, Alex <mrzmanwiki[at]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[at]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 mailing list
MediaWiki-l[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


s.vanslyck at spamcop

Oct 25, 2009, 4:21 PM

Post #10 of 15 (792 views)
Permalink
Re: Default path settings [In reply to]

Sorry, but I do not. It was just part of the conversation here and if I
recall correctly it was posted shortly (1 month? 6 months) after the
MediaWiki version was released that removed from logo path from
LocalSettings.php.

----- Original Message -----
From: Benjamin Lees <emufarmers[at]gmail.com>

> 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?


> On Sun, Oct 25, 2009 at 11:30 AM, Steve VanSlyck <s.vanslyck[at]spamcop.net>
> wrote:
>
> > This issue was raised last [year]. 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.
> >


_______________________________________________
MediaWiki-l mailing list
MediaWiki-l[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


Platonides at gmail

Nov 10, 2009, 3:50 PM

Post #11 of 15 (381 views)
Permalink
Re: Default path settings [In reply to]

Ichiro Watanabe wrote:
> I think the key problem is that sometimes what is documented as "default value"
> of some variables does not correspond to the value of those variables in
> LocalSettings.php, which is what I (and apparently many other people) expected.
>
> So, for example, it is confusing to document that the default value of
> $wgStylePath is "{$wgScriptPath}/skins", because this is not (yet?) the case in
> LocalSettings.php, unless one explicitly assigns that value to the variable.
>
> I really hope that either this gets "fixed" or the documentation is clarified.
>
> Thank you.

I see what you mean. I don't think this can be "fixed", since you need
to wait after LocalSettings has been included to set those variables
which rely on other variables. So that leaves us with the option of
clarifying the documentation. As someone who has fallen on it, how do
you think it would be expressed to note that the default value that we
are reporting on those pages won't be effective until after
LocalSettings execution?


_______________________________________________
MediaWiki-l mailing list
MediaWiki-l[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


veryfurryfur at gmail

Nov 12, 2009, 5:53 AM

Post #12 of 15 (357 views)
Permalink
Re: Default path settings [In reply to]

Platonides wrote:
> I see what you mean. I don't think this can be "fixed", since you need
> to wait after LocalSettings has been included to set those variables
> which rely on other variables. So that leaves us with the option of
> clarifying the documentation. As someone who has fallen on it, how do
> you think it would be expressed to note that the default value that we
> are reporting on those pages won't be effective until after
> LocalSettings execution?

Thanks for listening.
I suppose a template with an appropriate wording, applied to all such
$wgVariables that have this funny default behaviour, would be good.
Mr.Z-man recently had a stab at this with

http://www.mediawiki.org/wiki/Manual:$wgLogo
<small>(note: set dynamically in Setup.php, not in
DefaultSettings.php)</small>

but to be honest I'm not sure if that clarifies the whole situation.

I would like to take one step back and ask a couple of questions

1. Do all $wgVariable defaults behave this way, or are there two kinds
of defaults, one that gets set before LocalSettings and one after?

2. In any case, who is actually interested in the latter class (i.e.
default values that are set *after* LocalSettings)? From my short
experience, the average installer and admin is not. Maybe we need to
make it clear that these default values are for use of extension
developers (just guessing here) as opposed to administrators. In fact,
if this is the case, then I would probably remove altogether this
confusing default documentation from what is the *user* (i.e. admin)
manual of MediaWiki - as opposed to what would be a developer's
manual.

Then of course we need to make sure that there are no inappropriate
references to these variable in prominent documents like the FAQ etc.
By inappropriate I mean stuff like the first block removed with this
change

http://www.mediawiki.org/w/index.php?title=Manual%3AFAQ&action=historysubmit&diff=282847&oldid=282803

Thanks

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


Platonides at gmail

Nov 12, 2009, 12:52 PM

Post #13 of 15 (352 views)
Permalink
Re: Default path settings [In reply to]

Ichiro Watanabe wrote:
> I would like to take one step back and ask a couple of questions
>
> 1. Do all $wgVariable defaults behave this way, or are there two kinds
> of defaults, one that gets set before LocalSettings and one after?

No. Only those (and all of them) that contain another $wgVariable into
its default value.

> 2. In any case, who is actually interested in the latter class (i.e.
> default values that are set *after* LocalSettings)? From my short
> experience, the average installer and admin is not. Maybe we need to
> make it clear that these default values are for use of extension
> developers (just guessing here) as opposed to administrators. In fact,
> if this is the case, then I would probably remove altogether this
> confusing default documentation from what is the *user* (i.e. admin)
> manual of MediaWiki - as opposed to what would be a developer's
> manual.

The same people.
Take for example $wgStylePath. Its default value is "{$wgScriptPath}/skins".
The admin may be interested in changing just $wgStylePath.
Or it may want to change $wgScriptPath, in which case (if he didn't also
set $wgStylePath), $wgStylePath will change to still be the skin
subfolder from $wgScriptPath.

I think it is only confusing if you look at DefaultSettings expecting to
see the default there and can't find it.


_______________________________________________
MediaWiki-l mailing list
MediaWiki-l[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


veryfurryfur at gmail

Nov 13, 2009, 6:57 PM

Post #14 of 15 (329 views)
Permalink
Re: Default path settings [In reply to]

> Platonides wrote:
> No. Only those (and all of them) that contain another $wgVariable into
> its default value.

OK, that makes sense now, thanks for the explanation.

> I think it is only confusing if you look at DefaultSettings expecting to
> see the default there and can't find it.

I think that's a separate issue, but it certainly is making things worse.

Let's see if I understand correctly:
1. DefaultSettings.php is run. Here all variables are set to the
default values, *except* those that are dependent on other variables,
which are set to false (as a placeholder).
2. LocalSettings.php is run. Here users can set any variables to
whatever they like.
3. Setup.php is run. Here any variables that are dependent on other
variables *and* that have not been customised in LocalSettings.php are
set to their default value, based on other variables that may or may
not have been changed in LocalSettings.php

If this is correct, I think the documentation does not make it clear.
Here are the changes I propose.

DefaultSettings.php, line 10, reads

* Note that since all these string interpolations are expanded
* before LocalSettings is included, if you localize something
* like $wgScriptPath, you must also localize everything that
* depends on it.

If my understanding is correct, then this is not only confusing, it is
wrong. I propose something like the following instead

* In this file, variables whose default values depend on other
* variables (for example $wgStylePath, which defaults to
* "{$wgScriptPath}/skins") are set to false.
* The sequence of execution is DefaultSettings.php >
LocalSettings.php > Setup.php
* The actual default value of these variables will only be set in Setup.php,
* taking into account any custom settings performed in LocalSettings.php.

Also in DefaultSettings.php, I propose changing these comments

$wgStylePath = false; ///< defaults to "{$wgScriptPath}/skins"

to something like

$wgStylePath = false; ///< will default to
"{$wgScriptPath}/skins" in Setup.php

Here there is a minor point of mantainability, in that if the default
value changes we need to change it both in Setup.php,
DefaultSettings.php and on the Manual page in MediaWiki's wiki. Let's
sidestep this issue for now.

Then there are the Manual pages. I propose the following note is
included in the Manual pages *of each variable* that has this
behaviour.

<small>(Note: Since the defult value of this variable depends on other
variables, such default value is set in Setup.php, after
LocalSettings.php is executed)</small>

If there are no objections, I'm happy to apply the changes to the
Manual. For the code comments, please let me know how to submit the
patches.
Thanks.

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


Platonides at gmail

Nov 14, 2009, 1:46 PM

Post #15 of 15 (307 views)
Permalink
Re: Default path settings [In reply to]

Ichiro Watanabe wrote:
> If this is correct, I think the documentation does not make it clear.
> Here are the changes I propose.

It is correct.

> DefaultSettings.php, line 10, reads
>
> * Note that since all these string interpolations are expanded
> * before LocalSettings is included, if you localize something
> * like $wgScriptPath, you must also localize everything that
> * depends on it.
>
> If my understanding is correct, then this is not only confusing, it is
> wrong.

That piece has been there since 2004 (r5032). Expanding the variables at
is _only_ done since 2007 (r18781).


In fact, there's a comment by brion on DefaultSettings about that
> * These various web and file path variables are set to their defaults
> * in Setup.php if they are not explicitly set from LocalSettings.php.
> * If you do override them, be sure to set them all!

Not sure why it says all of them have to be set. That looks like the old
behavior.
It _shouldn't_ be needed to change $wgMathPath if you change
$wgUploadPath (the *Path and *Directory should be changed by pairs, though).



> I propose something like the following instead
>
> * In this file, variables whose default values depend on other
> * variables (for example $wgStylePath, which defaults to
> * "{$wgScriptPath}/skins") are set to false.
> * The sequence of execution is DefaultSettings.php >
> LocalSettings.php > Setup.php
> * The actual default value of these variables will only be set in Setup.php,
> * taking into account any custom settings performed in LocalSettings.php.

Perhaps too verbose.
What about
> In this file, variables whose default values depend on other
> variables are set to false, and expanded after LocalSettings, so they can include your customizations.
> For more information, see http://www.mediawiki.org/wiki/Larger_explanation
?

> Also in DefaultSettings.php, I propose changing these comments
>
> $wgStylePath = false; ///< defaults to "{$wgScriptPath}/skins"
>
> to something like
>
> $wgStylePath = false; ///< will default to
> "{$wgScriptPath}/skins" in Setup.php
>
> Here there is a minor point of mantainability, in that if the default
> value changes we need to change it both in Setup.php,
> DefaultSettings.php and on the Manual page in MediaWiki's wiki. Let's
> sidestep this issue for now.

It's already duplocated, so no problem there.


> Then there are the Manual pages. I propose the following note is
> included in the Manual pages *of each variable* that has this
> behaviour.
>
> <small>(Note: Since the defult value of this variable depends on other
> variables, such default value is set in Setup.php, after
> LocalSettings.php is executed)</small>
>
> If there are no objections, I'm happy to apply the changes to the
> Manual. For the code comments, please let me know how to submit the
> patches.
> Thanks.

Open a bug in bugzilla (https://bugzilla.wikimedia.org/) and attach
there the patch.


_______________________________________________
MediaWiki-l mailing list
MediaWiki-l[at]lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Wikipedia mediawiki RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.