General Technical Discussions for Service

Get Involved. Join the Conversation.

Topic

    Bishnu Paudel
    How do you debug PHP scripts in RightNow?
    Topic posted June 2, 2014 by Bishnu PaudelSilver Trophy: 7,500+ Points 
    797 Views, 5 Comments
    Title:
    How do you debug PHP scripts in RightNow?
    Content:

    hi All,

    I would like to know if there is a better approach of debugging than using print and var_dump for PHP script stored in CPM or Custom script files.

    Any better techniques out there?

    Thanks,

    Bishnu

    Comment

     

    • Ross Crockett

      Hey Bishnu,

      I haven't found a better way unfortunately but I just thought I'd mention the logMessage() function if you aren't already aware of it. You can use this to log messages that can be viewed in the debug logs within the Customer Portal admin area. Note only messages from the development area show up though (which is annoying as it would be good to debug/view logs from production), which I find better than dumping values to the screen.

    • Bishnu Paudel

      Thanks Ross. I was not aware of logMessage(). I will give it a try.

      Cheers,

      Bishnu

    • Shreyas Pandhari

      Hi Bishnu,

      Unfortunately I haven't found any run-time debug methodology for CPM. Even  with logMessage() you need to do a flipflop from RN instance and CP Admin portal + not sure if we can set the log level to optimize the logging. Drawback of not having an IDE for php scripts associated with RN.

      If someone from product dev can help out with other ways of debugging CPM scripts.

       

      Thanks,

      Shreyas

    • Mark Rhoads

      One good practice is to get as much testing automated via the test harness as is possible ... it is much easier to test here than to set up and read log files, etc.

    • JN Hutchinson

      Honestly, when it comes to CPM, I first do the code in a standard PHP page on dev and test the *** out of it there (it is just faster to iterate and dump variables to screen).  Then, when I have all the bugs squashed, convert the code into a CPM and test there.

      I tend to hate when I have to use CPM because of the development headaches and since the newest version has screwed up the priority queueing to the point that CPMs are painfully slow for us, I have extra incentive to find other ways to get the job done.

      Josh