bcartier Posted September 21, 2013 Share Posted September 21, 2013 I'd like to symlink the /site/modules directory so I centrally maintain them for multiple sites, but there are path issues with doing that - particularly with multi-lingual sites, I think. If I'm careful when upgrading ProcessWire (only overwriting core modules in wire/modules when upgrading), is there any other disadvantage to putting common modules used by all sites into the wire/modules directory in a multi website setup? I'm using the 'separate database per site' method. Thanks for your help, -Brent Link to comment Share on other sites More sharing options...
diogo Posted September 22, 2013 Share Posted September 22, 2013 I don't think there is any disadvantage besides the upgrading. 1 Link to comment Share on other sites More sharing options...
ryan Posted September 22, 2013 Share Posted September 22, 2013 It does make your upgrade task a lot more difficult, but ProcessWire itself doesn't care if you put modules in /wire/modules/ rather than /site/modules/. Link to comment Share on other sites More sharing options...
Pete Posted September 22, 2013 Share Posted September 22, 2013 But by the same token, there's no big problem with just putting modules as you need them on a project into your central site/modules directory - if I understand your setup correctly they won't add any overhead until you actually install them on a specific site anyway, they'll just sit there ready to install. Link to comment Share on other sites More sharing options...
bcartier Posted September 22, 2013 Author Share Posted September 22, 2013 Thanks gentlemen. Ryan - would it be difficult to add a shared modules directory that ProcessWire could be configured to look for? Something like: /wire/ /modules/ /site/ /site-example1/ /site-example2/ Perhaps you could add a preference in "/index.config.php" , since that's where you'd set up the domain routing for multiple sites anyway? That way, the default single-site install doesn't have the overhead/complexity, but a multi-site install could take advantage? 2 Link to comment Share on other sites More sharing options...
diogo Posted September 22, 2013 Share Posted September 22, 2013 Ryan - would it be difficult to add a shared modules directory that ProcessWire could be configured to look for? Something like: same for themes 1 Link to comment Share on other sites More sharing options...
bcartier Posted September 22, 2013 Author Share Posted September 22, 2013 Good call diogo! Ideally the admin theme should be shared too. Maybe something more like this then: /wire/ /shared/ /modules/ /templates-admin/ /site/ /site-example1/ /site-example2/ 3 Link to comment Share on other sites More sharing options...
ryan Posted September 28, 2013 Share Posted September 28, 2013 Sounds interesting. I'll look into this as a future option, as it would make a lot of sense in a single-install, multi-site environment. 3 Link to comment Share on other sites More sharing options...
bcartier Posted November 17, 2013 Author Share Posted November 17, 2013 As a temporary solution, I've had success adding a 'global' folder containing "templates-admin" and "modules". Then I modified index.php (in the root of the ProcessWire install) like so (modified lines marked with a comment): /* * Setup configuration data and default paths/urls * */ $config = new Config(); $config->urls = new Paths($rootURL); $config->urls->wire = "$wireDir/"; $config->urls->site = "$siteDir/"; $config->urls->modules = "$wireDir/modules/"; //EDITED HERE $config->urls->siteModules = "global/modules/"; $config->urls->core = "$coreDir/"; $config->urls->assets = "$assetsDir/"; $config->urls->cache = "$assetsDir/cache/"; $config->urls->logs = "$assetsDir/logs/"; $config->urls->files = "$assetsDir/files/"; $config->urls->tmp = "$assetsDir/tmp/"; $config->urls->templates = "$siteDir/templates/"; //EDITED HERE $config->urls->adminTemplates = is_dir("global/$adminTplDir") ? "global/$adminTplDir/" : "$wireDir/$adminTplDir/"; $config->paths = clone $config->urls; $config->paths->root = $rootPath . '/'; $config->paths->sessions = $config->paths->assets . "sessions/"; It would be great if the file used for routing (index.config.php) could handle this kind of override, so that we don't have to worry about replacing index.php during upgrades... Hope that helps someone! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now