2 configuration files.

76 views
Skip to first unread message

v.

unread,
Sep 25, 2017, 10:10:07 AM9/25/17
to Fat-Free Framework
Hi,

I have set up a bunch of websites on the same hosting environment.
I would like to split off parts of the configuration file - like database connection, smtp settings - from the site specific stuff, so that I can have the shared settings in a specific location, accessible for all sites.
How would I go about this?

kind regards,

v.

ved

unread,
Sep 25, 2017, 10:26:21 AM9/25/17
to f3-fra...@googlegroups.com
Use different configuration files.

Expanding a bit: for example, create one global.ini that all your apps require and then per-site configuration files and just use them on specific apps.

There are many ways to accomplish this type of thing.

v.

unread,
Sep 25, 2017, 3:04:17 PM9/25/17
to Fat-Free Framework
ok, thank you for your answer. I easily managed to use 2 seperate imports in the index file.
apologies for the obviously dumb question, I don't know why I thought we were tied to the standard filenames and config files.

John Bultena

unread,
Dec 15, 2017, 7:34:26 AM12/15/17
to Fat-Free Framework
I managed this with this trick:

using  in index.php

$host = $f3->get('HOST');
if (substr($host,0,4)<>'www.' ) {$host = 'www.'.$host;}
$f3->config('config/'. $host .'.ini');

with multiple config files named
www.example.com.ini
www.example.org.ini
www.example.net.ini

Op maandag 25 september 2017 16:10:07 UTC+2 schreef v.:
Reply all
Reply to author
Forward
0 new messages