PHP Class Scalr_Scripting_GlobalVariables

Afficher le fichier Open project: scalr/scalr Class Usage Examples

Méthodes publiques

Свойство 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.

Méthodes publiques

Méthode 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

Méthodes protégées

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

Private Methods

Méthode Description
errorHandler ( integer $errno, string $errstr ) Callback function for set_error_handler

Method Details

__construct() public méthode

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

_getValues() public méthode

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

getErrorMessage() public méthode

Return first error message from set of validation errors
public getErrorMessage ( ) : string
Résultat string

getUiDefaults() public méthode

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

getValues() public méthode

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

listServerGlobalVariables() public static méthode

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

listVariables() public méthode

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

setError() protected méthode

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 méthode

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
Résultat array | boolean

validateValues() public méthode

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
Résultat 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
Résultat array

$configurationVarsDefaults public_oe property

Default values for UI config vars
public array $configurationVarsDefaults
Résultat 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
Résultat boolean