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.

Customising the CMS /

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

Shared code base - near complete.


Go to End


2 Posts   1904 Views

Avatar
Rawbit

Community Member, 52 Posts

17 April 2009 at 2:24am

Edited: 17/04/2009 2:36am

We're working on a shared code base (for obvious advantages) that does not use symlinks, and thus far is working (see below) without modifying any of the core files. The last piece of the puzzle (that likely will require some customization of the cms) is to scandir for "mysite" type folders that are not in the root.

We have folders based on domain names for each client such as demo1.example.com, example.com etc. Here's a breakdown of our code base structure:

The code base engine:

/home/ssuser/public_html/index.php

Silverstripe (root that would normally go in public_html):

/home/ssuser/public_html/cshare/application/

User-based directories (some examples)

/home/ssuser/public_html/cshare/sites/demo1.example.com
/home/ssuser/public_html/cshare/sites/example.com
/home/ssuser/public_html/cshare/sites/anotherexample.nz
/home/ssuser/public_html/cshare/sites/clientexample.ca
/home/ssuser/public_html/cshare/sites/anotherclient-example.co.uk

The remaining bit we need help with is to force SilverStripe to look in our .../cshare/sites/ directory. for the appropriate domain based folder. It will contain all of the standard 'mysite' stuff such as a _config.php and code folder, etc.

Any thoughts on how to move forward? Currently, the code base is working! However, only inside of .../cshare/application/mysite. We've reached a road bump and any help is appreciated.

What we've been trying: We tried finding and replace all instances of scandir() (which turned up in 6 files: Filesystem.php, Folder.php, i18n.php, i18nTextCollector.php, JSTestRunner.php, and ManifestBuilder.php). We replaced it with scandir_cbase() where we've been trying to force it to look in our '/sites/' folder. Can anyone recommend if there's any easier way to approach this? Preferably one that does not need to hack at the SS core, or at least, that requires less file manipulation.

Avatar
ocean

Community Member, 37 Posts

21 April 2012 at 9:21pm

Hi Rawbit,

Has there been any progress with this since your last post, a mere three years ago?

I'm looking at doing something similar, it just makes sense when running loads of sites with 80 to 90 % of basically the same code...

If you have a chance to share any further discoveries and solutions along these lines it would be much appreciated!

Best wishes
~ Sean