Jul 11

iniFile.class Released

for a while when i was building my automation scripts if i wanted settings they would either be a hardcoded array in the script of a .txt that i would load into an array…or explode into an array…ok i just used arrays.

i had used ini file briefly for other projects but when i learned that PHP would use them i decided to look into them myself for my scripts. i learned that while there’s a single function to import them there isn’t one to export them so i decided to make a class for working with .ini files

Download .zip

as with all my other classes you’re going to need commonLib.class

'newLog'         => true,        // whether your creating a new log file
'noMemLimit'     => false,        // disable the PHP Memory Limit
'file'            => '',            // the location of the .ini file
'newFile'        => false,        // if this is a new file. this will stop loading an existing file if it exists
'autoSave'        => false,        // whether or not the data in the class will be autosaved back to the .ini file. if set to true it will auto save every time you make a change using setVal and again with the deconstructor 

and example of this is

$settings = new iniFile(array(
    'file' => 'data/settings.ini',

Leave a Reply

Your email address will not be published.