Quantcast
Channel:
Viewing all articles
Browse latest Browse all 4235

Re: SilverStripe in a SaaS Configuration

$
0
0

I've not done anything like this, but we considered the SaaS approach for a previous project. The idea we had was to simply use our _ss_environment.php file to switch out which database and assets folder is being used based upon the current domain name. Something like:

$domain = getenv(DOMAIN_NAME); // 'setEnv DOMAIN_NAME www.sitex.com' in vhost config
switch($domain) {
   case 'www.site1.com':
      define('SS_DATABASE_NAME', 'site1');
      define('ASSETS_DIR', 'assets_s1');
      break;
   case 'www.site2.com':
      define('SS_DATABASE_NAME', 'site2');
      define('ASSETS_DIR', 'assets_s2');
      break;
}


Posted to: SilverStripe in a SaaS Configuration | Show Thread | Post Reply


Viewing all articles
Browse latest Browse all 4235

Trending Articles