As of this writing the nightly build is being built and the change is mainstream. You need the nightly (1.2.0) update site: http://update.phpeclipse.net/update/nightly
Thanks to ajt and ed_mann for making this possible!
I’ve been using eclipse and phpeclipse for some time now for my PHP related developments. One of the biggest productivity killers for me was that the browser preview always tries to preview your just edited PHP file, which in a model view controller application is utter nonsense. Just because I’m just editing controller.php doesn’t mean I want to preview http://localhost/project/controller.php. Instead this usually means I’d like to view http://localhost or http://localhost/mypage. This forced me to switch to firefox after every modification and reload the page there. What I would really like to see here is the automatic reloading, in firefox or if this is not possible in the internal preview (I think I have recently read somewhere that phpeclipse doesn’t support a preview on external browsers anyway).
I already made a feature request for this. You should be able to choose your own URL since the default behavior is nonsense for MVC apps (which I would hope most people do). Somehow I had the feeling that this will take a while, if it gets done at all. If the majority of phpeclipse users is satisfied with the way it is, it will never get mainstream.
So I sat down and tried it on my own. I’m totally new to eclipse plugin development but somehow I managed to find the relevant code in phpeclipse (which btw. is a huge codebase!) and after some more thinking I figured something out that wouldn’t force me to introduce an option (which would be a pain for me since I’m really totally new to PDE). So I implemented an educated guess: If you haven’t previewed anything before, the behavior is as always. With an MVC app this first preview will be nonsense. But after a URL has been loaded in the preview, on every save in every file it will just reload that page. So you can just edit the URL in the preview to point to whatever is interesting to you at this point, edit any file in your project and have it reloaded. You can change this URL any time.
If you are interested in the code patch (it’s only a couple of lines) leave a comment and I will send it to you or publish it here.
Have fun!
Tags: development, eclipse, pde, php, phpeclipse, programming
September 3rd, 2007 at 3:24 pm
Hi,
Why not stop by the #phpeclipse chat room on the freenode IRC network and we can discuss getting this patch into the code base.
Cheers,
AJ
January 30th, 2008 at 12:41 pm
Hum, i’ve been using phpeclipse for long too (and All-in-SEO, kudos!).
I also have the same problem and wondered why the hell it’s not a basic feature. Also,
Lately I’ve switched to PDT distribution. I don’t know how it relates to PHPEclipse, but this one does have integrated debugging with full breakpoints and scope management but it still doesn’t solve the problem you descirbe.
Ideally, for me, every php file in your project should have a list of url tests where you provide for each the $_REQUEST vars and other environment vars you want to set. Then, after saving, the user would be propmpted with a small pop-up with this list of “test urls” for the file being edited. Off course, this list would have selected the previous run test and would operate on simple ENTER, ARROWS and ESC keyboard strokes.
maybe I should stop by #phpeclipse, sure. i can not write it myself, but I can spec.