Eclipse PDT and Subversion
Version conflicts to be aware of
Ubuntu 8.10 (Intrepid Ibex) now ships with Subversion 1.5
You can’t use a svn 1.4 client and a svn 1.5 client on the same working copy.
Technical information on this site may be out of date : no updates since 2015
Ubuntu 8.10 (Intrepid Ibex) now ships with Subversion 1.5
You can’t use a svn 1.4 client and a svn 1.5 client on the same working copy.
Unit testing Drupal can be pretty challenging as it’s hard to isolate parts of the code.
One of the surprising things about Drupal is that it doesn’t use object oriented coding.
There’s a good page in the Drupal documentation about this
http://api.drupal.org/api/file/developer/topics/oop.html
It makes a good case for the design of Drupal, and goes a long way to explain why Drupal feels more OO than the code looks at first glance.
Well the new version of Eclipse (3.4 or Ganymede) is out and I’ve been trying it out. So far I’ve just installed it, adding in the components I want; and generally trying to see what’s new.
SimpleTest is a great testing framework for PHP, with a Drupal module available too.
Many tests are based on assert statements, but this patterns doesn’t work for functions which are expected to throw Exceptions. As at the time of writing Drupal’s simpletest module doesn’t catch exceptions and so the whole test run stalls.
In that case the following patterns are often useful.
This has just taken me a surprisingly long time to work out …
I needed to output a file with the following as a marker in various places.
It’s easy to save an Excel file as CSV and read it in PHP with the fgetcsv function but this may not work so well if the file contains non-English characters.
Excel uses a non-standard character encoding for csv files.
You can save an Excel file as ‘unicode’ text however there are several unicode systems - Windows uses UTF-16, and PHP uses UTF-8.
To open the ‘unicode text’ file in PHP you have to convert it, in addition you may want to be able to open UTF-8 files that may be created by other systems.
Using doc-comments in Eclipse really helps productivity by providing lots of tool-tip help and auto completion.
A colleague recently pointed out that Eclipse can auto-complete object properties (as long as you use the @property tag). I’ve found this really helpful and have been creating objects to return pass around - and found it a vwery neat way of working.