multiple instances only config files change |
Hello,
i try on google and did not find anything. sorry for my bad English. i am working bussince application in CI 3. i had multiple clients with same application. setup different instance but each client had own database and few config parameters on server. my problem is when i am apply new patch i need to apply it on all instances most of time i forget to apply patch on some instance. - application server is same. - domain name different for each client. - i am thinking when users hit domain application load specific config folder. it is possible to setup single application code and multiple config folder?
Can you supply typical details of "config file changes".
Do all applications share a single system folder?
(08-04-2020, 07:14 PM)John_Betong Wrote: Can you supply typical details of "config file changes". yes all application and system folder is same, database name different in database.php and config variables in config.php PHP Code: date_default_timezone_set('xxx/xxx'); i want to single project folder for patch/update code/changes apply on production and each client instance operate with different database config file variables . i try google... but not lucky... it possible to define config folder or only database.php,config.php path in index.php maybe it solve my problem.
I usually test for the server name and set $config values accordingly:
Code: $_SERVER_NAME = $_SERVER['SERVER_NAME']; There are lots of other $_SERVER variables abvaliable: Code: echo '<pre>'; // add line feeds
Personally I'm using application environment variables from Apache/Nginx.
PHP Code: /* In the same way CodeIgniter grabs it's environment variable. PHP Code: /* That means you don't need to update your project at all. Everything are done from Apache / Nginx configuration instead. https://codeigniter.com/userguide3/gener...ments.html
(08-04-2020, 10:23 PM)John_Betong Wrote: I usually test for the server name and set $config values accordingly:Thank you . and how to handle database ?
Same idea, check and set the SERVER_NAME and use the values in ./app/Config/Database.php
|
Welcome Guest, Not a member yet? Register Sign In |