- In CI4, the configurations are now stored in classes which extend
- Within the configuration class, the config values are stored in public class properties.
- The method to fetch config values has been changed.
- You have to change the values in the default CI4 config files according to the changes in the CI3 files. The config names are pretty much the same as in CI3.
- If you are using custom config files in your CI3 project you have to create those
files as new PHP classes in your CI4 project in app/Config. These classes
should be in the
Confignamespace and should extend
- Once you have created all custom config classes, you have to copy the variables from the CI3 config into the new CI4 config class as public class properties.
- Now, you have to change the config fetching syntax everywhere you fetch config
values. The CI3 syntax is something like
$this->config->item('item_name');. You have to change this into
<?php defined('BASEPATH') OR exit('No direct script access allowed'); $siteName = 'My Great Site'; $siteEmail = '[email protected]';