OMV\Config\DatabaseBackend::__construct |
( |
|
$filename, |
|
|
|
$forceReload = TRUE , |
|
|
|
$autoCommit = TRUE , |
|
|
|
$versioning = FALSE |
|
) |
| |
Constructor
- Parameters
-
filename | The path to the XML document. |
forceReload | Set to TRUE to reload the XML document everytime before any action is performed on the XML document. Defaults to TRUE. |
autoCommit | Set to TRUE to automatically commit the XML document modifications after write-access. Defaults to TRUE. |
versioning | Set to TRUE to automatically create a revision file for all changes. Files will look like <filename>.<revision>, e.g. <filename>.0015. Defaults to FALSE. |
OMV\Config\DatabaseBackend::addEnum |
( |
|
$enum | ) |
|
OMV\Config\DatabaseBackend::compare |
( |
|
$xpath, |
|
|
|
$data |
|
) |
| |
Compare the configuration from the given XPath expression with the given data.
- Parameters
-
xpath | The XPath expression to execute. |
data | The data to compare. |
- Returns
- Returns 0 if the data is equal, otherwise -1. On error boolean FALSE is returned.
OMV\Config\DatabaseBackend::count |
( |
|
$xpath | ) |
|
Get the number of nodes matching the given XPath expression.
- Parameters
-
xpath | The XPath expression to execute. |
- Returns
- Get the number of nodes matching the given XPath expression or FALSE on failure (e.g. XPath expression is malformed).
OMV\Config\DatabaseBackend::delete |
( |
|
$xpath | ) |
|
Delete the nodes matching the given XPath expression. This function is protected by mutual exclusion, thus the function will be blocked until it can acces the protected section.
- Parameters
-
xpath | The XPath expression to execute. |
- Returns
- Returns the deleted nodes, otherwise FALSE.
OMV\Config\DatabaseBackend::exists |
( |
|
$xpath | ) |
|
Check if the data at the given XPath expression exists.
- Parameters
-
xpath | The XPath expression to execute. |
- Returns
- TRUE if data exists, otherwise FALSE. If the XPath expression is malformed FALSE will be returned, too.
OMV\Config\DatabaseBackend::get |
( |
|
$xpath | ) |
|
Get the configuration for the given XPath expression.
- Parameters
-
xpath | The XPath expression to execute. |
- Returns
- The requested value or an array containing the requested value if the XPath expression matches multiple configuration objects. If the XPath expression does not match NULL will be returned.
OMV\Config\DatabaseBackend::getList |
( |
|
$xpath | ) |
|
Get the configuration for the given XPath expression as a list.
- Parameters
-
xpath | The XPath expression to execute. |
- Returns
- An array containing the requested configuration objects, otherwise an empty array.
OMV\Config\DatabaseBackend::getXPathList |
( |
|
$xpath | ) |
|
Get the XPath location path of the objects addressed by the given XPath as a list.
- Parameters
-
xpath | The XPath expression to execute. |
- Returns
- An array containing the XPath to the objects, otherwise an empty array.
OMV\Config\DatabaseBackend::load |
( |
| ) |
|
Load the configuration file.
- Returns
- TRUE if successful, otherwise FALSE.
OMV\Config\DatabaseBackend::replace |
( |
|
$xpath, |
|
|
|
$data |
|
) |
| |
Replace the data at the given XPath expression. If the given XPath expression does not exist, then the method will exit immediatelly. This function is protected by mutual exclusion, thus the function will be blocked until it can acces the protected section.
- Parameters
-
xpath | The XPath expression to execute. |
data | The data to set for the given XPath expression. |
- Returns
- TRUE if successful, otherwise FALSE.
OMV\Config\DatabaseBackend::revert |
( |
|
$filename | ) |
|
Revert changes. All existing revision files will be deleted.
- Parameters
-
filename | The revision file. Defaults to NONE. |
- Note
- This only takes action if versioning is enabled.
- Returns
- None.
OMV\Config\DatabaseBackend::save |
( |
| ) |
|
Save configuration file. This function is protected by mutual exclusion, thus the function will be blocked until it can acces the protected section.
- Returns
- TRUE on success, otherwise FALSE.
OMV\Config\DatabaseBackend::set |
( |
|
$xpath, |
|
|
|
$data |
|
) |
| |
Set the data at the given XPath expression. This function is protected by mutual exclusion, thus the function will be blocked until it can acces the protected section.
- Parameters
-
xpath | The XPath expression to execute. |
data | The data to set for the given XPath expression. |
- Returns
- TRUE if successful, otherwise FALSE.
OMV\Config\DatabaseBackend::setVersioning |
( |
|
$enable | ) |
|
Create a revision for all changes.
- Parameters
-
enable | Set to TRUE to automatically create a revision file for all changes. Files will be created like <filename>.<revision>, e.g. <filename>.0015. Set to FALSE to disable versioning on changes. |
OMV\Config\DatabaseBackend::unlinkRevisions |
( |
| ) |
|
Unlink all revision files. Note, this only takes action if versioning is enabled.
- Returns
- TRUE if successful, otherwise FALSE.
OMV\Config\DatabaseBackend::update |
( |
|
$xpath, |
|
|
|
$data |
|
) |
| |
Update the existing configuration for the given XPath expression. The given data will override the existing configuration. If the given XPath expression does not exist, then the method will exit immediatelly. This function is protected by mutual exclusion, thus the function will be blocked until it can acces the protected section.
- Parameters
-
xpath | The XPath expression to execute. |
data | The data to set for the given XPath expression. |
- Returns
- TRUE if successful, otherwise FALSE.
The documentation for this class was generated from the following file: