[PHP] Re: PHP debugger

2007-05-26 Thread Jared Farrish

Miles Thompson wrote:

 Suggestions will be most welcome. Also, I'm not married to this, so if
 anyone thinks there is a better debugger, please jump in.


The following assumes object-oriented programming paradigms are at least
somewhat applied. I would guess functional would be similar, but procedural
code, you might be on your own there...

I actually use two classes that I include at the bottom of all of my library
definitions (in if(!class_exists()){declare}format). One provides warning
and error message storage, the other type assertion. Between the two of
these, I have simple unit testing that I can perform as I am developing a
class, as well as pre-included simple error logging that, when I install
into the greater system, can be incorporated into the systemic error
catching routines without refactoring code, in most cases to weld-on
systemic error routines.

Thinking aloud, getting code to work correctly usually means testing it
against what you expect it to do, so doing that at a very localized level
first can be helpful. Once I started doing this, my implementation issues
somewhat went away. Results (and implementations) may very.


 PS Why are we doing this? Because we are getting tired of debugging
 with Javascript alert()  boxes. /mt


Firebug in Firefox is a very well-developed javascript debugger, featuring
console.log(), which allows you to stop using alert() for error checking.
Very nice! And I put this:

code
// Solve the firebug extension issue in IE by try/catching and creating a
blank object console.log();
try{console.log();}catch(e){var console=new
Object;console={log:function(){var k=0;}};};
/code

At the head of each js file to prevent errors in IE or other browsers
without Firebug installed.

Example: http://web3.unt.edu/riskman/JS/lem.json.js

--
Jared Farrish
Intermediate Web Developer
Denton, Tx

Abraham Maslow: If the only tool you have is a hammer, you tend to see
every problem as a nail. $$


[PHP] Re: PHP debugger

2007-05-15 Thread Emil Ivanov
Currently I'm Using PDT/XDebug on daily basis and works just fine.
You can get Xdebug from www.xdebug.org,
PDT from www.eclipse.org/pdt
and the plugin for PDT to add support to the PDT is 
https://bugs.eclipse.org/bugs/show_bug.cgi?id=169408

In the plugin precompiled package you'll find a pdf with instruction how to 
get things working. On the Xdebug site there's a lot of information how to 
setup PHP and XDebug.
Note that the precompiled binary of the support for PDT will work for you, 
as it's written in Java and you don't need to compile it.

Regards,
Emil Ivanov

Miles Thompson [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
I am trying to load a PHP debugger in our most recent build of PHP 5.2.1.

 The debugger which I am trying to set up is the free, pre-compiled
 Linux version of dbg ( DBG 2.15.5 dbg modules), from
 http://dd.cron.ru/dbg/, and all of the instructions have been followed
 as posted on the NuSphere site.

 Yes, Apache has been stopped and restarted!!

 There is no difference in the output from phpinfo(). The line
 with DBG v2.11.30, (C) 2000,2004 by Dmitri Dmitrienko, http://dd.cron.ru;
 does not appear.

 PHP is compiled without debugging, but I did consider that was for the
 purpose of debugging PHP itself, not scripts.

 Suggestions will be most welcome. Also, I'm not married to this, so if
 anyone thinks there is a better debugger, please jump in.

 Regards - Miles Thompson

 PS Why are we doing this? Because we are getting tired of debugging
 with Javascript alert()  boxes. /mt

 PPS And we are using those because of Joomla!  Some things are buried
 so deeply we cannot use print() or echo(). /mt 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php