It really depends on the type of “settings” you want to save. Are they “bootable” settings, such as the database host, port, and login? Or is it application settings specifically for your application?
The problem with providing the administrator interface with writing a file to the file system is the permissions required to write to the file. Each time you open a web server to write files, you increase the likelihood that an error in the code can lead to a serious escalation of privileges.
Databases are designed to be read and written without causing potential security risks to the system.
We use "generated" PHP files to store static configuration data (for example, database access information). It is created by the user script utility on the command line. After that, all non-static information is stored in the database table. The database table, in turn, is easy to update from the administrator area. When updating the application, you easily expand and update.
It is also much easier to centralize the “data” that needs to be backed up in one place.
Is it possible to use memcached or something similar to speed it up?
Just a couple of thoughts ...
gahooa
source share