PHP Class Scalr_Scripting_GlobalVariables

Mostrar archivo Open project: scalr/scalr Class Usage Examples

Public Properties

Property Type Description
$configurationVars array Array of predefined constants, which change default UI behavior This data should be synchronized with /core/variablefield.js
$configurationVarsDefaults array Default values for UI config vars
$doNotValidateNameCaseSensitivity boolean This flag was developed for old API. If it's true and CaseSensitivity validation was failed, we log message to SystemLog instead of Exception. If should be removed in next major version of Scalr.

Public Methods

Method Description
__construct ( integer $accountId, integer $envId, string $scope = ScopeInterface::SCOPE_SCALR )
_getValues ( integer $roleId, integer $farmId, integer $farmRoleId, string $serverId = '' ) : array
getErrorMessage ( ) : string Return first error message from set of validation errors
getUiDefaults ( ) : array Return default configuration vars for UI as name => value
getValues ( $roleId, $farmId, $farmRoleId, $serverId = '' )
listServerGlobalVariables ( DBServer $dbServer, $includeSystem = false, AbstractServerEvent $event = null )
listVariables ( $roleId, $farmId, $farmRoleId, $serverId = '' )
setValues ( array | ArrayObject $variables, integer $roleId, integer $farmId, integer $farmRoleId, string $serverId = '', boolean $throwException = true, boolean $skipValidation = false ) : array | boolean
validateValues ( array | ArrayObject $variables, integer $roleId, integer $farmId, integer $farmRoleId, string $serverId = "" ) : array | boolean Validate values

Protected Methods

Method Description
setError ( string $name, string $property, string $msg ) Set error (errors are saved to this->errors)

Private Methods

Method Description
errorHandler ( integer $errno, string $errstr ) Callback function for set_error_handler

Method Details

__construct() public method

public __construct ( integer $accountId, integer $envId, string $scope = ScopeInterface::SCOPE_SCALR )
$accountId integer
$envId integer
$scope string

_getValues() public method

public _getValues ( integer $roleId, integer $farmId, integer $farmRoleId, string $serverId = '' ) : array
$roleId integer
$farmId integer
$farmRoleId integer
$serverId string
return array Array of variables [name of variable => data]

getErrorMessage() public method

Return first error message from set of validation errors
public getErrorMessage ( ) : string
return string

getUiDefaults() public method

Return default configuration vars for UI as name => value
public getUiDefaults ( ) : array
return array

getValues() public method

public getValues ( $roleId, $farmId, $farmRoleId, $serverId = '' )

listServerGlobalVariables() public static method

public static listServerGlobalVariables ( DBServer $dbServer, $includeSystem = false, AbstractServerEvent $event = null )
$dbServer DBServer
$event AbstractServerEvent

listVariables() public method

public listVariables ( $roleId, $farmId, $farmRoleId, $serverId = '' )

setError() protected method

Set error (errors are saved to this->errors)
protected setError ( string $name, string $property, string $msg )
$name string Name of variable
$property string Property of variable
$msg string Error message

setValues() public method

public setValues ( array | ArrayObject $variables, integer $roleId, integer $farmId, integer $farmRoleId, string $serverId = '', boolean $throwException = true, boolean $skipValidation = false ) : array | boolean
$variables array | ArrayObject
$roleId integer optional
$farmId integer optional
$farmRoleId integer optional
$serverId string optional
$throwException boolean optional
$skipValidation boolean optional
return array | boolean

validateValues() public method

Validate values
public validateValues ( array | ArrayObject $variables, integer $roleId, integer $farmId, integer $farmRoleId, string $serverId = "" ) : array | boolean
$variables array | ArrayObject
$roleId integer
$farmId integer
$farmRoleId integer
$serverId string
return array | boolean Returns true if no errors or array of errors [name of variable => [name of property => [errors]]

Property Details

$configurationVars public_oe property

Array of predefined constants, which change default UI behavior This data should be synchronized with /core/variablefield.js
public array $configurationVars
return array

$configurationVarsDefaults public_oe property

Default values for UI config vars
public array $configurationVarsDefaults
return array

$doNotValidateNameCaseSensitivity public_oe property

This flag was developed for old API. If it's true and CaseSensitivity validation was failed, we log message to SystemLog instead of Exception. If should be removed in next major version of Scalr.
public bool $doNotValidateNameCaseSensitivity
return boolean