[Mediawiki-l] Default path settings

Platonides Platonides at gmail.com
Sat Nov 14 21:46:29 UTC 2009


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.




More information about the MediaWiki-l mailing list