OpenMediaVault  0.6 (Kralizec)
The open network attached storage solution
 All Classes Functions Variables Groups Pages
Classes | Functions
The Application Programming Interface

Classes

class  OMVConfigEngine
 
class  OMVErrorMsg
 
class  OMVException
 
class  OMVException2
 
class  OMVHtmlPageAbstract
 
class  OMVWebGui
 
class  OMVWebGuiLogin
 
class  OMVSysVInitScript
 
class  OMVLogFile
 
class  OMVModuleAbstract
 
class  OMVModuleServiceAbstract
 
interface  OMVIModuleService
 
class  OMVModuleMgr
 
class  OMVMonit
 
class  OMVNotifyDispatcher
 
interface  OMVINotifyListener
 
class  OMVObject
 
class  OMVProduct
 
class  OMVRpc
 
class  OMVJsonRpcProxy
 
class  OMVUploadRpcProxy
 
class  OMVDownloadRpcProxy
 
class  OMVRpcServiceAbstract
 
class  OMVRpcServiceMgr
 
class  OMVRpcBgStatus
 
class  OMVSession
 
class  OMVSystem
 
class  OMVPowerManagement
 
class  OMVFilesystemBackendAbstract
 
class  OMVFilesystems
 
class  OMVFilesystemFactory
 
class  OMVFilesystemAbstract
 
class  OMVFilesystem
 
class  OMVMntEnt
 
interface  OMVIBlockDevice
 
class  OMVBlockDeviceAbstract
 
class  OMVBlockDevice
 
class  OMVStorageDeviceAbstract
 
class  OMVStorageDeviceSMARTAbstract
 
class  OMVStorageDeviceBackendAbstract
 
class  OMVStorageDeviceBackendLoop
 
class  OMVStorageDeviceBackendBcache
 
class  OMVStorageDeviceBackendDM
 
class  OMVStorageDeviceBackendLVM
 
class  OMVStorageDeviceBackendMdadm
 
class  OMVStorageDeviceBackendCCISS
 
class  OMVStorageDeviceBackendHDD
 
class  OMVStorageDevices
 
class  OMVStorageDeviceFactory
 
class  OMVStorageDeviceHDD
 
class  OMVStorageDeviceCCISS
 
class  OMVStorageDeviceMdadm
 
class  OMVStorageDeviceDM
 
class  OMVStorageDeviceLoop
 
class  OMVStorageDeviceBcache
 
class  OMVATASMARTInformation
 
class  OMVNetwork
 
class  OMVNetworkInterfaces
 
class  OMVNetworkInterface
 
class  OMVUserGroups
 
class  OMVUserGroup
 
class  OMVUsers
 
class  OMVUser
 
class  OMVLvmPhysicalVolumes
 
class  OMVLvmLogicalVolumes
 
class  OMVLvmLogicalVolume
 
class  OMVUtil
 
class  OMVJsonFile
 
class  OMVToplogicalSort
 

Functions

 array_sort_key (array &$array, $key)
 
 array_filter_ex ($array, $key, $value)
 
 array_keys_exists ($keys, $search, &$missing=NULL)
 
 toArray ($object)
 
 array_boolval ($array, $key)
 
if(!function_exists("boolval")) boolvalEx ($var)
 
 is_uuid ($var)
 
 is_devicefile ($var)
 
 is_block ($filename)
 
 is_json ($var)
 
 is_ipaddr ($var)
 
 is_ipaddr4 ($var)
 
 is_ipaddr6 ($var)
 
 is_multiarray ($var)
 
 json_validate ($json, $schema, &$errors=NULL)
 
 json_encode_safe ($value, $options=0)
 
if(!function_exists('json_last_error_msg')) binary_format ($number, $options=NULL)
 
 binary_convert ($number, $fromPrefix, $toPrefix, $decimalPlaces=0)
 
 strpdate ($date, $format)
 
 mkdtemp ($prefix="", $mode=0700)
 
 inet_getnetmask ($bits, $forceipv6=FALSE)
 

Detailed Description

This file is part of OpenMediaVault.

License:
http://www.gnu.org/licenses/gpl.html GPL Version 3
Author
Volker Theile volke.nosp@m.r.th.nosp@m.eile@.nosp@m.open.nosp@m.media.nosp@m.vaul.nosp@m.t.org

OpenMediaVault is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

OpenMediaVault is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with OpenMediaVault. If not, see http://www.gnu.org/licenses/.

Function Documentation

array_boolval (   $array,
  $key 
)

Get boolean value of an array element.

Parameters
arrayAn array with keys.
keyThe key of the element. Returns the boolean value of the given key.
array_filter_ex (   $array,
  $key,
  $value 
)

Filter an array by key and values.

Parameters
arrayThe array to sort
keyThe key used as filter criteria
valueThe value used as filter criteria
Returns
Returns the filtered array.
array_keys_exists (   $keys,
  $search,
$missing = NULL 
)

Checks if the given keys or index exists in the array.

Parameters
keysAn array containing the keys to check
searchAn array with keys to check
missingContains the missing keys if function fails
Returns
Returns TRUE on success or FALSE on failure.
array_sort_key ( array &  $array,
  $key 
)

