[xdebug-general] Re: Debuging with namespaces

From: General Mail <general[@]bombshellz.net>
Date: Wed, 30 Jan 2013 22:59:30 -0500

On 1/27/2013 5:54 AM, Derick Rethans wrote:
> On Sat, 26 Jan 2013, General Mail wrote:
>
>> PHP Version: PHP 5.3.15
>> Xdebug Version: Xdebug v2.2.1
>>
>> I having problems debugging PHP code that contain namespaces, the paths
>> returned by Xdebug are invalid, IE:
>>
>> /mnt/Workspace/ZippeeFramework2/Library/Classes/Database/Sql/Insert.php.ZF2\Database\Sql\Insert->getSqlStatement()
>>
>> It should simply be
>> /mnt/Workspace/ZippeeFramework2/Library/Classes/Database/Sql/Insert.php.
>>
>> Is there anything I can do to remedy this?
>>
>> Here is partial code:
>>
>> $update = new \ZF2\Database\Sql\Insert( 'Employees' );
>> $emp[ 'John' ] = 'Mike D.';
>> $emp[ 'Fat' ] = 'Skinny';
>> $update->values( $emp );
>> var_dump( $update->getSqlStatement() );
>>
>> Any assistance on this matter would be really appreciate it.
>
> If you can provide a self-contained example (not something that uses ZF
> or anything!) then I can have a look at it. You didn't say *where* you
> saw that strange path though.
>
> cheers,
> Derick
>

I can fill you in on some of the details now:

IDE: Aptana Studio 3 (with builtin debugger).

The issue occurs when I have project in directory projectA and during
debugging, a script in projectA calls a class in directory projectB via
namespace (spl_autoload) and the path returned by Xdebug points to a
non-existent file, which in turn Aptana can't associate the path with
the script in my workspace, so I can't view the source code while stepping.

ZF2 is my own code that I am currently developing. I can however write
an example once I get a chance. thanks.

- Regards
Received on Thu Jan 31 2013 - 03:59:38 GMT

This archive was generated by hypermail 2.2.0 : Mon Jun 25 2018 - 06:00:04 BST