Welcome Guest, Not a member yet? Register   Sign In
PHP/Codeigniter debugger
#1

[eluser]taewoo[/eluser]
Other than "print_r", what do you guy use?
#2

[eluser]Johan André[/eluser]
I use FirePHP, works great!
It basically mimics the Firebug-behavior but you can "echo" out things from PHP to the Firebug console.
#3

[eluser]taewoo[/eluser]
Thanks Johan.
But is there something that can do stack trace or anything similar?
#4

[eluser]cahva[/eluser]
[quote author="taewoo" date="1246420263"]Other than "print_r", what do you guy use?[/quote]
var_dump Big Grin

Seriously.. Well I myself have installed XDebug extension for my local development and it should be what you are looking for.
#5

[eluser]John_Betong[/eluser]
[quote author="taewoo" date="1246420263"]Other than "print_r", what do you guy use?[/quote]
 
 
I use fred(...), formats, objects, arrays, strings, numerics, booleans, etc
 
Code:
//==========================================================================  
  function fred($data=array('Nothing passed'), $data_name='', $data_type='')
    {
        // $data objects do not display as an array so...
        if (is_object($data))
        {
            $data = get_object_vars($data);
        }

        // maybe find the $data type
        switch($data)
        {
            case is_array($data)     :
                $data_type     = 'array';    
                break;
            case is_bool($data) :
                $data_type    = 'boolean';
                $data                = $data ? 'TRUE' : 'FALSE';
                break;
            case is_numeric($data) :
                $data_type    = 'numeric';
                break;
            case is_object($data) :
                $data_type    = 'object';
                $data                =    get_object_vars($my_class);
                break;
            case is_resource($data) :
                $data_type    = 'resource';
                $tmp                = array();
                while ($row = mysql_fetch_assoc($data))
                {
                    $tmp[] = $row;
                }
                $data = $tmp;
                break;
            case is_string($data) :
                $data_type    = 'string';
                break;
            default:      
                $data_type     = 'oddball';
                $data_value    = $data;
        }//end switch
        
        // $data must now be an array or a string, numeric???
        $style = 'width:90%; margin:1em; overflow:auto;text-align:left; font-family:Courier; font-size:1.0em; background:#efe none; color:#000; text-align:left';
        ?>
        
    <div style='&lt;?= $style ?&gt;'>
            <fieldset>
                <legend>John&rsquo;s Data Determiner</legend>        <br />
                    <b>Name &nbsp; ==> </b>     &lt;?= $data_name ?&gt;        <br />
                    <b>Type &nbsp; ==> </b>        &lt;?= $data_type ?&gt;        <br />
                    <b>Value &nbsp;==> </b>
                    <pre style='width:99.98%; margin:-1.2em 0 4.2em 9.0em; text=align:left'>
                        &lt;?php print_r($data) ?&gt;
                    </pre>
            </fieldset>
    </div>
    
&lt;?php } //endfunc
&nbsp;
&nbsp;




Theme © iAndrew 2016 - Forum software by © MyBB