It appears that xautoload works fine on install for hook_schema but when uninstalling it fails. I have found a workaround by storing a table of schema data in the database on installation and using that for the uninstall but it would be better if I could find a way to load on uninstall so I dont need to use the workaround.

Comments

donquixote’s picture

Hi!
This requires some more thinking.
At the moment that you uninstall a module, this module is already disabled. So naturally, xautoload does not register this module's namespaces.

At this time we cannot even guarantee that xautoload itself is enabled. Because module dependencies do only apply to enabled modules.

The only solution I could think of is to roll your own mini class loader as a fallback. Or include those classes manually.
You can have a look at xautoload.emulate.inc for some inspiration :) it is really not hard to make a custom class loader for a very specific purpose.
The emulate.inc in 7.x-2.x is for the pseudo-PEAR variation of xautoload, but it shouldn't be so hard to adapt that for PSR-0.

EDIT:
I would recommend that you only activate this fallback loader during uninstall, but continue to depend on xautoload while the module is enabled.

donquixote’s picture

Status: Active » Closed (won't fix)

I think not much we can do. I am closing this.

The xautoload.emulate.inc is a bit nicer in 7.x-3.x, btw.

damiandennis’s picture

Thanks I will look into the xautoload.emulate.inc