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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Richard Quadling [mailto:rquadling@xxxxxxxxx]
> Sent: Tuesday, October 12, 2010 7:04 AM
> To: ææå
> Cc: php-windows@xxxxxxxxxxxxx
> Subject: Re:  Line by line debugger for PHP for command line
> work.
> 
> On 12 October 2010 14:58, ææå <huixinchen@xxxxxxxxx> wrote:
> > 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@xxxxxxxxx
> > Tel :   +86 010 5992-6238
> > http://www.laruence.com/
> 
> æäèäæïèææèææçæèã
> 
> or should I have said
> 
> æäèäæïèææèææçæèã
> 
> 
> 
> --
> 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...  

<?php
echo '<pre style="text-align: left;">';

$loadedExtensions = get_loaded_extensions();
//echo '$loadedExtensions &raquo; ';
//print_r($loadedExtensions);

$requiredFiles = get_required_files();
echo '$requiredFiles &raquo; ';
print_r($requiredFiles);

$includedFiles = get_included_files();
echo '$includedFiles &raquo; ';
print_r($includedFiles);

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

$definedVars = 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 &raquo; ';
print_r($definedVars);

$definedFunctions = get_defined_functions();
unset($definedFunctions['internal']);
echo '$definedFunctions &raquo; ';
print_r($definedFunctions);

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

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

foreach ($declaredClasses as $className)
{
	$reflect = new ReflectionClass($className);
	echo '<hr />';
	echo $reflect;
}
echo '</pre>';
?>

Regards,
Tommy


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




[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux