Resource load order?

I’m attempting to ensure some available state for my plugin and and so have implemented the initialize hook but I’m finding that it’s not finding the state (specifically the availability of my custom storage adapter, as configured).

This appears to be due to the resource load order defined within application.ini.

I am wondering why the plugins resource is set to load so early, it’s before pretty much anything else omeka loads up. Should I just reorder my application.ini or is the better alternative to ensure the Storage resource gets bootstrapped in my plugin?


Since I didn’t really want to mess with the application.ini I went with using Zend to bootstrap things from within my plugin. It works. I’m not sure if it’s the best way mind

public function hookInitialize()
     $storage = Zend_Registry::get('storage');

     if (!$storage->getAdapter() instanceof StorageAdapter) {
         throw new RuntimeException('The plugin has been enabled without the ' .
             'storage adapter being configured in the config.ini');

I’m hesitant to move the order of initialize around, because plugins could be relying on it happening so early (say, to alter some piece of configuration data before the resource using it loads).

Probably the best solution would be just adding a new hook that’s guaranteed to happen at the end of the bootstrap process, so a plugin author could just choose between the current nebulously-early initialize or (for example) bootstrap that happens right after bootstrapping’s done.

This seems like a good solution. Keep initialize as an early bootstrap hook and add a new late bootstrap hook for plugins that need all the system resources in place.

If theres no fear of breaking BC you could introduce two new hooks. early, late (post resource, pre plugin) and then initialize. This would give plugins the opportunity to alter the resources before other plugins get to use them.