Hello list, today I played with (bit) extending agavi a bit.
The aim: Multiple modules folders (app/modules, app/modules.base, app/modules.xxx ... ). The reason: Another possibility to sort and arrange modules. This all worked, without any change to agavi - yay! The custom controller had this new initializeModule method: http://gist.github.com/349541 This little addition to settings.xml. <settings prefix="modules."> <setting name="folders">%core.app_dir%/modules.core,%core.app_dir%/modules.base,%core.app_dir%/modules.xxx</setting> </settings> Then the config_handler was not happy at all, so I modified the config_handler-urls from: <handler pattern="%core.module_dir%/*/config/module.xml" class="AgaviModuleConfigHandler"> to: <handler pattern="%core.module_dir%*/*/config/module.xml" class="AgaviModuleConfigHandler"> (mind the * right behind %core.module_dir%). After a while I found out, that getModel did not work as it was supposed to be. So I created a custom Context and extended the getModel function by those two little lines: // let's try to autoload the baby if(!class_exists($class)) { // it's not there. the hunt is on + $lowerModuleName = strtolower($moduleName); + $file = AgaviConfig::get('modules.' . $lowerModuleName . '.path') . '/models/' . $modelName . 'Model.class.php'; } That's it. So here is what I ended up with, what could be useful: - The tiny AgaviConfig::get('modules.' . $lowerModuleName . '.path') could be handy after initializeModule was called, to get module path without building it by hand everytime - Allowing multiple folders as modules-folder is not as difficult as it seems to be. - There are some places in agavi left, which may not work yet (for instance action/global filters aren't supported, yet!) What do you think? Worth further investigation? How do you organize Core and Default-Modules (incl. routing+actions+views) in your agavi projects? Thanks for reading and kind regards, Draco -- http://dracoblue.net _______________________________________________ Agavi Dev Mailing List [email protected] http://lists.agavi.org/mailman/listinfo/dev
