Hello. I tried many hooks, but I cannot find any, with which I can use for overwriting variale, that is defined in the LocalSettings.php. Any suggestions? Thanks. -MGrabovsky
65s.mg wrote:
Hello. I tried many hooks, but I cannot find any, with which I can use for overwriting variale, that is defined in the LocalSettings.php. Any suggestions? Thanks. -MGrabovsky
Don't override it. Just conditionally set it.
On Sun, Mar 16, 2008 at 6:15 PM, 65s.mg@atlas.cz wrote:
Hello. I tried many hooks, but I cannot find any, with which I can use for overwriting variale, that is defined in the LocalSettings.php. Any suggestions? Thanks. -MGrabovsky
There is no hook specifically for this purpose. There doesn't need to be: the variables are globals. You can set them from any hook you want. Just make sure the hook executes early enough that it's before the global is used elsewhere.
On 3/17/08, Simetrical Simetrical+wikilist@gmail.com wrote:
There is no hook specifically for this purpose. There doesn't need to be: the variables are globals. You can set them from any hook you want. Just make sure the hook executes early enough that it's before the global is used elsewhere.
I wonder if beforeConfiguration/afterConfiguration hooks would be desirable, before and after LocalSettings.php is included respectively.
Erm... there's a little issue with that idea... Do remember that extensions are defined inside of LocalSettings.php, and until loaded they don't have anything set inside of $wgHooks... So a beforeConfiguration hook would absolutely never be run by anything because nothing would be able to hook into it early enough. As for the afterConfiguration, generally we use $wgExtensionFunctions (Think that was the name) for this...
~Daniel Friesen(Dantman) of: -The Gaiapedia (http://gaia.wikia.com) -Wikia ACG on Wikia.com (http://wikia.com/wiki/Wikia_ACG) -and Wiki-Tools.com (http://wiki-tools.com)
Andrew Garrett wrote:
On 3/17/08, Simetrical Simetrical+wikilist@gmail.com wrote:
There is no hook specifically for this purpose. There doesn't need to be: the variables are globals. You can set them from any hook you want. Just make sure the hook executes early enough that it's before the global is used elsewhere.
I wonder if beforeConfiguration/afterConfiguration hooks would be desirable, before and after LocalSettings.php is included respectively.
On 3/17/08, DanTMan dan_the_man@telus.net wrote:
Erm... there's a little issue with that idea... Do remember that extensions are defined inside of LocalSettings.php, and until loaded they don't have anything set inside of $wgHooks... So a beforeConfiguration hook would absolutely never be run by anything because nothing would be able to hook into it early enough.
Yes, I remembered that after I posted the message.
By the way, please don't "top post". Traditionally, replying to messages on mailing lists is done in-line, as Simetrical and I have done.
On Mon, Mar 17, 2008 at 6:11 AM, Andrew Garrett andrew@epstone.net wrote:
By the way, please don't "top post". Traditionally, replying to messages on mailing lists is done in-line, as Simetrical and I have done.
Of course, intelligent clients like Gmail will hide all the quoted text anyway when you're reading through a conversation, so the distinction should be irrelevant.
Eh? I've been "top posting" since the very first time I replied in this list, and no-one has ever had a problem with it. Honestly, this is completely personal preference, and there are other people on this mailing list who even use this style... even Huji, Jamie Hari, Jared, Voice of All, and a number of other people top post.
^_^ I don't have my client hide quotes... However, I do have it color the indentation, and also automatically convert the traditional > style text quotes into readable elements. Though I could swear I had an extension to allow me to collapse quotes at some point.
~Daniel Friesen(Dantman) of: -The Gaiapedia (http://gaia.wikia.com) -Wikia ACG on Wikia.com (http://wikia.com/wiki/Wikia_ACG) -and Wiki-Tools.com (http://wiki-tools.com)
Simetrical wrote:
On Mon, Mar 17, 2008 at 6:11 AM, Andrew Garrett andrew@epstone.net wrote:
By the way, please don't "top post". Traditionally, replying to messages on mailing lists is done in-line, as Simetrical and I have done.
Of course, intelligent clients like Gmail will hide all the quoted text anyway when you're reading through a conversation, so the distinction should be irrelevant.
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
On 17/03/2008, DanTMan dan_the_man@telus.net wrote:
Erm... there's a little issue with that idea... Do remember that extensions are defined inside of LocalSettings.php, and until loaded they don't have anything set inside of $wgHooks... So a beforeConfiguration hook would absolutely never be run by anything because nothing would be able to hook into it early enough. As for the afterConfiguration, generally we use $wgExtensionFunctions (Think that was the name) for this...
You could just put the code directly into the beginning of LocalSettings.php - less tidy, but has the same effect as running a hook just before including LocalSettings.php.
Maybe I'm missing something, but it could that the answer to your problem is to add the following line before you set the variable:
global $wgGlobalVar;
-Yaron
On Sun, Mar 16, 2008 at 6:53 PM, Simetrical Simetrical+wikilist@gmail.com wrote:
On Sun, Mar 16, 2008 at 6:15 PM, 65s.mg@atlas.cz wrote:
Hello. I tried many hooks, but I cannot find any, with which I can use
for overwriting variale, that is defined in the LocalSettings.php. Any suggestions? Thanks. -MGrabovsky
There is no hook specifically for this purpose. There doesn't need to be: the variables are globals. You can set them from any hook you want. Just make sure the hook executes early enough that it's before the global is used elsewhere.
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
On 3/17/08, Yaron Koren yaron57@gmail.com wrote:
Maybe I'm missing something, but it could that the answer to your problem is to add the following line before you set the variable:
global $wgGlobalVar;
You're missing something. He wants the change to persist across requests.
Yeah, that's probably true; I should have phrased what I wrote better: it appeared to me that maybe all his attempts at solving the problem had failed because he hadn't made the "global" call in the first place.
-Yaron
On Sun, Mar 16, 2008 at 8:17 PM, Andrew Garrett andrew@epstone.net wrote:
On 3/17/08, Yaron Koren yaron57@gmail.com wrote:
Maybe I'm missing something, but it could that the answer to your
problem is
to add the following line before you set the variable:
global $wgGlobalVar;
You're missing something. He wants the change to persist across requests.
-- Andrew Garrett
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Yeah, that's probably true; I should have phrased what I wrote better: it appeared to me that maybe all his attempts at solving the problem had failed because he hadn't made the "global" call in the first place.
Just include your generated config file or code that sets stuff in LocalSettings.php?
wikitech-l@lists.wikimedia.org