Fixing a Broken Drupal 7 Registry

In Drupal 7 we have a very nice "registry" that registers what PHP classes should be loaded from what files.

Unfortunately you can get the system into a state where it can't bootstrap to a high enough level to rebuild the registry (normally done by clearing the cache). What do you do then?

I had this situation today due to an annoying Rules/Entity issue, and dereine pointed out that it had recently been an issue in the Views queue.

Since the solution given in the Views queue didn't work for me, I created a package that you can use to get out of this trouble, Registry Rebuild.

When would you need Registry Rebuild?

You might get something like:

PHP Fatal error:  Class 'EntityAPIControllerExportable' not found in ...sites/all/modules/rules/includes/rules.core.inc on line 11

If this happens when you're trying to run update.php, and happens when you're trying to clear your cache, well, you have some trouble. That's what Registry Rebuild is for.

When would you *not* need Registry Rebuild?

If you can access any page, or install a module, or run update.php, you almost certainly don't need Registry Rebuild.

Please see the project page for instructions how to use it.

3 comments

by Ashok Modi on Tue, 2011-06-21 12:18

I ran into this issue this morning as I was trying to restructure my modules. Wish I'd seen this post before I started on my arduous process of getting things up and running properly again :)

by Will Vincent on Tue, 2011-06-21 16:30

This sounds like a good candidate for being a drush plugin.

I thought it would be best as a drush plugin, but didn't know how to prevent drush from going to BOOTSTRAP_FULL. If there's an easy way to do that then this is a no brainer.

Drupal theme by Kiwi Themes.