How to use the same app for multiple identical websites, with different configuration |
I'm trying to upgrade my CI3 multi-user application to version 4, I don't have big problems rewriting all the code to version 4, but I don't know how to solve the structure problem.
The old application is structured like this, I have a "CI_CORE" folder that contains the "app" folder and the various files that were needed for version 3 and then a folder for each website as a webroot that contains the "index.php" and others useful files and folders, including the assets folder which is virtualized. What is all this for? Each website is identical in all respects to the others, it is a sort of management system, so they are the same in the structure, what changes are the name of the DB, the DB access credentials and a whole series of local settings, in this way if there are changes, upgrades or bug fixes just upload the changes in the "CI_CORE" folder and these will be reflected on all websites, same thing for the "assets" which is a virtualized folder, so also here, uploading any changes, these will affect all websites. To use the same structure in CI3 just change the path of the "app" folder in the index.php file and point to the site folder as webroot. Also another problem is the local configurations, in CI3 there is the config.php file which is nothing more than a set of values enclosed in an array, to add local confuguration values just include the site configuration file used at the end of the file config.php to add local configuration values based on your website. How can I go about achieving the same result in CI4? Basically I should go through this structure Code: - CI_CORE to something like this Code: - CI_CORE Or in any other way that leads to the result. I looked here: https://www.codeigniter.com/user_guide/g..._apps.html but it is not my case, except for some changes that I might need, like changing the path of the app folder if necessary
To use the same structure in CI3 just change the path of the "app" folder in the index.php file and point to the site folder as webroot. drift hunters
this is what I loaded up to my live web for CI4.2.6
Code: kursaal.org public has : Code: [andrew@darkstar:http/kursaal2.org]$ tree -L 1 public (09-21 15:24)
(09-21-2022, 07:25 AM)captain-sensible Wrote: this is what I loaded up to my live web for CI4.2.6 I'm trying to have a single app folder for different websites, basically it's like having multiple public folders with different names for different websites that use the same structure (controller, model, view, etc., etc.) |
Welcome Guest, Not a member yet? Register Sign In |