Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Running multiple websites using only one Sapphire library

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

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

Page: 1
Go to End
Author Topic: 2749 Views
  • landzin
    Avatar
    Community Member
    2 Posts

    Running multiple websites using only one Sapphire library Link to this post

    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

  • dio5
    Avatar
    Community Member
    501 Posts
  • zyko
    Avatar
    Community Member
    66 Posts

    Re: Running multiple websites using only one Sapphire library Link to this post

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

  • saimo
    Avatar
    Community Member
    67 Posts

    Re: Running multiple websites using only one Sapphire library Link to this post

    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.

  • Sam
    Avatar
    Administrator
    679 Posts

    Re: Running multiple websites using only one Sapphire library Link to this post

    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

    2749 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.