openmediavault  4.0 (Arrakis)
The open network attached storage solution
Classes | Functions
The Application Programming Interface

Classes

class  OMV\AssertException
 
class  OMV\Config\ConfigDirtyException
 
class  OMV\Config\ConfigObject
 
class  OMV\Config\Database
 
class  OMV\Config\DatabaseBackend
 
class  OMV\Config\DatabaseBackendQueryBuilder
 
class  OMV\Config\DatabaseException
 
class  OMV\Config\DataModel
 
class  OMV\ConstraintException
 
class  OMV\ControlPanel\ControlPanelAbstract
 
class  OMV\Dictionary
 
class  OMV\Email
 
interface  OMV\Engine\Module\IService
 
class  OMV\Engine\Module\Manager
 
class  OMV\Engine\Module\ModuleAbstract
 
class  OMV\Engine\Module\ServiceAbstract
 
class  OMV\Engine\Notify\Dispatcher
 
interface  OMV\Engine\Notify\IListener
 
class  OMV\Environment
 
class  OMV\Exception
 
class  OMV\ExecException
 
class  OMV\Json\File
 
class  OMV\Json\SchemaException
 
class  OMV\Json\SchemaPathException
 
class  OMV\Json\SchemaValidationException
 
class  OMV\ProductInfo
 
class  OMV\Rpc\BgStatusFile
 
class  OMV\Rpc\DataModel
 
class  OMV\Rpc\Exception
 
class  OMV\Rpc\ParamsValidator
 
class  OMV\Rpc\Proxy\Download
 
class  OMV\Rpc\Proxy\Exception
 
class  OMV\Rpc\Proxy\Json
 
class  OMV\Rpc\Proxy\Upload
 
class  OMV\Rpc\Rpc
 
class  OMV\Rpc\ServiceAbstract
 
class  OMV\Rpc\ServiceManager
 
class  OMV\Rpc\TraceException
 
class  OMV\Session
 
class  OMV\System\BlockDevice
 
class  OMV\System\Filesystem\Backend\BackendAbstract
 
class  OMV\System\Filesystem\Backend\Manager
 
class  OMV\System\Filesystem\Filesystem
 
interface  OMV\System\Filesystem\IFilesystem
 
interface  OMV\System\Filesystem\ISharedFolderCandidate
 
class  OMV\System\Group
 
interface  OMV\System\IBlockDevice
 
class  OMV\System\LogFileSpec
 
class  OMV\System\Monit
 
class  OMV\System\MountPoint
 
class  OMV\System\Net\Dns
 
class  OMV\System\Net\NetworkInterface
 
class  OMV\System\Net\NetworkInterfaceBackend\BackendAbstract
 
class  OMV\System\Net\NetworkInterfaceBackend\Bond
 
class  OMV\System\Net\NetworkInterfaceBackend\Bridge
 
class  OMV\System\Net\NetworkInterfaceBackend\Ethernet
 
class  OMV\System\Net\NetworkInterfaceBackend\Infiniband
 
class  OMV\System\Net\NetworkInterfaceBackend\Loopback
 
class  OMV\System\Net\NetworkInterfaceBackend\Manager
 
class  OMV\System\Net\NetworkInterfaceBackend\Virtual
 
class  OMV\System\Net\NetworkInterfaceBackend\Vlan
 
class  OMV\System\Net\NetworkInterfaceBackend\Wireless
 
class  OMV\System\Net\NetworkInterfaceBond
 
class  OMV\System\Os
 
class  OMV\System\PowerManagement
 
class  OMV\System\Process
 
class  OMV\System\ShellScript
 
class  OMV\System\Storage\Backend\BackendAbstract
 
class  OMV\System\Storage\Backend\Bcache
 
class  OMV\System\Storage\Backend\CCISS
 
class  OMV\System\Storage\Backend\CDROM
 
class  OMV\System\Storage\Backend\DM
 
class  OMV\System\Storage\Backend\FIO
 
class  OMV\System\Storage\Backend\HDD
 
class  OMV\System\Storage\Backend\I2O
 
class  OMV\System\Storage\Backend\Loop
 
class  OMV\System\Storage\Backend\LVM
 
class  OMV\System\Storage\Backend\Manager
 
