shannah/xataface

Add ability to override getModuleURL

malaire opened this issue · 2 comments

When creating a setup where I want to symlink module directories from DATAFACE_SITE_PATH/modules but keep the actual module directories outside of both DATAFACE_PATH and DATAFACE_SITE_PATH, I got error "Could not find URL for file $file in module tool" from

throw new Exception("Could not find URL for file $file in module tool");

It would be nice if I could override getModuleURL in Application Delegate Class for special setups like this.

Symlinking should work find. I'm pretty sure I've done that in the past myself. Perhaps there is a problem with permissions on the symlink, or some other aspect of how the symlink was created.

What OS are you using? If you can provide an example with precise steps of how/where symlinks were created, I might be able to comment further.

Checking the source code more closely I was able to find the problem:

I was linking DATAFACE_SITE_PATH/modules/tagger to /path-to-modules/tagger-VERSION

getModuleURL uses basename(dirname($file) which didn't work since tagger in link didn't match tagger-VERSION in real path.

What I want to do is to have central place for different modules and versions of modules, and then in each app link to what I need.

Easy fix to this was to add one extra directory and link to /path-to-modules/tagger-VERSION/tagger so the last component of real path matches module name.