Local and global copies of module? I have a module I'm developing that will be used by several sites.

I have a "preview" site on the same server that I would like to be able showcase new features in before promoting to the production sites.

I thought I would be able to have the production version in the drupal/modules directory, and the preview version in the drupal/sites/preview_site/modules directory. I had expected Drupal would load the module from the site's directory and ignore the copy in the global modules directory.

However, when I do this, I get the following error:


  PHP Fatal Error: Cannot redeclare


It would seem that Drupal is trying to load both copies!

Is there some way I can get it to only load the local copy?

Is there a better way to achieve this (I expect lots of people will say don't put the preview site on the production server.)
I have discovered that this wasn't a problem after all.

I think the error I initially got (on performing a "clear cache") was caused by the original version of my module already being loaded from global version, and loading again from the local version caused the "redeclare" error.

If I had just reloaded the page, Drupal would now know to load from the local copy, and ignore the global one.