Decouple Shield from the Settings Library #1215
Replies: 5 comments 5 replies
I didn't find anything different, what you proposed is the basic behavior of the settings package. If you have a special scenario you can customize Shield and then create additional helpers in your app. |
|
I would like the option to disable the query to the settings table. I am not using this feature and it is a wasted hit to the database. |
|
@lonnieezell any thoughts, suggestions on this and #1220 ? |
|
If you really don't want to use setting, you could extends the function so that it only returns the Config values and never hit the database. See https://codeigniter4.github.io/CodeIgniter4/general/helpers.html#extending-helpers |
|
@warcooft What if I don't want to use settings for shield only but still have the settings for other things Also shield will install settings automatically via composer which is something i don't like and should only be used for packages which are absolutely necessary. Shield can work without settings installed so it only make sense to have it as suggested package instead of it being a requirement. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Currently Shield requires using of settings library. I'd like to make it possible to use Shield without the need to use settings library.
What I'm proposing is to make another helper method shieldSetting() and change all the setting() calls to shieldSetting() then we can introduce new config parameter $useSettings.
When useSettings true shieldSetting() will just forward the call to the settings method and when useSettings is false shieldSetting() will get the value directly from config files. Additionally this allows user to override the shieldSetting() method for more complex scenarios.
Then we can make the composer.json only suggest the "codeigniter4/settings" instead of requiring it.
All reactions