PHP 클래스 Scalr

파일 보기 프로젝트 열기: scalr/scalr 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$emergencyMemory string Emergency memory that is used in the case of the memory limit error to handle error safely

공개 메소드들

메소드 설명
AttachObserver ( AbstractEventObserver $observer ) Attach observer
FireEvent ( integer $farmid, AbstractServerEvent $event ) File event in database
GenerateAPIKeys ( )
GenerateRandomKey ( integer $length = 128 ) : string Generates random key of specified length
GenerateSecurePassword ( integer $length = 16, array $sets = null, array $enabledSets = null ) : string Generates password that includes at least one symbols from each set: l - lower case characters u - upper case characters d - digits s - special characters
GenerateUID ( $short = false, $startWithLetter = false )
LaunchServer ( ServerCreateInfo $ServerCreateInfo = null, DBServer $DBServer = null, boolean $delayed = false, integer | array $reason, Scalr_Account_User | integer $user = null ) : DBServer | null Launches server
ReconfigureObservers ( ) Method for multiprocess scripts. We must recreate DB connection created in constructor
StoreEvent ( integer $farmid, AbstractServerEvent $event, $eventTime = null ) Store event in database
camelize ( string $input ) : string Camelizes string
config ( string $name ) : mixed Gets config value
decamelize ( string $str ) : string Decamelizes a string
errorHandler ( integer $errno, string $errstr, string $errfile, integer $errline ) Scalr error handler
getAllHeaders ( ) : array Get all http headers in camel-case form
getContainer ( ) : Container Gets DI container
getDb ( boolean $forceNewConnection = null ) : ADODB_mysqli Gets an ADO Database Connection as singleton
initializeContainer ( ) Performs preliminary initialization of the DI container
isAllowedAnalyticsOnHostedScalrAccount ( integer $accountId ) : boolean Checks whether specified account is allowed to manage Cost centers and Projects on hosted scalr account
isHostedScalr ( ) : boolean Checks whether current install is hosted scalr
logException ( Exception $e ) Adds catchable exception to standart PHP error log
processHostDown ( DBServer $dbServer )

비공개 메소드들

메소드 설명
setupObservers ( )

메소드 상세

AttachObserver() 공개 정적인 메소드

Attach observer
public static AttachObserver ( AbstractEventObserver $observer )
$observer Scalr\Observer\AbstractEventObserver

FireEvent() 공개 정적인 메소드

File event in database
public static FireEvent ( integer $farmid, AbstractServerEvent $event )
$farmid integer
$event AbstractServerEvent

GenerateAPIKeys() 공개 정적인 메소드

public static GenerateAPIKeys ( )

GenerateRandomKey() 공개 정적인 메소드

Generates random key of specified length
public static GenerateRandomKey ( integer $length = 128 ) : string
$length integer optional The length of the key
리턴 string Returns the random string of specified length

GenerateSecurePassword() 공개 정적인 메소드

Generates password that includes at least one symbols from each set: l - lower case characters u - upper case characters d - digits s - special characters
public static GenerateSecurePassword ( integer $length = 16, array $sets = null, array $enabledSets = null ) : string
$length integer optional Password length
$sets array optional User (re-)defined characters sets
$enabledSets array optional Names of enabled sets, if null — all sets are enabled
리턴 string Returns generated password

GenerateUID() 공개 정적인 메소드

public static GenerateUID ( $short = false, $startWithLetter = false )

LaunchServer() 공개 정적인 메소드

Launches server
public static LaunchServer ( ServerCreateInfo $ServerCreateInfo = null, DBServer $DBServer = null, boolean $delayed = false, integer | array $reason, Scalr_Account_User | integer $user = null ) : DBServer | null
$ServerCreateInfo ServerCreateInfo optional The server create info
$DBServer DBServer optional The DBServer object
$delayed boolean optional
$reason integer | array optional
$user Scalr_Account_User | integer optional The Scalr_Account_User object or its unique identifier
리턴 DBServer | null Returns the DBServer object on cussess or null otherwise

ReconfigureObservers() 공개 정적인 메소드

Method for multiprocess scripts. We must recreate DB connection created in constructor
public static ReconfigureObservers ( )

StoreEvent() 공개 정적인 메소드

Store event in database
public static StoreEvent ( integer $farmid, AbstractServerEvent $event, $eventTime = null )
$farmid integer
$event AbstractServerEvent

camelize() 공개 정적인 메소드

Camelizes string
public static camelize ( string $input ) : string
$input string A string to camelize
리턴 string Returns Camelized string

config() 공개 정적인 메소드

Gets config value
public static config ( string $name ) : mixed
$name string An option name
리턴 mixed Returns configuration value for the specified key

decamelize() 공개 정적인 메소드

Decamelizes a string
public static decamelize ( string $str ) : string
$str string A string
리턴 string Returns decamelized string

errorHandler() 공개 정적인 메소드

Scalr error handler
public static errorHandler ( integer $errno, string $errstr, string $errfile, integer $errline )
$errno integer
$errstr string
$errfile string
$errline integer

getAllHeaders() 공개 정적인 메소드

Get all http headers in camel-case form
public static getAllHeaders ( ) : array
리턴 array

getContainer() 공개 정적인 메소드

Gets DI container
public static getContainer ( ) : Container
리턴 Scalr\DependencyInjection\Container

getDb() 공개 정적인 메소드

Gets an ADO Database Connection as singleton
public static getDb ( boolean $forceNewConnection = null ) : ADODB_mysqli
$forceNewConnection boolean optional Force new connection. (false by default)
리턴 ADODB_mysqli

initializeContainer() 공개 정적인 메소드

Performs preliminary initialization of the DI container
public static initializeContainer ( )

isAllowedAnalyticsOnHostedScalrAccount() 공개 정적인 메소드

Checks whether specified account is allowed to manage Cost centers and Projects on hosted scalr account
public static isAllowedAnalyticsOnHostedScalrAccount ( integer $accountId ) : boolean
$accountId integer Identifier of the client's account
리턴 boolean Returns true if it is allowed of false otherwise

isHostedScalr() 공개 정적인 메소드

Checks whether current install is hosted scalr
public static isHostedScalr ( ) : boolean
리턴 boolean Returns true if current install is a hosted Scalr

logException() 공개 정적인 메소드

Adds catchable exception to standart PHP error log
public static logException ( Exception $e )
$e Exception The exception to log

processHostDown() 공개 정적인 메소드

public static processHostDown ( DBServer $dbServer )
$dbServer DBServer

프로퍼티 상세

$emergencyMemory 공개적으로 정적으로 프로퍼티

Emergency memory that is used in the case of the memory limit error to handle error safely
public static string $emergencyMemory
리턴 string