development

Developing locally - playing with URLs

I have seen too many times that when people install drupal locally, they have no clue about how to set up local URL aliases, so here is my solution, resulting in urls like http://d/5/profile (drupal 5 installation for some profile related project).

The first step is to set up a clean, structured environment for our installations, preferably in our home directory.

File system setup

My structure looks as the following: I created a separate “projects” directory, under which i put the “drupal” directory.

Using Exuberant Ctags for Drupal

I use vim as main editor when writing code, and to help quick lookup for functions in other files I generally use exuberant-ctags (ctags for short). For Drupal by default it doesn't work, because it uses .module as extension for the files, so index the directory using the following command:

ctags --langmap=php:.module.inc -R includes/* modules/*

Now using g] in command mode will help us find the functions/constants we need.