문제

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.

도움이 되었습니까?

해결책

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.

다른 팁

It will return the following error:

SQLSTATE[42S02]: Base table or view not found: 1146 Table '[db].core_url_rewrite' doesn't exist
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top