1. 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?

Discussion in 'XenForo Development Discussions' started by rhodes, Mar 11, 2015.

  1. rhodes

    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
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    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($messagenullfalse);
     
    thedude, HWS and Jake B. like this.
  3. HWS

    HWS Well-Known Member

    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.
     

Share This Page