Classe: ConfigDbStorage - X-Ref
\ingroup Config
Storage backend that stores/retrieves the data from the plog_config
table.
The structore of the table is as follows:
- id: setting identifier
- config_key: Name of the setting. Can't be empty
- config_value: Value assigned to the key
- value_type: This field can take several values and gives the class
a hint regardign the type of the value:
-- 1: integer. The config_value field represents is value.
-- 2: boolean. It is saved as 1 == true and 0 == false.
-- 3: string. It is saved as is.
-- 4: object. The object is saved in a seralized way.
-- 5: array. The arrays are also saved serialized. This is transparently
done inside the save() and saveValue() methods, and therefore the user
does not have to worry about doing it.
-- 6: float. It is saved as is.
Type detection is provided via the built-in mechanisms that PHP offers.
</ul>
_loadData()
X-Ref
|
Internal function that loads all the data from the table and puts in into
our array. It should be apparently faster that making an SQL query every time
we need to get a value.
|
reload()
X-Ref
|
Resets the current configuration settings and loads them from the database.
|
_keyExists( $key )
X-Ref
|
Internal function that returns true if the given key exists in the database.
param: key The name of the key we'd like to check
return: Returns true if it exists or false otherwise.
|
save()
X-Ref
|
Puts all the settings back to the database.
It is done so that we first check if the key exists. If it does, we then
send an update query and update it. Otherwise, we add it.
param: key The name of the key
param: The value.
return: True if successful or false otherwise
|
saveValue( $key, $value )
X-Ref
|
Puts just one setting back to the database.
It is done so that we first check if the key exists. If it does, we then
send an update query and update it. Otherwise, we add it.
param: key The name of the key
param: The value.
return: True if successful or false otherwise
|