PHP debug workflow suggestions

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

PHP debug workflow suggestions

feek
Hi all,

I was wondering what php-debug workflow you use in combination with our favorite texteditor TextMate.

I do not want to use a massive and expensive IDE (like phpStorm), just TM.

Now I've setup Xdebug (MAMP-PRO), with xdebug.file_link_format set in php.ini. So on a error in the browser I can click on the link, and the related file is opening in TM on the good position!
I did not found any TM-bundles for Xdebug in order to set breakpoints (via markers?).

Maybe a suggestion is Codebug (http://codebugapp.com). But there is no integration with TM like they have for Sublime Text (http://codebugapp.com/using-codebug-sublime-text/ and  https://nateofnine.com/2014/05/30/sublime-text-xdebug-client/)

Do you have better suggestions for debugging PHP using TM and Xdebug?

Have a nice weekend,
Feek
Reply | Threaded
Open this post in threaded view
|

Re: PHP debug workflow suggestions

George McGinley Smith
I don't, debugging is the only thing that I use phpStorm for. I did try MacGDBp but it was so buggy I gave up. If you do find a solution, please do share.

On 30 April 2016 at 19:55, feek <[hidden email]> wrote:
Hi all,

I was wondering what php-debug workflow you use in combination with our
favorite texteditor TextMate.

I do not want to use a massive and expensive IDE (like phpStorm), just TM.

Now I've setup Xdebug (MAMP-PRO), with xdebug.file_link_format set in
php.ini. So on a error in the browser I can click on the link, and the
related file is opening in TM on the good position!
I did not found any TM-bundles for Xdebug in order to set breakpoints (via
markers?).

Maybe a suggestion is Codebug (http://codebugapp.com). But there is no
integration with TM like they have for Sublime Text
(http://codebugapp.com/using-codebug-sublime-text/ and
https://nateofnine.com/2014/05/30/sublime-text-xdebug-client/)

Do you have better suggestions for debugging PHP using TM and Xdebug?

Have a nice weekend,
Feek




--
View this message in context: http://textmate.1073791.n5.nabble.com/PHP-debug-workflow-suggestions-tp29945.html
Sent from the textmate users mailing list archive at Nabble.com.

_______________________________________________
textmate mailing list
[hidden email]
http://lists.macromates.com/listinfo/textmate



--
Kind regards,
George.

http://gsgd.co.uk


_______________________________________________
textmate mailing list
[hidden email]
http://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: PHP debug workflow suggestions

feek
Hi George,

Thnx for the reply. PhpStorm is to massive. After about 1hr testing of the trial, I've deleted the App. That's not the app for me :(

Codebug is not bad, but I do not know if the app is abandonware or not...

I hope there is someone else with an other suggesting!

regards,
Feek
Reply | Threaded
Open this post in threaded view
|

Re: PHP debug workflow suggestions

Ed Wong-3
Hi Feek,

Probably not what you want to hear but I’ve gotten along fine with using the built in PHP tools: echo, print, print_r, var_dump, debug_backtrace. On the browser side: inspection tools to trace JS and console.log is nice. Also writing out to a file when doing any sort of AJAX or other remote delivery work.

I agree that it would be nice to have a worthy debugger to speed things up but until one comes along that works as smoothly as XCode or Visual Studio (gasp!) building desktop apps, I’ll keep going old school.

Ed


> On May 4, 2016, at 6:46 AM, feek <[hidden email]> wrote:
>
> Hi George,
>
> Thnx for the reply. PhpStorm is to massive. After about 1hr testing of the
> trial, I've deleted the App. That's not the app for me :(
>
> Codebug is not bad, but I do not know if the app is abandonware or not...
>
> I hope there is someone else with an other suggesting!
>
> regards,
> Feek
>
>
>
> --
> View this message in context: http://textmate.1073791.n5.nabble.com/PHP-debug-workflow-suggestions-tp29945p29959.html
> Sent from the textmate users mailing list archive at Nabble.com.
>
> _______________________________________________
> textmate mailing list
> [hidden email]
> http://lists.macromates.com/listinfo/textmate


_______________________________________________
textmate mailing list
[hidden email]
http://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: PHP debug workflow suggestions

feek
Thnx Ed,

No problem at all, I'am just seeking a improved workflow. When that will be just better/improved own debug php functions, I've no problem with that.

So I also appreciate a good source of debug php functions using f.e. Xdebug (I did not find jet) that I can use to print_r to my php_debug.log file and "tail -f" in iTerm.

Regards,
Feek
 
Reply | Threaded
Open this post in threaded view
|

Re: PHP debug workflow suggestions

Carpii UK
You could try MacGDBp.. Its a Cocoa PHP debugger, which uses XDebug

I've had some good success with it in the past, but admittedly I haven't used it in a while, so I don't know if it 'understands' the latest PHP language features

As it happens, their website is down right now, but I was on there yesterday

No new version in a while, but there are recent changes to the github so it hasn't been abandoned... 





On 5 May 2016 at 06:12, feek <[hidden email]> wrote:
Thnx Ed,

No problem at all, I'am just seeking a improved workflow. When that will be
just better/improved own debug php functions, I've no problem with that.

So I also appreciate a good source of debug php functions using f.e. Xdebug
(I did not find jet) that I can use to print_r to my php_debug.log file and
"tail -f" in iTerm.

Regards,
Feek





--
View this message in context: http://textmate.1073791.n5.nabble.com/PHP-debug-workflow-suggestions-tp29945p29961.html
Sent from the textmate users mailing list archive at Nabble.com.

_______________________________________________
textmate mailing list
[hidden email]
http://lists.macromates.com/listinfo/textmate



_______________________________________________
textmate mailing list
[hidden email]
http://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: PHP debug workflow suggestions

feek
Hi Carpii,

Yes, I also found MacGDBp. That's similar to Codebug, but even less scriptable via TM.

Finally I've chosen my setup (for the time being):. Is a terminal based setup and VIM.

I've installed:
https://github.com/brookhong/DBGPavim

And I have a TM-command thats opens the current TM-file on the current line in VIM:
#!/usr/bin/env bash

[[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh"

# Open current file on current line in VIM in a iTerm session 

osascript << END
if application "iTerm" is running then
	-- iTerm is running
	if (count windows of application "iTerm") is 0 then
		-- NO window is found
		tell application "iTerm"
			set newWindow to (create window with default profile)
			tell current window
				tell current session
					write text "vi +$TM_LINE_NUMBER \"$TM_FILEPATH\""
				end tell
			end tell
		end tell
	else
		-- Window(s) Found
		tell application "iTerm"
			select first window
			tell current window
				set newTab to (create tab with default profile)
				tell current session
					write text "vi +$TM_LINE_NUMBER \"$TM_FILEPATH\""
				end tell
			end tell
			--set newWindow to (create window with default profile)
		end tell
	end if
else
	-- iTerm is NOT running
	tell application "iTerm"
		activate
		tell current window
			tell current session
				write text "vi +$TM_LINE_NUMBER \"$TM_FILEPATH\""
			end tell
		end tell
	end tell
end if
END

I've also a Keyboard Maestro macro that runs the TM-command, goes to the iTerm/VIM window, set a breakpoint at the current line, starts the debugger to listen, goes to the browser, reload the page, goes back to iTerm and start the debugger. See:


So with one keyboard shortcut in TM I start the debugger :) (I was not able to do that via Codebug or MacGDBp).

But of course, it would be nice when the Xdebug functionality could be implemented in the TM PHP-bundle :)

Regards,
Feek
Reply | Threaded
Open this post in threaded view
|

Re: PHP debug workflow suggestions

feek
Hi,

because I post via Nabble.com, I see that my TM-command did not show up in the e-mail:

=== Code

#!/usr/bin/env bash

[[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh"

# Open current file on current line in VIM in a iTerm session

osascript << END
if application "iTerm" is running then
        -- iTerm is running
        if (count windows of application "iTerm") is 0 then
                -- NO window is found
                tell application "iTerm"
                        set newWindow to (create window with default profile)
                        tell current window
                                tell current session
                                        write text "vi +$TM_LINE_NUMBER \"$TM_FILEPATH\""
                                end tell
                        end tell
                end tell
        else
                -- Window(s) Found
                tell application "iTerm"
                        select first window
                        tell current window
                                set newTab to (create tab with default profile)
                                tell current session
                                        write text "vi +$TM_LINE_NUMBER \"$TM_FILEPATH\""
                                end tell
                        end tell
                        --set newWindow to (create window with default profile)
                end tell
        end if
else
        -- iTerm is NOT running
        tell application "iTerm"
                activate
                tell current window
                        tell current session
                                write text "vi +$TM_LINE_NUMBER \"$TM_FILEPATH\""
                        end tell
                end tell
        end tell
end if
END

=== END CODE

also see http://textmate.1073791.n5.nabble.com/PHP-debug-workflow-suggestions-td29945.html
Reply | Threaded
Open this post in threaded view
|

Re: PHP debug workflow suggestions

George McGinley Smith
Seems like https://github.com/brookhong/DBGPavim would be a good place to start for a TM2 native version.

On 6 May 2016 at 17:15, feek <[hidden email]> wrote:
Hi,

because I post via Nabble.com, I see that my TM-command did not show up in
the e-mail:

=== Code

#!/usr/bin/env bash

[[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && .
"${TM_SUPPORT_PATH}/lib/bash_init.sh"

# Open current file on current line in VIM in a iTerm session

osascript << END
if application "iTerm" is running then
        -- iTerm is running
        if (count windows of application "iTerm") is 0 then
                -- NO window is found
                tell application "iTerm"
                        set newWindow to (create window with default profile)
                        tell current window
                                tell current session
                                        write text "vi +$TM_LINE_NUMBER \"$TM_FILEPATH\""
                                end tell
                        end tell
                end tell
        else
                -- Window(s) Found
                tell application "iTerm"
                        select first window
                        tell current window
                                set newTab to (create tab with default profile)
                                tell current session
                                        write text "vi +$TM_LINE_NUMBER \"$TM_FILEPATH\""
                                end tell
                        end tell
                        --set newWindow to (create window with default profile)
                end tell
        end if
else
        -- iTerm is NOT running
        tell application "iTerm"
                activate
                tell current window
                        tell current session
                                write text "vi +$TM_LINE_NUMBER \"$TM_FILEPATH\""
                        end tell
                end tell
        end tell
end if
END

=== END CODE

also see
http://textmate.1073791.n5.nabble.com/PHP-debug-workflow-suggestions-td29945.html



--
View this message in context: http://textmate.1073791.n5.nabble.com/PHP-debug-workflow-suggestions-tp29945p29969.html
Sent from the textmate users mailing list archive at Nabble.com.

_______________________________________________
textmate mailing list
[hidden email]
http://lists.macromates.com/listinfo/textmate



--
Kind regards,
George.

http://gsgd.co.uk


_______________________________________________
textmate mailing list
[hidden email]
http://lists.macromates.com/listinfo/textmate