Jan 30 2009

How to profile your PHP scripts with Xdebug

Performance is a big issue on the web, if you pages take too long to load then people will go elsewhere. Sometimes your problems can be solved with cache control on your server, but still some cases require optimisation of your code. For this task, you should be using a technique known as ‘profiling’ – essentially a debug log of what your script or program did during execution, which functions were called and how long it took. It gives you a great glimpse into what it is that is taking too long to execute which means you have something concrete to look at when you need to optimise your system.

Fortunately Read the rest of this entry »

Geoff Adams
Programmer, Research and Development

Jan 16 2009

Easy AJAX with jQuery and PHP

AJAX has been hard to miss over the last few years, but if you still haven’t played around with it you could be missing out. If you don’t even know what it means, then it supposedly stands for Asynchronous Javascript And XML – but don’t let that catch you out. It is simply a means to communicate between a user’s browser after they have loaded your page and your web server – Javascript and XML need not be involved! I’m more of a JSON (JavaScript Object Notation) man myself, preferring it to XML due to its smaller footprint and closer relation to programming data structures. For this quick tip, I shall be using it along with PHP and some rather neat Javascript code made possible by the great framework jQuery. Read the rest of this entry »

Geoff Adams
Programmer, Research and Development

Jan 02 2009

PHP Development Tools v2.0

It has been a long time coming, but it is finally here: the PHP Development Tools for Eclipse (PDT) have reached v2.0! We mentioned a few weeks ago that the project was going into release candidate overdrive in the run-up to its proposed release on Dec 29th, well, it well and truly did that. It even made its predicted release date! That has to be an achievement in open source development!

So, what can you look forward to now? Well, a whole raft of new snazzy features, split between various parts of the system which makes up PDT (such as the Web development tools and dynamic languages core behind it all). As it now runs in Eclipse 3.4, you can utilise the brilliant new JavaScript editor, a much improved code assist feature and support for all the new little bits and pieces which are lurking around for the current Eclipse base.

It remains to be seen what the big killer features will be for this new version, but from what I have experienced of it so far, it seems a much more stable and solid base from which PDT can blossom for the future. This all means better features, more often – which is never a bad thing!

You can grab the all-in-one package here, so hop to it!

Geoff Adams
Programmer, Research and Development

Dec 12 2008

Eclipse PDT 2.0 incoming

It looks like the next major release of one of the best PHP development tools around, PDT for the Eclipse platform, is due out soon. Version 2.0 had initially been expected on September 15th earlier this year, but due to a shift in the specification and roadmap for the project they ended up delaying the proposed release date to December 29th.

This date seems to be realistic, as the first of 3 proposed release candidates was released on December 9th on the PDT site. This is good news, as it is intended to provide a bunch of new features for us PHP developers out there, along with better integration with existing Eclipse frameworks and foundations such as the WTP and DLTK modules.

Among the proposed features are such things as support for PHP 5.3 (namespaces and so on) and Eclipse 3.4. This shift to the latest Eclipse base will please many people as it will allow them to utilise the latest versions of productivity tools and other development IDEs which only work in v3.4 (PDT 1.03 only works on Eclipse 3.3 from my experience, I haven’t tested PDT 1.05 which was released recently and says it works with Eclipse 3.4 – maybe this is a stop-gap solution).

The full plan is available here for those of you who are interested, but the main points of improvement are:

  • Mark occurances – a handy editor feature for refactoring and debugging
  • Improvements to the modelling of your PHP projects in the system (PHP Model Infrastructure, whatever that is, Type Hierarchy View and an improved PHP Explorer)
  • Code templates
  • Code assistance with dynamic variables and types along with overridden methods

As you can see, none of the features are going to change your life overnight, but they may well make an already great tool even better, tighter and more in-depth than before – which can’t be bad.

If you want to check out the release candidates (RC1 is out at the time of writing) then go over to the PDT download page and grab it there. You will need Eclipse 3.4 with a few other modules first though!

Geoff Adams
Programmer, Research and Development