[ Index ]
 

Code source de LifeType 1.2.4

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/class/config/ -> configdbstorage.class.php (sommaire)

(pas de description)

Poids: 362 lignes (12 kb)
Inclus ou requis:0 fois
Référencé: 2 fois
Nécessite: 0 fichiers

Définit 1 class

ConfigDbStorage:: (16 méthodes):
  ConfigDbStorage()
  _loadAllValuesFromDatabase()
  _initializeDatabase()
  _loadData()
  getValue()
  setValue()
  getAsArray()
  getConfigFileName()
  reload()
  getKeys()
  getValues()
  _keyExists()
  _updateValue()
  _insertValue()
  save()
  saveValue()


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>
ConfigDbStorage()   X-Ref
Connects to the database using the parameters in the config file.


_loadAllValuesFromDatabase()   X-Ref
Pas de description

_initializeDatabase()   X-Ref
Initialize the Database to allow db access


_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.


getValue( $key, $defaultValue = null )   X-Ref


setValue( $key, $value )   X-Ref


getAsArray()   X-Ref


getConfigFileName()   X-Ref


reload()   X-Ref
Resets the current configuration settings and loads them from the database.


getKeys()   X-Ref


getValues()   X-Ref


_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.

_updateValue( $key, $value )   X-Ref


_insertValue( $key, $value )   X-Ref


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



Généré le : Mon Nov 26 21:04:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics