Hi,
Can anyone tell me how to use dump object/variable information in mediawiki? I tried var_dump function in PHP but the result is not shown on the woki page. Thanks.
Bin
You can always die(); right after your var_dump if you really need to see the message. Alternatively try Global $wgOut; $wgOut->addHTML("<pre>".var_dump($variable)."</pre>"); Good luck! -Courtney
-----Original Message----- From: mediawiki-l-bounces@lists.wikimedia.org [mailto:mediawiki-l-bounces@lists.wikimedia.org] On Behalf Of Bin Hu Sent: Friday, March 21, 2008 10:18 PM To: MediaWiki announcements and site admin list Subject: [Mediawiki-l] var_dump in mediawiki
Hi,
Can anyone tell me how to use dump object/variable information in mediawiki? I tried var_dump function in PHP but the result is not shown on the woki page. Thanks.
Bin
_______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Thanks. Bin
On Mar 24, 2008, at 5:52 AM, Christensen, Courtney wrote:
You can always die(); right after your var_dump if you really need to see the message. Alternatively try Global $wgOut; $wgOut->addHTML("<pre>".var_dump($variable)."</pre>"); Good luck! -Courtney
-----Original Message----- From: mediawiki-l-bounces@lists.wikimedia.org [mailto:mediawiki-l-bounces@lists.wikimedia.org] On Behalf Of Bin Hu Sent: Friday, March 21, 2008 10:18 PM To: MediaWiki announcements and site admin list Subject: [Mediawiki-l] var_dump in mediawiki
Hi,
Can anyone tell me how to use dump object/variable information in mediawiki? I tried var_dump function in PHP but the result is not shown on the woki page. Thanks.
Bin
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
Actually, you can use wfVarDump($variable); It's part of GlobalFunctions.php and dumps the variable into the body area instead of the start of the page outside the skin.
~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)
Bin Hu wrote:
Thanks. Bin
On Mar 24, 2008, at 5:52 AM, Christensen, Courtney wrote:
You can always die(); right after your var_dump if you really need to see the message. Alternatively try Global $wgOut; $wgOut->addHTML("<pre>".var_dump($variable)."</pre>"); Good luck! -Courtney
-----Original Message----- From: mediawiki-l-bounces@lists.wikimedia.org [mailto:mediawiki-l-bounces@lists.wikimedia.org] On Behalf Of Bin Hu Sent: Friday, March 21, 2008 10:18 PM To: MediaWiki announcements and site admin list Subject: [Mediawiki-l] var_dump in mediawiki
Hi,
Can anyone tell me how to use dump object/variable information in mediawiki? I tried var_dump function in PHP but the result is not shown on the woki page. Thanks.
Bin
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
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Thanks for the reply Daniel and Courtney.
Could you please show me an example of using this wfVarDump() function? It seems that I cannot see any dumped information from this function. I cannot get it from $wgOut->addHTML() either.
I am sorry if the question that I am asking is too naive. I just started writing extensions for mediawiki.
Regards, Bin
On Mar 24, 2008, at 10:48 PM, DanTMan wrote:
Actually, you can use wfVarDump($variable); It's part of GlobalFunctions.php and dumps the variable into the body area instead of the start of the page outside the skin.
~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)
Bin Hu wrote:
Thanks. Bin
On Mar 24, 2008, at 5:52 AM, Christensen, Courtney wrote:
You can always die(); right after your var_dump if you really need to see the message. Alternatively try Global $wgOut; $wgOut->addHTML("<pre>".var_dump($variable)."</pre>"); Good luck! -Courtney
-----Original Message----- From: mediawiki-l-bounces@lists.wikimedia.org [mailto:mediawiki-l-bounces@lists.wikimedia.org] On Behalf Of Bin Hu Sent: Friday, March 21, 2008 10:18 PM To: MediaWiki announcements and site admin list Subject: [Mediawiki-l] var_dump in mediawiki
Hi,
Can anyone tell me how to use dump object/variable information in mediawiki? I tried var_dump function in PHP but the result is not shown on the woki page. Thanks.
Bin
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
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
Hey Bin,
Could you tell me about the variable you are trying to dump and the extension you are trying to write? What is your expected output? Is your extension calculating some input and displaying the results, or is it modifying functionality?
Hopefully these answers will help us give you a better answer. -Courtney
Hi, Courtney,
I am writing an extension to display some customized tags with information from external database.
For example <MyExtension name="hello" db="external"/> shall retrieve some some information form the database "external" and show return a value of "world". Now I can do this in my extension module. But during the development I need to debug and dump data from time to time.
For a line in wiki: <printMe name="test"/>
with the extension code in php:
function printMe_Tag($input, $params) { wfVarDump($params); return ("hello"); }
I hope it returns "hello" with the dump value: name=>"test". But I cannot get the dump value. It seems wfVarDump() calls the global $wgOut->addHTML(). I tried the global $wgOut, it didn't work either. I guess that I have made some mistakes here. Please point it out if you know. Thanks!
Regards, Bin
On Mar 25, 2008, at 5:41 AM, Christensen, Courtney wrote:
Hey Bin,
Could you tell me about the variable you are trying to dump and the extension you are trying to write? What is your expected output? Is your extension calculating some input and displaying the results, or is it modifying functionality?
Hopefully these answers will help us give you a better answer. -Courtney
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org