NAME
Register::Generic - Implementation of the windows ini like structure
SYNOPSIS
use Register;
$genreg=new Register::Generic (
'regpath' => "/home/myprog",
'regname' => "INITFILE"
);
$genreg->savesettings("SECTION","KEY","VALUE");
$value=$genreg->getsettings("SECTION","KEY");
$sections=$genreg->getsections;
$genreg->deletesettings(,"SECTION","KEY");
$genreg->deletesection("SECTION");
DESCRIPTION
The Register::Generic module permit to create an ini file like Windows for save generic information about your program. With the use of CSV dbd , the file created is readable by DBI without problem. Here CSV table specifics:
FIELD_NAME FIELD_TYPE
----------------------------------
R_SECTION CHAR
R_KEY CHAR
R_VALUE CHAR
FUNCTIONS
Function <new>
The <new> statament create the Register::Generic object and return the reference to him.
$genreg=new Register::System (
'regpath' => "/home/myprog",
'regname' => "INIFILE"
);
Parameter :
regpath specify the path where new statament search for
file.
regname specify the name of the file to use.
Finaly if regpath don't exist the program return an error message at compile time, if the register don't exist it is maked.
Function <savesettings>
The savesettings function , save the value argument in the key of the section of the program.
$genreg->savesettings("SECTION","KEY","VALUE");
If the key don't exist it make (it make also section without specify befor), else if key already exist and value is different from previous it update value.
Function <getsettings>
The getsettings function retrieve the value of the specified key.
$value=$genreg->getsettings("SECTION","KEY");
Function <getsections>
The getsections function retrieve the section in the ini file and return an array.
@sections=$genreg->getsections;
Function <deletesettings>
The deletesettings function delete the entry key specified.
$genreg->deletesettings("SECTION","KEY");
Function <deletesection>
The deletesection function delete the entry section specified.
$genreg->deletesection("SECTION");
AUTHOR
Vecchio Fabrizio <jacote@tiscalinet.in>