[xdebug-general] Re: Feature request: implement a path-rewrite system

From: Mathieu Kooiman <mathieuk[@]gmail.com>
Date: Wed, 26 Nov 2008 20:26:24 +0100

Hi Mauro, Dave,

Thanks for your suggestions, but don't you think it would be nice if
it were Xdebug that implemented such a path-mapping system instead of
the individual clients. Any xdebug client available today could then
benefit and work in pretty much any setup.

Thanks,

Mathieu

On 26 nov 2008, at 18:08, Mauro C. wrote:

> PHPEclipse too.
>
> Mauro Casciari
> ________________________________
> Da: Dave Kelsey <d_kelsey[@]uk.ibm.com>
> A: Mathieu Kooiman <mathieuk[@]gmail.com>
> Cc: xdebug-general[@]lists.xdebug.org; xdebug-general-bounce[@]lists.xdebug.org
> Inviato: Mercoledý 26 novembre 2008, 18:28:10
> Oggetto: [xdebug-general] Re: Feature request: implement a path-
> rewrite system
>
>
> You might want to take a look at PDT,
> it implements path mapping to solve the problem you are describing.
>
> Dave Kelsey
>
>
>
> xdebug-general-bounce[@]lists.xdebug.org wrote on 26/11/2008
> 10:55:42:
>
>> Hi list,
>>
>> I'd like to submit a feature request.
>>
>> At our office, we keep all of our code on a centralized server. This
>> means that we generally edit our files over some sort of network
>> filesystem, like SMB, NFS or AFP. A side-effect of this is that any
>> xdebug GUI client is unable to correctly set breakpoints.
>>
>> Imagine server A, where I have a file debug.php in
>> /home/mathieu/public_html/svnreps/project/ . When I access this file
>> from my workstation, the local path I access it over is
>> /Volumes/mathieu/public_html/svnreps/project/debug.php. If I use,
>> say, MacGDBp or Netbeans, to debug this file while it's running
>> through the webserver on Server A and try to set a breakpoint on
>> line 15 of debug.php GUI clients will tell xdebug to set a
>> breakpoint on file /Volumes/mathieu/public_html/svnreps/project/
>> debug.php:15.
>>
>> Net result: the breakpoint is never hit because the path given is
>> not a file that xdebug on Server A will ever encounter
>> (/Volumes/mathieu as such doesn't exist on Server A).
>>
>> I had encountered this before when I built XDC http://code.google.
>> com/p/xdebugclient ) and XDC counters this problem by offering the
>> user a way to rewrite a local path to the remote path automatically.
>> But I think it would make sense to implement such a path-rewrite
>> system into Xdebug itself, so that any client can benefit from it
>> directly. Such a path-rewrite system could take the form of two (.
>> htaccess-configurable) settings:
>>
>> php_value xdebug.path_rewrite_from "/Volumes/mathieu:/Volumes/
>> michiel"
>> php_value xdebug.path_rewrite_to "/home/mathieu:/home/michiel"
>>
>> This definition would define 2 rewrite rules:
>>
>> - /Volumes/mathieu -> /home/mathieu
>> - /Volumes/michiel -> /home/michiel
>>
>> Xdebug would apply these simple rewrite rules to any path it
>> receives from a client like breakpoints, source requests, etc before
>> actually using the given path. I suppose you could extend this into
>> allowing regex for complex rewrite rules, but I think that simple
>> rewrite rules would cover most cases.
>>
>> Thoughts?
>>
>> Kind regards,
>>
>> Mathieu Kooiman
>
>
>
> ________________________________
>
>
>
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with
> number
> 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
> 3AU
>
>
>
>
>
Received on Wed Nov 26 2008 - 20:26:31 GMT