Hi guys!
I've been studying SS now for some time trying to get a grip on the multi-sites "issue". There are a lot of posts lying around asking the same question over and over again; what exactly needs modification in order to use symlinks for multiple sites?
Having read through quite a few of these without finding any specifics me and my coders have of course started digging in the code ourselves and here is what we've found out so far:
In our test installations (using silverstripe version 2.3.1 on a linux server) we created symlinks for cms, jsparty and sapphire. We did not create a silverstripe-cache folder prior to installation. (Should we? Grateful for a clear answer on this one...) In our .htaccess files we have FollowSymLinks activated.
Following UncleCheeses hints we started on File.php, Folder.php and GD.php.
In the file sapphire/filesystem/GD.php you need to change:
In function makeDir($dirname) the variable $dirname contains a relative path to the assets folder. By replacing .. in the variable with the return value of Director::BaseFolder() you get the correct path.
In function writeTo($filename) the variable $filename contains a relative path to the assets folder. By replacing .. in the variable with the return value of Director::BaseFolder() you get the correct path. (I.e. same as in makeDir)
These two changes seems to allow SS to create the _resampled folder and save resized images correctly under it. (Please comment on these changes UncleCheese, if you have the time...)
Prior to the changes the system tried to create the folder and save the files under the linked "master" installation. However it is not perfect... For instance the small thumbnails that shows (should show) when you insert a image in the TinyMCE editor does not show because they are still saved in the master installations asset/xyz/ folder. We have not yet had enough time to figure out what to change to get this working. Help would be appriciated (UncleCheese?). GD.php should be fine, nothing more to do there, but File and Folder are still unmodified.
UncleCheese says that it works great and you have a script that sets up a new sites in seconds. What I can't figure out is if this works good, why is it not implemented/changed/fixed in the core? Are there any caveeats to this that would hinder a normal installation for instance? Does it break anything else? Could you, UncleCheese, please post exact details on what needs to be changed in the files and your experience?
I will post any details that we find out, but the going is slow, since this is our first endevour into SS code. (Haven't even done a site with it yet). But this is a very important issue for us since we are evaluating a move from our own CMS to SS. Being used to apply for instance security fixes and upgrades on one master installation for all our customers this is a big thing for us.
Tim