The handlersLocation configuration doesn’t allow specifying files outside the directory the ModuleConfig.cfc is in - using either mappings or relative paths fail, due to ModuleService.cfc effectively doing this:
handlerInvocationPath = modulesInvocationPath & “.” & modName & “.#replace(mConfig.conventions.handlersLocation,”/",".",“all”)#";
handlerPhysicalPath = modLocation & “/#mConfig.conventions.handlersLocation#”;
So… it seems I need to override handlerInvocationPath and handlerPhysicalPath to make it work, but I can’t figure out the appropriate place to do it.
Alternatively, I’m thinking ModuleService.cfc could be updated to allow a mapping to work, something like:
if ( mConfig.conventions.handlersLocation.startsWith(’/’) )
{
mConfig.handlerInvocationPath = replace(mConfig.conventions.handlersLocation.substring(1),"/",".",“all”);
mConfig.handlerPhysicalPath = expandPath(mConfig.conventions.handlersLocation);
}
else
{
mConfig.handlerInvocationPath &= “.#replace(mConfig.conventions.handlersLocation,”/",".",“all”)#";
mConfig.handlerPhysicalPath &= “/#mConfig.conventions.handlersLocation#”;
}
Is there any reason that’s not a valid change to make?