Re: [MediaWiki-l] Lua: Maintain state between invokes?

2013-06-20 Thread Stephan Gambke
Hmm, have to keep templates then. Thanks.

On 19 June 2013 17:05, Daniel Friesen  wrote:
> On Wed, 19 Jun 2013 07:06:10 -0700, Stephan Gambke 
> wrote:
>
>> Hi,
>>
>> I am struggling with Lua.
>>
>> Is there a way to somehow maintain the state of the page building
>> between calls to #invoke? A kind of page-wide variable mechanism or
>> something like that?
>>
>> Problem: I have what is basically a bugtracker where each bug is
>> described on a wiki page. For each state change of the bug (new,
>> confirmed, fixed, verified, closed) I add a call to a template to the
>> page text. The problem is, that the text generated by the template
>> depends on both the origin and the target state. Until now I used the
>> variables extension to keep track of the current state. Now I want to
>> convert to Lua. Apart from the fact that it is clearly not desirable
>> to mix the use of the variables extension and Lua, it is also
>> impossible: When Scribunto's #invoke is called, parser functions are
>> already parsed.
>>
>> So, what is the solution?
>>
>> Cheers,
>> Stephan
>
>
> I'm pretty sure that Scribundo is specifically designed to make #invoke
> calls isolated from other calls. Short of trying to find and exploit bugs
> that are unpredictable and will eventually be patched there is no way you're
> going to get state between calls.
>
> --
> ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://danielfriesen.name/]
>
>
> ___
> MediaWiki-l mailing list
> MediaWiki-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

___
MediaWiki-l mailing list
MediaWiki-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


Re: [MediaWiki-l] Lua: Maintain state between invokes?

2013-06-19 Thread Daniel Friesen
On Wed, 19 Jun 2013 07:06:10 -0700, Stephan Gambke   
wrote:



Hi,

I am struggling with Lua.

Is there a way to somehow maintain the state of the page building
between calls to #invoke? A kind of page-wide variable mechanism or
something like that?

Problem: I have what is basically a bugtracker where each bug is
described on a wiki page. For each state change of the bug (new,
confirmed, fixed, verified, closed) I add a call to a template to the
page text. The problem is, that the text generated by the template
depends on both the origin and the target state. Until now I used the
variables extension to keep track of the current state. Now I want to
convert to Lua. Apart from the fact that it is clearly not desirable
to mix the use of the variables extension and Lua, it is also
impossible: When Scribunto's #invoke is called, parser functions are
already parsed.

So, what is the solution?

Cheers,
Stephan


I'm pretty sure that Scribundo is specifically designed to make #invoke  
calls isolated from other calls. Short of trying to find and exploit bugs  
that are unpredictable and will eventually be patched there is no way  
you're going to get state between calls.


--
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://danielfriesen.name/]


___
MediaWiki-l mailing list
MediaWiki-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


[MediaWiki-l] Lua: Maintain state between invokes?

2013-06-19 Thread Stephan Gambke
Hi,

I am struggling with Lua.

Is there a way to somehow maintain the state of the page building
between calls to #invoke? A kind of page-wide variable mechanism or
something like that?

Problem: I have what is basically a bugtracker where each bug is
described on a wiki page. For each state change of the bug (new,
confirmed, fixed, verified, closed) I add a call to a template to the
page text. The problem is, that the text generated by the template
depends on both the origin and the target state. Until now I used the
variables extension to keep track of the current state. Now I want to
convert to Lua. Apart from the fact that it is clearly not desirable
to mix the use of the variables extension and Lua, it is also
impossible: When Scribunto's #invoke is called, parser functions are
already parsed.

So, what is the solution?

Cheers,
Stephan

___
MediaWiki-l mailing list
MediaWiki-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l