How can I print console/log messages during development?

rhodes

Active member
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
 
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);
 
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.
 
Back
Top Bottom