On 09/05/05, Jordi Domingo <jordidr(a)gmail.com> wrote:
I am looking for a debugger for php and so see
what's going on, but I
don't know any (I will try gubed).
Have you tried setting $wgDebugLogFile in LocalSettings.php to a
writable file, and then inserting lots of statements like wfDebug("my
variable contains $my_variable"); around the code? This can give you a
lot of feedback about what's going on at different stages. [as usual,
see includes/DefaultSettings.php for the range of possible options and
how to use them]
In short:
does editpage.php remember global values when call again to editform()?
I'm afraid it's very hard to follow what exactly your code is
currently doing, and therefore to work out how your code should work:
* by "globals", do you mean variables that you've declared outside of
any function or class, and then declared using "global $foo;"-type
statements (by convention, these are named like $wgVarName in
MediaWiki)?
* if so, they should be remembered between functions, but remember
that every request of a page (e.g. clicking "Preview" or "Save" or
whatever) runs a completely new instance of the program, so no
variables will be "remembered"
* or, do you mean that these values are part of the form itself (a
"hidden" field, like "wpEdittime" in the normal code)? This should
indeed be remembered between invocations, as long as you're setting it
appropriately when the form is [re-]output
* or, do you mean that the values are part of the URL, like the
action=edit, in which case the code may need to be changed so that
they are preserved when the form is submitted (i.e. the form needs to
be submitted to a URL with those same extra arguments in, despite the
"action=edit" changing to "action=submit"); presumably, there is
already code to do this for the "§ion=N", but I don't know where
it is or whether it would need changing
I don't know if these suggestions will seem overly simple, overly
complex, or turn out not to be true because of things already in the
code, but they're my best stab at helping based on the limited
information you provided.
--
Rowan Collins BSc
[IMSoP]