Line by line debugger for PHP for command line work.

Line by line debugger for PHP for command line work.

am 12.10.2010 14:47:16 von Richard Quadling

Hi.

I'm trying to trawl my way through a load of code I've been dumped
with. It is a mixture of VERY BIG functions and a load of classes with
really bad names. A mess. The code runs on PHP5, but there are some
errors in the output which I can't find. No authors are contactable
(they no longer work here and I'm not even sure you could say they
ever did!).

It is for command line use only. So something that can hook into my
PHP (I'm using 5.3.4-dev).

I need a debugging tool to allow me to step through the code line by
line looking at the call stack, globals, locals etc.

Regards,

Richard.

--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

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

Re: Line by line debugger for PHP for command line work.

am 12.10.2010 15:09:02 von Steven Scott

XDebug is a common tool, and can link with most IDEs. There is also
FirePHP plugin if you are using Firefox.

On Tue, Oct 12, 2010 at 8:47 AM, Richard Quadling wro=
te:
> Hi.
>
> I'm trying to trawl my way through a load of code I've been dumped
> with. It is a mixture of VERY BIG functions and a load of classes with
> really bad names. =A0A mess. The code runs on PHP5, but there are some
> errors in the output which I can't find. No authors are contactable
> (they no longer work here and I'm not even sure you could say they
> ever did!).
>
> It is for command line use only. So something that can hook into my
> PHP (I'm using 5.3.4-dev).
>
> I need a debugging tool to allow me to step through the code line by
> line looking at the call stack, globals, locals etc.
>
> Regards,
>
> Richard.
>
> --
> Richard Quadling
> Twitter : EE : Zend
> @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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

Re: Line by line debugger for PHP for command line work.

am 12.10.2010 15:11:15 von Richard Quadling

On 12 October 2010 14:09, Steven Scott wrote:
> XDebug is a common tool, and can link with most IDEs.  There is also
> FirePHP plugin if you are using Firefox.
>
> On Tue, Oct 12, 2010 at 8:47 AM, Richard Quadling w=
rote:
>> Hi.
>>
>> I'm trying to trawl my way through a load of code I've been dumped
>> with. It is a mixture of VERY BIG functions and a load of classes with
>> really bad names.  A mess. The code runs on PHP5, but there are som=
e
>> errors in the output which I can't find. No authors are contactable
>> (they no longer work here and I'm not even sure you could say they
>> ever did!).
>>
>> It is for command line use only. So something that can hook into my
>> PHP (I'm using 5.3.4-dev).
>>
>> I need a debugging tool to allow me to step through the code line by
>> line looking at the call stack, globals, locals etc.
>>
>> Regards,
>>
>> Richard.
>>
>> --
>> Richard Quadling
>> Twitter : EE : Zend
>> @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
>>
>> --
>> PHP Windows Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>

Aha. Just getting XDebug in. I see it can talk to a remote debugger
.... I've got WinDbg installed ... Going to see if that'll do what I
want.

FirePHP would be no good for command line scripts I'd suspect?


--=20
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

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

Re: Line by line debugger for PHP for command line work.

am 12.10.2010 15:58:25 von huixinchen

Hi:
xdebug and vim with dbgp
plugin(http://www.vim.org/scripts/script.php?script_id=1929) can satsfy
your needs.

there is also a manual(http://www.laruence.com/2010/06/21/1608.html
) if you can speak chinese .


惠新宸 laruence
Mail: huixinchen@baidu.com
Tel : +86 010 5992-6238
http://www.laruence.com/

On 10/12/2010 21:09, Steven Scott wrote:
> XDebug is a common tool, and can link with most IDEs. There is also
> FirePHP plugin if you are using Firefox.
>
> On Tue, Oct 12, 2010 at 8:47 AM, Richard Quadling wrote:
>> Hi.
>>
>> I'm trying to trawl my way through a load of code I've been dumped
>> with. It is a mixture of VERY BIG functions and a load of classes with
>> really bad names. A mess. The code runs on PHP5, but there are some
>> errors in the output which I can't find. No authors are contactable
>> (they no longer work here and I'm not even sure you could say they
>> ever did!).
>>
>> It is for command line use only. So something that can hook into my
>> PHP (I'm using 5.3.4-dev).
>>
>> I need a debugging tool to allow me to step through the code line by
>> line looking at the call stack, globals, locals etc.
>>
>> Regards,
>>
>> Richard.
>>
>> --
>> Richard Quadling
>> Twitter : EE : Zend
>> @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
>>
>> --
>> PHP Windows Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> .
>

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

Re: Line by line debugger for PHP for command line work.

am 12.10.2010 16:04:24 von Richard Quadling

T24gMTIgT2N0b2JlciAyMDEwIDE0OjU4LCDmg6DmlrDlrrggPGh1aXhpbmNo ZW5AYmFpZHUuY29t
PiB3cm90ZToKPiBIaToKPiDCoHhkZWJ1ZyBhbmQgdmltIHdpdGggZGJncAo+ IHBsdWdpbihodHRw
Oi8vd3d3LnZpbS5vcmcvc2NyaXB0cy9zY3JpcHQucGhwP3NjcmlwdF9pZD0x OTI5KSBjYW4gc2F0
c2Z5IHlvdXIKPiBuZWVkcy4KPgo+IMKgdGhlcmUgaXMgYWxzbyBhIG1hbnVh bChodHRwOi8vd3d3
LmxhcnVlbmNlLmNvbS8yMDEwLzA2LzIxLzE2MDguaHRtbAo+ICkgaWYgeW91 IGNhbiBzcGVhayBj
aGluZXNlIC4KPgo+Cj4g5oOg5paw5a64IMKgIMKgIGxhcnVlbmNlCj4gTWFp bDogwqAgaHVpeGlu
Y2hlbkBiYWlkdS5jb20KPiBUZWwgOiDCoCArODYgMDEwIDU5OTItNjIzOAo+ IGh0dHA6Ly93d3cu
bGFydWVuY2UuY29tLwoK5oiR5LiN6K6y5Lit5paH77yM6ICM5piv5oSf6LCi 5oKo5oKo55qE5o+Q
6K6u44CCCgpvciBzaG91bGQgSSBoYXZlIHNhaWQKCuaIkeS4jeiusuS4reaW h++8jOiAjOaYr+aE
n+isneaCqOaCqOeahOaPkOitsOOAggoKCgotLSAKUmljaGFyZCBRdWFkbGlu ZwpUd2l0dGVyIDog
RUUgOiBaZW5kCkBSUXVhZGxpbmcgOiBlLWUuY29tL01fMjQ4ODE0Lmh0bWwg OiBiaXQubHkvOU84
dkZZCg==

RE: Line by line debugger for PHP for command line work.

am 13.10.2010 12:27:19 von Tommy Pham

> -----Original Message-----
> From: Richard Quadling [mailto:rquadling@gmail.com]
> Sent: Tuesday, October 12, 2010 7:04 AM
> To: 惠新å®=B8
> Cc: php-windows@lists.php.net
> Subject: Re: [PHP-WIN] Line by line debugger for PHP for command line
> work.
>=20
> On 12 October 2010 14:58, 惠新å®=B8 =
wrote:
> > Hi:
> > xdebug and vim with dbgp
> > plugin(http://www.vim.org/scripts/script.php?script_id=3D192 9) can
> > satsfy your needs.
> >
> > there is also a manual(http://www.laruence.com/2010/06/21/1608.html
> > ) if you can speak chinese .
> >
> >
> > 惠新å®=B8 laruence
> > Mail: huixinchen@baidu.com
> > Tel : +86 010 5992-6238
> > http://www.laruence.com/
>=20
> =
æˆ‘ä¸è®²ä¸­æ–‡ï¼Œè€ Œæ˜¯=E6=
„Ÿè°¢æ‚¨æ‚¨çš„提议 ã€=82
>=20
> or should I have said
>=20
> =
æˆ‘ä¸è®²ä¸­æ–‡ï¼Œè€ Œæ˜¯=E6=
„Ÿè¬æ‚¨æ‚¨çš„提議 ã€=82
>=20
>=20
>=20
> --
> Richard Quadling
> Twitter : EE : Zend
> @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

Or you could use what I made a while back. Adjust the output according =
to your need. You can leave the echo to view on screen or write it to =
file and download that file for offsite/offline review/debug. This =
should give you all internals working of the script/app without you =
having to wade through all that mess... =20

echo '

';

$loadedExtensions =3D get_loaded_extensions();
//echo '$loadedExtensions » ';
//print_r($loadedExtensions);

$requiredFiles =3D get_required_files();
echo '$requiredFiles » ';
print_r($requiredFiles);

$includedFiles =3D get_included_files();
echo '$includedFiles » ';
print_r($includedFiles);

$definedConstants =3D get_defined_constants(true);
foreach($loadedExtensions as $extensionName)
{
unset($definedConstants[$extensionName]);
}
echo '$definedConstants » ';
print_r($definedConstants);

$definedVars =3D get_defined_vars();
unset($definedVars['GLOBALS'], $definedVars['_POST'], =
$definedVars['_GET'],
$definedVars['_COOKIE'], $definedVars['_FILES'], $definedVars['_ENV'],
$definedVars['_REQUEST'], $definedVars['_SERVER'],
$definedVars['loadedExtensions'], $definedVars['extensionName'],
$definedVars['requiredFiles'], $definedVars['includedFiles'],
$definedVars['declaredInterfaces'], $definedVars['declaredClasses'],
$definedVars['definedConstants'], $definedVars['definedFunctions']);
echo '$definedVars » ';
print_r($definedVars);

$definedFunctions =3D get_defined_functions();
unset($definedFunctions['internal']);
echo '$definedFunctions » ';
print_r($definedFunctions);

$declaredInterfaces =3D get_declared_interfaces();
// remove PHP's internal interfaces ... adjust according to extensions =
loaded
$declaredInterfaces =3D array_slice($declaredInterfaces, 12);
echo '$declaredInterfaces » ';
print_r($declaredInterfaces);

$declaredClasses =3D get_declared_classes();
// remove PHP's internal classes ... adjust according to extensions =
loaded
$declaredClasses =3D array_slice($declaredClasses, 133);
echo '$declaredClasses » ';
print_r($declaredClasses);

foreach ($declaredClasses as $className)
{
$reflect =3D new ReflectionClass($className);
echo '
';
echo $reflect;
}
echo '
';
?>

Regards,
Tommy


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