I've been looking at the same issue recently at my agency and the solution I'm currently testing involves the following app folder structure:
app/
default/
controllers/
models, etc
ecommerce/
controllers/
models, etc
lib/
S24/
ComponentCode.php
modules/
ecommerce/
admin/
controllers/
models, etc
default/
controllers/
models, etc
data, public web, temp, other ZF folders
The idea is common component code is stored in the lib, the modular application is stored in modules and the individual client website code is stored in app.
The lib/S24 and modules/ecommerce folders would be common and the same for each project (we SVN external these folders).
app is a module directory, so the default, and ecommerce folders create modules within ZF. app/default is for the default (i.e. no module) controllers. app/ecommerce would contain a set of controllers that simply extend controllers within modules/ecommerce/default/controllers.
You can then extend functionality in the app/ecommerce/controllers if you wish, or add new functionality.
Since we want to keep the module admin system the same and also support multiple admin systems (in URLs like www.domain.com/admin/ecommerce and www.domain.com/admin/user) we serve the modular admin system directly from the modules folder. Any custom admin pages can then be added to app/admin/controllers.
// Add Controller folder
$front->addControllerDirectory('/path/to/modules/ecommerce/admin/controllers', 'ecommerceAdmin');
// Add route
$router->addRoute(
'ecommerceAdmin',
new Zend_Controller_Router_Route('admin/ecommerce/:controller/:action',
array('module' => 'ecommerceAdmin',
'controller' => 'index',
'action' => 'index'))
);
As I say I am currently testing this but I hope it gives some ideas for your own system. Once I've got this completely stable I hope to write up a blog article on the topic.