Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve LS config handling #1082

Open
M4LuZ opened this issue Apr 5, 2024 · 0 comments
Open

Improve LS config handling #1082

M4LuZ opened this issue Apr 5, 2024 · 0 comments

Comments

@M4LuZ
Copy link
Collaborator

M4LuZ commented Apr 5, 2024

Expected Behavior

As per #1080:

  • System parameter handling should be modified to use access functions instead of direct access to global array variable $cfg
  • Default values for all parameters should be returned if not explicitly set
  • (optional) these should be set on-change, not on-access
  • (optional) Caching of values should be used
  • (optional) related DB functions should be moved to the new solution
  • (optional) Namespacing & instantiation of variables may be useful

Current Behavior

  • Config is read from DB into global array $cfg.
  • All access is directly done on that.
  • Missing parameters cause a PHP warning, changed default values are not taken over unless module update is done manually.
  • Config names cannot be duplicated as they then cause overwrites

Possible Solution

  • Create new class with needed functionality
  • replace code for initialisation and writing
  • use RegEx to find and replace all read accesses
  • Double check if for whatever reason there are writebacks
  • Profit

Steps to Reproduce (for bugs)

  • Access a new setting that has not been written to the db (yet)
  • See warning

Context

This causes warnings to pop up regularly on changes and improvements

@M4LuZ M4LuZ mentioned this issue Apr 5, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant