Zikula: A Flexible Open Source Content Management System
home | forum | contact us

Dizkus

Bottom
module debugging?
  • Posted: 13.01.2006, 19:21
     
    come
    rank:
    Helper Helper
    registered:
     December 1969
    Status:
    offline
    last visit:
    01.07.08
    Posts:
    137
    How do I efficiently debug modules during development?
    I have xampp (Win) installed for testing and am programming with gvim (and sometimes PHPEdit).
    Sadly I don't know where I can directly view the results of the mysql-requests and the the status of the PHP variables.

    --
    greetings,

    O. Encke

    ASUS Notebook Forum
  • Posted: 13.01.2006, 20:21
     
    Simon
    rank:
    Steering Committee Steering Committee
    registered:
     December 2002
    Status:
    offline
    last visit:
    23.11.08
    Posts:
    13415
    You can add to pnRender templates too see what variables are available to the template containing the pndebug call. Otherwise, you could simply echo the $SQL statement and paste it into phpMyAdmin, print_r the connection object... etc etc.

    --
    Regards,
    Simon

    itbegins.co.uk - Zikula Consulting

    Please read the Support Guide
  • Posted: 13.01.2006, 20:30
     
    jediping
    rank:
    Helper Helper
    registered:
     November 2004
    Status:
    offline
    last visit:
    12.03.07
    Posts:
    387
    Printing out stuff works best, though don't forget to include a "die;" statement right after, or you won't likely see your results. :)
  • Posted: 13.01.2006, 23:47
     
    Topiatic
    rank:
    Professional Professional
    registered:
     November 2003
    Status:
    online
    Posts:
    1676
    These are my 2 debug friends... they crawl all files with me.

    For strings:

    Code

    echo '<br />$pnSomeVar = ' . $pnSomeVar ;die;


    The break is for when it's used in foreach's and while's, although you have to move the die to the end of the cycle.

    For arrays:

    Code

    echo '<pre><b>pnSomeVar =</b>';print_r($pnSomeVar );echo 'End $pnSomeVar </pre>';die;


    The begining and end again are to help distinquish multiple instances.

    --
    Under Construction!

Extensions Moderation

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula