Difference between revisions of "PHPLights/Documentation/Interfaces/LsConfigIface"
From Linuxnetworks
< PHPLights | Documentation | Interfaces
(initial) |
(→Description) |
||
| Line 12: | Line 12: | ||
PHPLights allows multiple ways of storing configuration data of applications. The most often used method is to store them in PHP files whose associative arrays can be added natively to the runtime configuration. However, different file formats or storage mechanisms (like database tables) are possible. | PHPLights allows multiple ways of storing configuration data of applications. The most often used method is to store them in PHP files whose associative arrays can be added natively to the runtime configuration. However, different file formats or storage mechanisms (like database tables) are possible. | ||
| + | |||
| + | New configuration classes can implement LsConfigIface but the better way is to inherit from [[PHPLights/Documentation/Classes/LsConfig|LsConfig]]. This class already implements the get(), set() and has() static functions and thus, the new class must only provide the specific addFile() method. | ||
== Public functions == | == Public functions == | ||
Revision as of 10:35, 21 September 2007
Synopsis
interface LsConfigIface
{
public static function get( $name, $default = NULL );
public static function set( $name, $value );
public static function has( $name );
public function addFile( $key, $file );
}
Description
PHPLights allows multiple ways of storing configuration data of applications. The most often used method is to store them in PHP files whose associative arrays can be added natively to the runtime configuration. However, different file formats or storage mechanisms (like database tables) are possible.
New configuration classes can implement LsConfigIface but the better way is to inherit from LsConfig. This class already implements the get(), set() and has() static functions and thus, the new class must only provide the specific addFile() method.
Public functions
get()
public static function get( $name, $default = NULL );
set()
public static function set( $name, $value );
has()
public static function has( $name );
addFile()
public function addFile( $key, $file );