class  OMV\System\Storage\Backend\Mdadm
 
class  OMV\System\Storage\Backend\MMC
 
class  OMV\System\Storage\Backend\NVM
 
class  OMV\System\Storage\Backend\RDB
 
class  OMV\System\Storage\Backend\VirtIO
 
class  OMV\System\Storage\Backend\Xen
 
interface  OMV\System\Storage\ISmartStorageDevice
 
interface  OMV\System\Storage\IStorageDevice
 
class  OMV\System\Storage\Lvm\LogicalVolume
 
class  OMV\System\Storage\SmartInformation
 
class  OMV\System\Storage\SmartStorageDeviceAbstract
 
class  OMV\System\Storage\StorageDevice
 
class  OMV\System\Storage\StorageDeviceBcache
 
class  OMV\System\Storage\StorageDeviceCCISS
 
class  OMV\System\Storage\StorageDeviceCDROM
 
class  OMV\System\Storage\StorageDeviceDM
 
class  OMV\System\Storage\StorageDeviceHDD
 
class  OMV\System\Storage\StorageDeviceI2O
 
class  OMV\System\Storage\StorageDeviceLoop
 
class  OMV\System\Storage\StorageDeviceLvm
 
class  OMV\System\Storage\StorageDeviceMdadm
 
class  OMV\System\Storage\StorageDeviceMMC
 
class  OMV\System\Storage\StorageDeviceNVM
 
class  OMV\System\Storage\StorageDeviceRDB
 
class  OMV\System\Storage\StorageDeviceVirtIO
 
class  OMV\System\Storage\StorageDeviceXen
 
class  OMV\System\System
 
class  OMV\System\SystemCtl
 
class  OMV\System\SysVInitScript
 
class  OMV\System\User
 
class  OMV\Util\KeyValueFile
 
class  OMV\Util\TopologicalSort
 
class  OMV\Uuid
 

Functions

 array_flatten (array $array, $separator=".", $parent_key="")
 
 array_expand (array $array, $separator=".")
 
 array_sort_key (array &$array, $key)
 
 array_filter_ex ($array, $key, $value)
 
 array_keys_exists (array $keys, array $search, &$missing=NULL)
 
 toArray ($object)
 
 array_value (array $array, $key, $default=NULL)
 
 array_rand_value (array $array, $num=1)
 
 array_boolval (array $array, $key)
 
 boolvalEx ($var)
 
 is_uuid ($var)
 
 is_fs_uuid ($var)
 
 is_devicefile ($var)
 
 is_devicefile_by ($var)
 
 is_devicefile_by_uuid ($var)
 
 is_devicefile_by_id ($var)
 
 is_devicefile_by_label ($var)
 
 is_devicefile_by_path ($var)
 
 is_block ($filename, $dereference=TRUE)
 
 is_json ($var)
 
 is_ipaddr ($var)
 
 is_ipaddr4 ($var)
 
 is_ipaddr6 ($var)
 
 is_multi_array ($var)
 
 is_multiarray ($var)
 
 is_assoc_array ($var)
 
 is_assoc ($var)
 
 is_64bits ()
 
 json_validate ($data, $schema, &$errors=NULL)
 
 json_encode_safe ($value, $options=0)
 
 json_decode_safe ($json, $assoc=false, $depth=512, $options=0)
 
if(!function_exists('json_last_error_msg')) binary_format ($number, $options=NULL)
 
 binary_convert ($number, $fromPrefix, $toPrefix, $decimalPlaces=0)
 
 strpdate ($date, $format)
 
 build_path ($separator,... $parts)
 
 listdir ($directory, $extension="", $sortFlags=SORT_NATURAL)
 
 mkdtemp ($prefix="", $mode=0700)
 
 inet_getnetmask ($bits, $forceipv6=FALSE)
 
 in_range ($var, $min, $max)
 
 uuid_equals ($uuid1, $uuid2)
 
 fs_uuid_equals ($uuid1, $uuid2)
 
 get_declared_subclasses ($class)
 
 posix_kill_ex ($pid, $sig)
 

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_boolval ( array  $array,
  $key 
)

Get boolean value of an array element.

Parameters
array$arrayAn array with keys.
string$keyThe key of the element.
Returns
Returns the boolean value of the given key.

