OpenMediaVault  3.0 (Erasmus)
The open network attached storage solution
Public Member Functions | List of all members
OMV\Util\KeyValueFile Class Reference

Public Member Functions

 __construct ($filename, $keyValueDelimiter="=", $keyNameDelimiter="_", $commentDelimiter="#")
 
 setKeyNameDelimiter ($char)
 
 setKeyValueDelimiter ($char)
 
 setCommentDelimiter ($char)
 
 setKeyCaseSensitiv ($caseSensitive)
 
 exists ($key)
 
 get ($key)
 
 getAssoc ()
 

Constructor & Destructor Documentation

OMV\Util\KeyValueFile::__construct (   $filename,
  $keyValueDelimiter = "=",
  $keyNameDelimiter = "_",
  $commentDelimiter = "#" 
)

Constructor

Parameters
string$filenamePath to the file.
string$keyValueDelimiterThe key/value delimiter. Defaults to '='.
string$keyNameDelimiterThe delimiter that is used to replace white spaces within the key name. Defaults to '_'.
string$commentDelimiterThe comment line delimiter. Defaults to '#'.

Member Function Documentation

OMV\Util\KeyValueFile::exists (   $key)
final

Check whether the specified key exists.

Parameters
string$keyThe name of the key.
Returns
Returns TRUE if the key exists, otherwise FALSE.
OMV\Util\KeyValueFile::get (   $key)
final

Get the value of the given key.

Parameters
string$keyThe name of the key.
Returns
The value of the given key.
OMV\Util\KeyValueFile::getAssoc ( )
final

Get the key/value pairs as associative array.

Returns
The array of key/value pairs.
OMV\Util\KeyValueFile::setKeyCaseSensitiv (   $caseSensitive)
final

Specifies whether case-sensitive key matching should be used.

Parameters
caseSensitiveTRUE for case-sensitive matching.
Returns
None.

The documentation for this class was generated from the following file: