Posts tagged ‘Xdebug’

February 9, 2008

Komodo – The first 3 months

Update: Sean and Shane gave me some tips on some hidden goodies, post updated to reflect that

Update: Sean C came to the rescue on how I should decrease indenting, shift + tab, works like a charm! thanks mate :) Still think it should be listed in the menu like all the other shortcuts

Shane told me how to do the panel hiding, apparently you can do Help – List Keybindings, now who on this earth ever looks in there ;-)

For showing/hiding the 3 panes:

  • Project pane, project tab (left) ctrl+shift+p
  • Project pane, code tab (left) ctrl+shift+c
  • Toolbox pane (right) ctrl+shift+t
  • Output pane (bottom) ctrl+shift+o
  • Focus to edit pane ctrl+shift+e

Even cooler is, I can do custom keybindings


Managed to fix this somehow, managed to fix the dir in another dir but not really (a mouthful) issue, not sure how tho :)


About the folder add problem, filed a bug http://bugs.activestate.com/show_bug.cgi?id=74774 Hopefully Todd will resolve this before 4.3.0 is out


After I got my new laptop in last November I decided to get a new editor that could work in Windows & Linux and Sean C. told me to give Komodo a go; Having tried it couple of years back and having what I’d describe as blend feelings then I wasn’t really convinced but thought I had nothing better to do (was at a conference) and installed the trial for Komodo IDE and wow it had improved a TON, I must say I fell instantly in love with it.

After having used it I found a couple of flaws or well things that made the usage not perfect for me but well perfection is a rare thing ;-)

First problem I saw was it a bitch when I had HUGE projects with bazillion files and all in a SCM of one or another sort, it would basically just hang when trying to fetch all the status info for each file (Komodo does this nifty thing to show you in your file manager if the file has been edited or is not in sync with the SCM) so handling projects like the pear installer was not so … optimal but after a quick email exchange with Shane C. then he told me that Komodo 4.3 will fix that, he actually finally blogged about it today: http://blogs.activestate.com/shanec/2008/02/komodo-43-in-te.html

And it looks like 4.3 will fix another pet peeve of mine, searching for things per project, on linux it’s a breeze from the command line, grep -ri “foobar” . in the root of the project and voila, supports some regex and what not, perhaps not the most slick solution but it does work and having it straight in Komodo will be nice even tho it will be hard to break of using the cli but perhaps a good thing, can’t setup gnuwin32 on all the machines I might have to code on if they should contain a Windoze.

The Unit Test feature in 4.3 also sounds quite interesting but I’m very disappointed that they don’t seem to support .phpt tests or at least they don’t say they do, PHPUnit is all well and good but most of my tests are phpt so what I’m saying, Shane I demand you add phpt support! I mean it’s the default PHP test suite ;-) Oh and it would be nice if I could make it run the php run tests and the pear one, basically the same but different test runners it calls.

Now back to my problems and what I like with 4.2 :)

For some reason a directory in my project file listing was moved INTO another directory and I can’t for my little life move it back, even if it didn’t happen on the FS it self, it just baffles me, bugging having to remember that one bloody folder is in a different place JUST in komdo for one project :P

As Peter Griffin would put it, this really grinds my gears.

Adding a new file to a SCM via Komodo is also just a pain in the butt, for some reason I can’t add a folder unless I issue a full add on the root folder of the folder I’m trying to add … or something like that, usually end up doing it via cli.

Komodo is lacking some usability shortcuts … decrease ident doesn’t have a short cut, hiding the left / right panes don’t have shortcuts (to my knowledge) perhaps even adding something like Dynamics AX has (just started using it at work, one of the features I liked) which basically is I can hide it but I see a small bar on the left side and when I hover it it pops out and when I leave it for X time it goes away again or like Opera does it, a very thin bar which I have to click or some shortcut and it pops out, click it again it goes away, anyway just a nice feature to have because I tend to work on a 13,3″ screen in 1280×800 which is not a lot of screen space.

Ohh and I also want a way to checkout a repo; Bugging to use the run command or plain cli to do that, best would be if I could do a checkout and auto create a project for it :P

But other than that it has been rocking hard for my use cases, almost perfect ;-) Still having tried the whole debug feature, using xdebug via Komodo and all that but I will soonish, I’m told it’s a very useful and fun feature and perhaps some addons, having seen many thus far, might have been looking in the wrong place.

So all in all, big thumbs up to Komodo, and thanks to ActiveState and Shane for plugging a free license for me since I only do coding in my spare time and don’t have a company to buy it for me and so basically ActiveState has been sponsoring my last 3 months of open source work! Very cool! Would be even cooler if Greg Beaver would get a license, he’s another great OS coder that doesn’t make a living of doing programming, he told me he tried to contact someone in ActiveState with no luck, hopefully someone will see this post and fix that up :-)

Can’t wait for 4.3 /me counts the days

Advertisements
June 8, 2007

PEAR Installer 1.6.0 and XDebug code coverage

One thing I’ve always missed in phpt is code coverage reports, not lcov since I’m talking about testing userland code, kinda like we have in PHPUnit so I decided to implement it in pear run-tests so that I could check out how much code I’ve made tests for in PEAR and other projects where I utilize the phpt format.

So the first thing I had to figure out was the RunTest code in PEAR, it’s a old port of php run-tests and hadn’t really been updated to any real extent, mostly just adding features here and there, so what I did was to split it up into multiple functions so that it would be easier to understand the beast, run() was 700+ lines IIRC and in this process I managed to find a good amount of redundant code that we could throw out, yay! :) So the next step was to figure out how to make XDebug only provide coverage reports for only the tests and the code they run and not to include the RunTest code in the equation with out me having to filter it out, and then a very ugly solution dawned on me, I’d have to inject the XDebug start / stop / get coverage code into RunTest, OH MY GOD! :-/

But for those that understand how we execute tests this will make a lot of sense, because each test gets it’s own php process, we use proc_* for that, and why might one ask and the answer is simple, mainly to test PHP fatal errors and code that uses exit/die as well as being able to define our own ini options that the process will use (enable safe mode, disable magic quote and things like that) … There might be some other reasons but these are the most important IMHO.

Tho the first two reasons caused me some headache, since of course fetching the coverage info and throwing it into a file won’t work if a PHP Fatal error occurs or if a die/exit get processed in the test since it’s done at the end of each test, so I had a little chat with Derick to see if we could find some proper solution for that challenge and he said he was going to look into it for XDebug 2.1, yay for Derick :-D So to sum up a little I take the FILE part, detect the first and inject the start / get coverage / stop XDebug code as well as var_export($xdebug, true); and write that to a file in the same dir as the test with the file ending .xdebug (name can change, just seemed the most straight forward at the time :P) and hurray we have a file that contains a valid PHP array with the coverage info! :D

This isn’t a silver bullet, it needs some more work and a renderer package to make those pretty graphs and progress bars, like we have at gcov.php.net or similar but at least it’s progressing into the right direction and I’m pretty happy if it becomes useful to only handful of people, if more use it then I’ll be thrilled.

So anyone up to helping with the renderer package ? :-)

Tags: , , ,