◆ array_expand()

array_expand ( array  $array,
  $separator = "." 
)

Expands a flat array to a multi-dimensional array.

Parameters
array$arrayThe array to expand.
string$separatorThe character used as separator. Defaults to '.'.
Returns
A multi-dimensional array.

◆ array_filter_ex()

array_filter_ex (   $array,
  $key,
  $value 
)

Filter an array of by key and values.

Parameters
array$arrayThe array to process.
string$keyThe key used as filter criteria.
string$valueThe value used as filter criteria.
Returns
Returns the filtered array.

◆ array_flatten()

array_flatten ( array  $array,
  $separator = ".",
  $parent_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/. Collapses a multi-dimensional array into a single dimension using dot notation.

Parameters
array$arrayThe array to flatten.
string$separatorThe character used as separator. Defaults to '.'.
string$parent_keyThe parent key. Defaults to empty.
Returns
A single-dimensional array.

◆ array_keys_exists()

array_keys_exists ( array  $keys,
array  $search,
$missing = NULL 
)

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

Parameters
array$keysAn array containing the keys to check.
array$searchAn array with keys to check.
mixed$missingAn array that contains the missing keys if the function fails. Defaults to NULL.
Returns
Returns TRUE on success or FALSE on failure.

◆ array_rand_value()

array_rand_value ( array  $array,
  $num = 1 
)

Pick one or more random entries out of an array.

Parameters
array$arrayThe input array.
int$numSpecifies how many entries should be picked. Defaults to 1.
Returns
When picking only one entry, the function returns the value for a random entry. Otherwise, an array of values for the random entries is returned. Trying to pick more elements than there are in the array NULL will be returned.

◆ array_sort_key()

array_sort_key ( array &  $array,
  $key 
)

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.

◆ array_value()

array_value ( array  $array,
  $key,
  $default = NULL 
)

Get an array value.

Parameters
array$arrayThe array.
string$keyThe key of the element.
mixed$defaultThe default value. Defaults to NULL.
Returns
The value of the given key or the default value if the key does not exist.

◆ binary_convert()

binary_convert (   $number,
  $fromPrefix,
  $toPrefix,
  $decimalPlaces = 0 
)

Convert a number to bytes using binary multiples.

Parameters
mixed$numberThe number to convert.
string$fromPrefixThe binary prefix name number is in, e.g. 'KiB'.
string$toPrefixThe binary prefix name to convert number to, e.g. 'TiB'.
int$decimalPlacesThe number of decimal places. Defaults to 0.
Returns
The converted number as string or FALSE on failure.

◆ binary_format()

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
mixed$valueThe number to convert (per default this is in Bytes).
mixed$optionsAn array of additional options. Defaults to NULL.
Returns
The converted string value including the unit or an indexed array with the fields value and unit.

◆ boolvalEx()

boolvalEx (   $var)

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

Parameters
mixed$varThe scalar value being converted to a boolean.
Returns
Returns the boolean value of the given value.

◆ build_path()

build_path (   $separator,
  $parts 
)

Creates a path from a series of parts using separator as the separator between parts. At the boundary between two parts, any trailing occurrences of separator in the first part, or leading occurrences of separator in the second part are removed and exactly one copy of the separator is inserted.

Parameters
string$separatorThe directory seperator, e.g. DIRECTORY_SEPARATOR.
string$partsThe path elements to be concatenated.
Returns
A string path built from the given parts.

◆ fs_uuid_equals()

fs_uuid_equals (   $uuid1,
  $uuid2 
)

Compare two file system UUID strings.

See also
http://wiki.ubuntuusers.de/UUID
Parameters
string$uuid1The first file system UUID.
string$uuid2The second file system UUID.
Returns
Returns TRUE when the two strings are equal, FALSE otherwise.

◆ get_declared_subclasses()

get_declared_subclasses (   $class)

Returns an array with the name of the defined classes that are a subclass of the specified class.

Parameters
string$classThe class name being checked against.
Returns
Returns an array of the names of the declared classes in the current script that match the specified criteria.

◆ in_range()

in_range (   $var,
  $min,
  $max 
)

Check if the given integer value is in the range min <= var <= max.

Parameters
mixed$varThe value to check.
int$minThe minimum value of the sequence.
int$maxThe maximum value of the sequence.
Returns
TRUE if the value is within the range, otherwise FALSE.

◆ inet_getnetmask()

inet_getnetmask (   $bits,
  $forceipv6 = FALSE 
)

Build a netmask based on the given number of bits.

Parameters
int$bitsThe number of bits to be set in the desired netmask.
bool$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_64bits()

is_64bits ( )

Check if the platform is 64bit.

Returns
TRUE if 64bit, otherwise FALSE.

◆ is_assoc()

is_assoc (   $var)

Finds out whether a variable is an associative array.

Deprecated:
Parameters
mixed$varThe variable being evaluated.
Returns
TRUE if the variable is an associative array, otherwise FALSE.

◆ is_assoc_array()

is_assoc_array (   $var)

Finds out whether a variable is an associative array.

Parameters
mixed$varThe variable being evaluated.
Returns
TRUE if the variable is an associative array, otherwise FALSE.

◆ is_block()

is_block (   $filename,
  $dereference = TRUE 
)

Tells whether the given file is a block device.

Parameters
string$filenamePath to the file.
bool$dereferenceFollow links. Defaults to TRUE.
Returns
Returns TRUE if the file is a block device, FALSE otherwise.

◆ is_devicefile()

is_devicefile (   $var)

Finds out whether a variable describes a device file, e.g.

/dev/sda1.

Parameters
string$varThe variable being evaluated.
Returns
TRUE if the variable describes a device file, otherwise FALSE.

◆ is_devicefile_by()

is_devicefile_by (   $var)

Finds out whether a variable describes a device file disk/by-xxx, e.g.

/dev/disk/by-uuid/ad3ee177-777c-4ad3-8353-9562f85c0895

  • /dev/disk/by-id/usb-Kingston_DataTraveler_G2_001CC0EC21ADF011C6A20E35-0:0-part1
  • /dev/disk/by-label/data
Parameters
string$varThe variable being evaluated.
Returns
TRUE if the variable describes a device file, otherwise FALSE.

◆ is_devicefile_by_id()

is_devicefile_by_id (   $var)

Finds out whether a variable describes a device file, e.g.

/dev/disk/by-id/usb-Kingston_DataTraveler_G2_001CC0EC21ADF011C6A20E35-0:0-part1

Parameters
string$varThe variable being evaluated.
Returns
TRUE if the variable describes a device file, otherwise FALSE.

◆ is_devicefile_by_label()

is_devicefile_by_label (   $var)

Finds out whether a variable describes a device file, e.g.

/dev/disk/by-label/data

Parameters
string$varThe variable being evaluated.
Returns
TRUE if the variable describes a device file, otherwise FALSE.

◆ is_devicefile_by_path()

is_devicefile_by_path (   $var)

Finds out whether a variable describes a device file, e.g.

/dev/disk/by-path/pci-0000:00:17.0-ata-3

  • /dev/disk/by-path/pci-0000:00:17.0-ata-3-part2
Parameters
string$varThe variable being evaluated.
Returns
TRUE if the variable describes a device file, otherwise FALSE.

◆ is_devicefile_by_uuid()

is_devicefile_by_uuid (   $var)

Finds out whether a variable describes a device file, e.g.

/dev/disk/by-uuid/ad3ee177-777c-4ad3-8353-9562f85c0895

  • /dev/disk/by-uuid/2ED43920D438EC29 (NTFS)
Parameters
string$varThe variable being evaluated.
Returns
TRUE if the variable describes a device file, otherwise FALSE.

◆ is_fs_uuid()

is_fs_uuid (   $var)

Finds out whether a variable is a filesystem UUID, e.g.

78b669c1-9183-4ca3-a32c-80a4e2c61e2d (EXT2/3/4, JFS, XFS)

  • 7A48-BA97 (FAT)
  • 2ED43920D438EC29 (NTFS)
  • 2015-01-13-21-48-46-00 (ISO9660)
    See also
    http://wiki.ubuntuusers.de/UUID
    Parameters
    string$varThe variable being evaluated.
    Returns
    TRUE if the variable is a filesystem UUID, otherwise FALSE.

◆ is_ipaddr()

is_ipaddr (   $var)

Finds out whether a variable is an IP address.

Parameters
string$varThe variable being evaluated.
Returns
TRUE if the variable is an IP address, otherwise FALSE.

◆ is_ipaddr4()

is_ipaddr4 (   $var)

Finds out whether a variable is an IPv4 address.

Parameters
string$varThe variable being evaluated.
Returns
TRUE if the variable is an IPv4 address, otherwise FALSE.

◆ is_ipaddr6()

is_ipaddr6 (   $var)

Finds out whether a variable is an IPv6 address.

Parameters
string$varThe variable being evaluated.
Returns
TRUE if the variable is an IPv6 address, otherwise FALSE.

◆ is_json()

is_json (   $var)

Finds out whether a variable is JSON.

Parameters
mixed$varThe variable being evaluated.
Returns
TRUE if the variable is JSON, otherwise FALSE.

◆ is_multi_array()

is_multi_array (   $var)

Finds out whether a variable is a multidimensional array.

Parameters
mixed$varThe variable being evaluated.
Returns
TRUE if the variable is a multidimensional array, otherwise FALSE.

◆ is_multiarray()

is_multiarray (   $var)

Finds out whether a variable is a multidimensional array.

Deprecated:
Parameters
mixed$varThe variable being evaluated.
Returns
TRUE if the variable is a multidimensional array, otherwise FALSE.

◆ is_uuid()

is_uuid (   $var)

Finds out whether a variable is an UUID v4.

Parameters
string$varThe variable being evaluated.
Returns
TRUE if the variable is an UUID, otherwise FALSE.

◆ json_decode_safe()

json_decode_safe (   $json,
  $assoc = false,
  $depth = 512,
  $options = 0 
)

Decodes a JSON string. The JSON string being decoded will be encoded to UTF-8 before.

Parameters
string$jsonThe JSON string being decoded.
bool$assocWhen TRUE, returned objects will be converted into associative arrays. Defaults to FALSE.
int$depthUser specified recursion depth. Defaults to 512.
int$optionsBitmask of JSON decode options. Defaults to 0.
Returns
Returns the value encoded in json in appropriate PHP type. NULL is returned if the json cannot be decoded or if the encoded data is deeper than the recursion limit.

◆ json_encode_safe()

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
mixed$valueThe value being encoded.
int$optionsBitmask, see PHP json_encode manual pages. Defaults to 0.
Returns
Returns a string containing the JSON representation of value.

◆ json_validate()

json_validate (   $data,
  $schema,
$errors = NULL 
)

Validate JSON data via JSON schema.

Parameters
string$dataThe JSON string to validate.
mixed$schemaThe JSON schema to use for validation. This can be a string or an associative array.
mixed$errorsOptional parameter which will contain the error messages if validation fails. Defaults to NULL.
Returns
TRUE if successful, otherwise FALSE.

◆ listdir()

listdir (   $directory,
  $extension = "",
  $sortFlags = SORT_NATURAL 
)

List files inside the specified path.

Parameters
string$directoryThe directory that will be scanned.
string$extensionThe file extension of the files to search for.
int$sortFlagsModify the sorting behavior. Defaults to SORT_NATURAL.
Returns
Returns an array of files from the directory.

◆ mkdtemp()

mkdtemp (   $prefix = "",
  $mode = 0700 
)

Create a directory with unique file name.

Parameters
string$prefixThe prefix of the generated temporary directory. Defaults to empty.
int$modeThe mode of the temporary directory. Defaults to 0700.
Returns
Returns the full path of the created directory, or FALSE on failure.

◆ posix_kill_ex()

posix_kill_ex (   $pid,
  $sig 
)

Send a signal to a process and its children.

Parameters
pidThe process identifier.
sigOne of the PCNTL signals constants.
Returns
Returns TRUE on success or FALSE on failure.

◆ strpdate()

strpdate (   $date,
  $format 
)

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

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

◆ toArray()

toArray (   $object)

Convert an object to an array.

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

◆ uuid_equals()

uuid_equals (   $uuid1,
  $uuid2 
)

Compare two UUID v4 strings.

Parameters
string$uuid1The first UUID v4.
string$uuid2The second UUID v4.
Returns
Returns TRUE when the two strings are equal, FALSE otherwise.