[ 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/ -> configabstractstorage.class.php (sommaire)

(pas de description)

Poids: 189 lignes (6 kb)
Inclus ou requis:0 fois
Référencé: 1 fois
Nécessite: 0 fichiers

Définit 1 class

ConfigAbstractStorage:: (12 méthodes):
  ConfigAbstractStorage()
  _getType()
  getValue()
  setValue()
  getAsArray()
  reload()
  getConfigFileName()
  getKeys()
  getValues()
  saveValue()
  save()
  getTempFolder()


Classe: ConfigAbstractStorage  - X-Ref

\ingroup Config

Interface class that defines the methods that should be implemented
by child classes wishing to implement a configuratino settings storage backend.

This class cannot be instantiated directly, and an attempt to call any of its methods
will end our script.
ConfigAbstractStorage( $params = null )   X-Ref
Pas de description

_getType( $value )   X-Ref
Returns a constant determining the type of the value passed as parameter. The constants
are:
- TYPE_INTEGER = 1
- TYPE_BOOLEAN = 2
- TYPE_STRING = 3
- TYPE_OBJECT = 4
- TYPE_ARRAY = 5
- TYPE_FLOAT = 6

param: value The value from which we'd like to know its type
return: Returns one of the above.

getValue( $key, $defaultValue = null )   X-Ref
Given a key, gets its value from the storage backend.

param: key The key that we're looking for
param: defaultValue Optional, if the key does not exist we can provide a second parameter that
return: The value assigned to the key or $defaultValue if there was no such key found

setValue( $key, $value )   X-Ref
Sets a value in the storage area. It is up to the storage backend implementation to either
save the data right away after calling this method or whether it is needed to call
ConfigAbstractStorage::save() in order to do so.

param: key The key that we'd like to save
param: value The value that should be assigned to this key
return: True if successful or false otherwise

getAsArray()   X-Ref
Returns all the configuration parameters as an associative array

return: An associative array

reload()   X-Ref
triggers a reload of all the settings from the backend.

return: True if successful or false otherwise

getConfigFileName()   X-Ref
returns the name of the configuration file where data is being saved. If the backend does not
use a configuration file, the result of this method is an empty string

return: name of the config file, or empty if not used

getKeys()   X-Ref
Returns an associative array with all the keys that are in the storage backend

return: An associative array, or an empty array if there are no keys

getValues()   X-Ref
Returns an array including only the values that are availalbe in the storage backend

return: An array with only the values, or an empty array if there are no values.

saveValue( $key, $value )   X-Ref
saves only one value to the configuration backend. This should save the value right away
without the need to call ConfigAbstractStorage::save() afterwards

param: key The name of the key that we'd like to save
param: value The value of the key that we'd like to save
return: true if successful or false otherwise

save()   X-Ref
saves all the keys and their values to disk

return: true if successful or false otherwise

getTempFolder()   X-Ref
shortcut for one of the most sought after config keys: temp_folder

not really needed, but it makes my life easier since I never remember
whether it is tmp_folder, temp_folder, temp_dir, or whatever :)

return: The name of the folder used for temporary storage



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