Nov 12
Today: 12-Nov-2008: Backups first cut and fun with Drupal
Today I managed to get my first cut of the working backup system into the Joomla! trunk with the task system support. It hasn’t been fully put through its paces and the backup SQL plugin doesn’t appear to be working properly though the other plugin, the table copy one, is working properly which is good. It hasn’t been put through the full sequence yet of a task set but I’m hopefully I’ll look at it over the weekend.
What was more fun was spending time trying to get Drupal to play the game as a Joomla! component. It seems that different PHP apps have different approaches to handling paths. CiviCRM (and PEAR) for example rely on the include_path being set properly which usually stuff them up when you can’t set those variables for whatever reason – or the location they are isn’t in the path. I’ve seen issues with CiviCRM because you can’t set the include_path to what CiviCRM wants and the system just falls apart. Not so good. Drupal does things differently, relying that the bootstrap file is in the right folder. CiviCRM being cross platform (standalone, Joomla! or Drupal) can’t rely on Drupal’s technique because as soon as the entry point is in a different directory, it breaks. So I ended up rewriting Drupal’s include and require statements so that they didn’t use “path/to/file” or “./path/to/file” (they aren’t consistent about it either which is annoying) and made it use the Joomla! style of doing things. Joomla! when it gets started defines a bunch of constants that you can use to build file paths and be assured that they’re correct. Its done in one place so it only has to be changed there and the entire system can be shifted without include or require statements breaking horribly.
So I first tried doing global search and replaces and that didn’t work well and then ended up trying to manually find and replace entries. I managed to get the system through various levels but eventually gave up after a few hours and not having it work properly still. The final error was something about not finding some random menu function – annoyingly Drupal uses include statements instead of require statements and gaurds items with file_exists functions which makes it almost impossible to track down where a file isn’t being included properly and thus causing an error. I think I’ll need a different approach to solving the problem. To end things I decided do a clean Drupal install and follow through their module tutorial for something new and different. I’m not quite sure I agree with things fully even though I’ve gone through it and it seems to work in a primitive way.
No commentsNo Comments
Leave a comment