This file is part of OpenMediaVault.

License:
http://www.gnu.org/licenses/gpl.html GPL Version 3
Author
Volker Theile volke.nosp@m.r.th.nosp@m.eile@.nosp@m.open.nosp@m.media.nosp@m.vaul.nosp@m.t.org

OpenMediaVault is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

OpenMediaVault is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with OpenMediaVault. If not, see http://www.gnu.org/licenses/. Sort an array by values using a user-defined key.

Parameters
arrayThe array to sort
keyThe key used as sort criteria
Returns
Returns TRUE on success or FALSE on failure.
binary_convert (   $number,
  $fromPrefix,
  $toPrefix,
  $decimalPlaces = 0 
)

Convert a number to bytes using binary multiples.

Parameters
numberThe number to convert.
fromPrefixThe binary prefix name number is in, e.g. 'KiB'.
toPrefixThe binary prefix name to convert number to, e.g. 'TiB'.
decimalPlacesThe number of decimal places. Defaults to 0.
Returns
The converted number as string or FALSE on failure.
if (!function_exists('json_last_error_msg')) binary_format (   $number,
  $options = NULL 
)

Returns the error string of the last JSON API call.

Returns
Returns the error message on success or NULL with wrong parameters. Convert a number into the highest possible binary unit.
Parameters
valueThe number to convert (per default this is in Bytes).
optionsAn array of additional options.
Returns
The converted string value including the unit or an indexed array with the fields value and unit.
if (!function_exists("boolval")) boolvalEx (   $var)

Get the boolean value of a variable.

Deprecated:
Parameters
varThe scalar value being converted to a boolean. Returns the boolean value of the given value.

Get the boolean value of a variable. A boolean TRUE will be returned for the values 1, '1', 'on', 'yes', 'y' and 'true'.

Parameters
varThe scalar value being converted to a boolean. Returns the boolean value of the given value.
inet_getnetmask (   $bits,
  $forceipv6 = FALSE 
)

Build a netmask based on the given number of bits.

Parameters
bitsThe number of bits to be set in the desired netmask.
forceipv6Set to TRUE to force an IPv6 netmask, even if bits <= 32. Defaults to FALSE which auto-detects the address family.
Returns
The netmask as string.
is_block (   $filename)

Tells whether the given file is a block device.

Parameters
filenamePath to the file.
Returns
Returns TRUE if the file is a block device, FALSE otherwise.
is_devicefile (   $var)

Finds out whether a variable describes a devicefile, e.g. /dev/sda1.

Parameters
varThe variable being evaluated.
Returns
TRUE if the variable describes a devicefile, otherwise FALSE.
is_ipaddr (   $var)

Finds out whether a variable is an IP address.

Parameters
varThe variable being evaluated.
Returns
TRUE if the variable is an IP address, otherwise FALSE.
is_ipaddr4 (   $var)

Finds out whether a variable is an IPv4 address.

Parameters
varThe variable being evaluated.
Returns
TRUE if the variable is an IPv4 address, otherwise FALSE.
is_ipaddr6 (   $var)

Finds out whether a variable is an IPv6 address.

Parameters
varThe variable being evaluated.
Returns
TRUE if the variable is an IPv6 address, otherwise FALSE.
is_json (   $var)

Finds out whether a variable is JSON.

Parameters
varThe variable being evaluated.
Returns
TRUE if the variable is JSON, otherwise FALSE.
is_multiarray (   $var)

Finds out whether a variable is a multidimensional array.

Parameters
varThe variable being evaluated.
Returns
TRUE if the variable is a multidimensional array, otherwise FALSE.
is_uuid (   $var)

Finds out whether a variable is an UUID v4.

Parameters
varThe variable being evaluated.
Returns
TRUE if the variable is an UUID, otherwise FALSE.
json_encode_safe (   $value,
  $options = 0 
)

Returns the JSON representation of a value. All strings will be encoded to UTF-8 before, thus json_encode should not throw an exception like 'Invalid UTF-8 sequence in argument' (Mantis 0000355).

Parameters
valueThe value being encoded.
optionsBitmask, see PHP json_encode manual pages.
Returns
Returns a string containing the JSON representation of value.
json_validate (   $json,
  $schema,
$errors = NULL 
)

Validate JSON data via JSON schema.

Parameters
jsonThe JSON string to validate.
schemaThe JSON schema to use for validation.
errorsOptional parameter which will contain the error messages if validation fails.
Returns
TRUE if successful, otherwise FALSE.
mkdtemp (   $prefix = "",
  $mode = 0700 
)

Create a directory with unique file name.

Parameters
prefixThe prefix of the generated temporary directory.
modeThe mode of the temporary directory. Defaults to 0700.
Returns
Returns the full path of the created directory, or FALSE on failure.
strpdate (   $date,
  $format 
)

Convert any time/date into a Unix timestamp according to the specified format.

Parameters
dateA date/time string to parse.
formatThe format used in date.
Returns
Returns a Unix timestamp on success, FALSE otherwise.
toArray (   $object)

Convert an object to an array.

Parameters
objectThe object instance.
Returns
Returns an associative array of defined object accessible non-static properties for the specified object in scope.