Question

If you drop all the tables in your Magento database, and navigate to your Magento site, what happens next?

The reason I ask is I assume that Magento would just check the local.xml settings, and rebuild the database with default/blank values.

The problem is I have an extension that uses the Composer autoloader for some of it's classes and therefore doesn't follow the Magento class naming convention. There are observers for that extension that bootstrap the composer autoloader but it seems like those observers aren't ran in the scenario of a Magento site having no tables yet.

Hope that makes sense, any help would be appreciated.

Was it helpful?

Solution

Well, I managed to work it out. I knew it was an autoloader issue, I just couldn't find the right event to observe.

I found this composer autoloader question that mentions the resource_get_tablename event. As a bonus I didn't even have to write my own observer since there's the Magento PSR-0 Autoloader extension that does just the trick!

I simply installed the extension, added my <composer_vendor_path/> to the <global> scope of my local.xml file and all was well in the world.

OTHER TIPS

It will return the following error:

SQLSTATE[42S02]: Base table or view not found: 1146 Table '[db].core_url_rewrite' doesn't exist
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top