options

options implements a simple application options container class of sorts. Basically you can store your application options in the database easily using this class. You will need to create a table with the following structure in order for this class to work.

CREATE TABLE IF NOT EXISTS options (
id int(11) NOT NULL AUTO_INCREMENT,
option_name varchar(100) NOT NULL,
option_value varchar(2048) NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

Parent Class

None


Static Properties

$optionsTableName
Contains the name of your database options table
Data Type: string
Default Value: options
$optionsTable
Contains the table table. You really shouldn’t need access to this under normal circumstances.
Data Type: table

Static Methods

string get( string $key )
Retrieves the value for the $key from the options database table
Parameters:
$key (string) is the name of the option key or false if the key does not exist
Returns:
(string) value associated with the specified $key
Example:
string set( string $key, string $value )
Stores a string value for the specified $key
Parameters:
$key (string) is the name of the option key
$value (string) is the value to store associated with the key
Returns:
(string) The prior value for the specified key or false if there was no prior value
Example: