PHP Class for Storing Settings in INI or DB Files

Last Update
30 October 2012
Regular License
$5
Extended License
$25
Sales
6

PHP Storage Class is a very simple to use class which lets you store all your configuration and settings in simple configuration files. The class is very easy to use with any of your existing projects, just drop it in and start using.

Settings Class comes with two predefined drivers (1) File Driver (2) MySQL Driver – Using which you can easily switch between File based storage or MySQL based storage.

Usage is as simple as using two methods – You can easy select where you would like to store the settings, either in a settings file or in a database – You never have to change a single line of code

Writing

$config->set("page-settings","userbrowser","chrome");

Reading

$config->get("page-settings","userbrowser");

Optimized Disk I/O Performance It is well known that Disk I/O is potentially blocking and becomes extremely crucial when it comes to the point of saving dozens of user settings during the page load operation. In order to reduce the interaction with the disk during each save operation (file mode) and as an optimization attempt to reduce the Disk I/O cycles, this script uses a concept of Lazy Saving which Queues all the write operations till the point where there are no more write operations and finally flushes them from Memory to Disk in one shot thus speeding up the entire process.