Overview
  • Namespace
  • Class

Namespaces

  • Omines
    • DirectAdmin
      • Context
      • Objects
        • Database
        • Domains
        • Email
        • Users
      • Utility

Classes

  • Conversion

Class Conversion

Static helper class for various conversion operations.

Namespace: Omines\DirectAdmin\Utility
Author: Niels Keurentjes niels.keurentjes@omines.com
Located at DirectAdmin/Utility/Conversion.php

Methods summary

public static string
# onOff( mixed $input, mixed $default = false )

Reduces any input to an ON/OFF value.

Reduces any input to an ON/OFF value.

Parameters

$input
Data to convert
$default
Fallback to use if $input is NULL

Returns

string
Either ON or OFF
protected static
# processUnlimitedOption( array & $options, string $key )

Expands a single option to its unlimited counterpart if NULL or literal 'unlimited'.

Expands a single option to its unlimited counterpart if NULL or literal 'unlimited'.

Parameters

$options
Array of options to process
$key
Key of the item to process
public static array
# processUnlimitedOptions( array $options )

Detects package/domain options that can be unlimited and sets the accordingly.

Detects package/domain options that can be unlimited and sets the accordingly.

Parameters

$options

Returns

array
Modified array
public static array
# responseToArray( string $data )

Processes DirectAdmin style encoded responses into a sane array.

Processes DirectAdmin style encoded responses into a sane array.

Parameters

$data

Returns

array
public static array
# sanitizeArray( mixed $result )

Ensures a DA-style response element is wrapped properly as an array.

Ensures a DA-style response element is wrapped properly as an array.

Parameters

$result
Messy input

Returns

array
Sane output
public static boolean
# toBool( mixed $value, mixed $default = false )

Converts values like ON, YES etc. to proper boolean variables.

Converts values like ON, YES etc. to proper boolean variables.

Parameters

$value
Value to be converted
$default
Value to use if $value is NULL

Returns

boolean
API documentation generated by ApiGen