• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

How can I print console/log messages during development?

rhodes

Active member
#1
I use eclipse and a local apache webserver (xampp) for further development of my xf forum. Sometimes it would be very helpful to print current values of php vars/arrays while some xf scripts are executed.
Unfortunately I don't know how I can do this. Can I ?
Regards, rhodes
 

Chris D

XenForo developer
Staff member
#2
There's a few ways.

You may want to look at
PHP:
XenForo_Error::logError();
and

PHP:
XenForo_Helper_File::log();
They will only accept strings, however if you want to dump arrays and other types of data besides strings, you may want to look at running the error/message you're logging through this before using either of the above:
PHP:
Zend_Debug::dump($message, null, false);
 

HWS

Well-known member
#3
You also can use an IDE like Zend Studio or PHPstorm where you can take a look at all variables live during the scripts execution.