http://d0om.fnal.gov/d0admin/doctaur/dtdocs/p-langs/web_prog_bookshelf/php/c...
(provided by google)
section 3.4.2, passing params by reference
You don't pass params back to the calling function, you get a reference instead of a value (should be similar in C#).
ngungo wrote:
function myFunction($article, $user, $text, $summary, $isminor, $iswatch, $section) { /* your code here */ }
I put the parameters in correct order, it works fine (with $text, I haven't tried others yet, especially the object $article where I am most interested in), but when I altered the value of $text, it would not change as the outcome of the save. I understand this since probably the formal parameters are in-type parameter (I am an C# programmer, learning PHP now).
So the question is how do I alter the outcome of the parameters and pass back to the calling routine (in this case, the function editForm of EditPage.php)?
I stick my name or something in the debug message, like: wfDebug("-- IMSoP: text received is $text --" ); That way, I can run a command like tail -f logfile | grep "IMSoP" to watch nothing but my debug messages, as they are output.
# In the LocalSettings.php, I set: $wgDebugLogFile = "$wgScriptPath/logfile"; (also tried $wgDebugLogFile = "$wgScriptPath/";)
then tried it out, in both cases it could not find the file: tail: logfile: No such file or directory
Thanks, ngungo
-----Original Message----- From: mediawiki-l-bounces@Wikimedia.org [mailto:mediawiki-l-bounces@Wikimedia.org] On Behalf Of Rowan Collins Sent: Saturday, March 05, 2005 9:58 AM To: MediaWiki announcements and site admin list Subject: Re: [Mediawiki-l] ArticleSave hook
On Sat, 5 Mar 2005 09:41:14 -0600, ngungo ngungo@56degrees.com wrote:
My question is how do I make use of these parameters in myFunction()?
Or
how to declare them before using them? Let's say for example parameter $text, I tried: die($text); it did not show anything.
You'll need to declare your function as having the appropriate parameters (and in the right order). So:
function myFunction($article, $user, $text, $summary, $isminor, $iswatch, $section) { /* your code here */ }
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l