Mess up your modules, Mess up your registry...

and mess up your Drupal site "permanently". Not Really.

I screwed up my Drupal project one day by copying my modules directory and forgetting to move it out of it's parent directory. Details are unimportant.

The point is, I cleared my cache and did a few other things and Drupal started looking for modules in a location that was unavailable. Needless to say (I hope needless anyway), the system and registry tables were out of sync with some of the modules.
Fixing (or so I thought) the registry table manually was unsuccessful.

Long story short, thank you Apollo Tang provided the following script on this page.

<?php
// $Id$
/**
* @file
* Rescue script that rebuilds the code registry in the event of Drupal not
* being able to do a full bootstrap due to a corrupt/lost code registry.
* One cause of a bad registry is modules being moved to a new location.
*
* Run from the root directory of the Drupal installation.
*/
/**
* Root directory of Drupal installation.
*/
define('DRUPAL_ROOT', getcwd());
$defaults = array(
'HTTP_HOST' => 'localhost',
'PHP_SELF' => '/index.php',
'QUERY_STRING' => '',
'REQUEST_URI' => '/',
'SCRIPT_NAME' => NULL,
'REMOTE_ADDR' => '127.0.0.1',
'REQUEST_METHOD' => 'GET',
'SERVER_NAME' => NULL,
'SERVER_SOFTWARE' => NULL,
'HTTP_USER_AGENT' => 'console',
);
// Replace elements of the $_SERVER array, as appropriate.
$_SERVER = $_SERVER + $defaults;
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
require_once DRUPAL_ROOT . '/includes/entity.inc';
require_once DRUPAL_ROOT . '/includes/common.inc';
require_once DRUPAL_ROOT . '/modules/system/system.module';
require_once DRUPAL_ROOT . '/includes/database/select.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
registry_rebuild();
?>

Use in good health. and don't screw up your modules directory.