Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Running multiple websites using only one Sapphire library


Go to End


5 Posts   3572 Views

Avatar
landzin

Community Member, 2 Posts

17 May 2008 at 7:15pm

i have a question about running multiple websites using only one sapphire library. It seems waste of space and inefficient to repeat copying the same code of sapphire library over and over for each website. However, i will keep the site specific folders such as tutorial or mysite and other folders will be kept seperately for each website. Of course, also a different database for each website.

But I would like to keep only one signle copy of sapphire framework or library. Please shed some lights on me about this issue. Thank you.

Regards,

landzin

Avatar
dio5

Community Member, 501 Posts

18 May 2008 at 3:10am

Subscribe

Avatar
zyko

Community Member, 66 Posts

18 May 2008 at 3:32am

if you have got shell access, you can use hardlinks ...
but not much of us (so do i) have this :..(

Avatar
saimo

Community Member, 67 Posts

18 May 2008 at 4:06am

I think this feels like non-issue. The size of the sapphire library isn't that large (less than 3Mb) compared to the typical account qoutas on webservers. If there is such a need to save space, then maybe it's time to upgrade to a bigger account instead? Or maybe make a second?

This might be a solution though(haven't tested it):
* Make a local directory structure on which is the same as the one on your account.
* In that directory structure, make softlinks to the appropriate folders.
* Upload using FTP.

I'm not 100% shure FTP supports softlinks, and the server might not allow it. It might be worth a try though.

Avatar
Sam

Administrator, 690 Posts

19 May 2008 at 1:05pm

I would recommend using symbolic links for this, on a unix/osx platform.

You could set up your file system like so:

/silverstripe
* /sapphire
* /cms
* /jsparty

/site1
* /mysite
* /themes

/site2
* /mysite
* /themes

And then create symlinks to the sapphire, cms and jsparty directories from within site1 and site2. Here is some shell script that will do that.

cd site1
ln -s ../silverstripe/sapphire
ln -s ../silverstripe/cms
ln -s ../silverstripe/jsparty
cd ../site2
ln -s ../silverstripe/sapphire
ln -s ../silverstripe/cms
ln -s ../silverstripe/jsparty