PHP 클래스 PHPDaemon\Core\Daemon

저자: Zorin Vasily ([email protected])
상속: use trait PHPDaemon\Traits\ClassWatchdog, use trait PHPDaemon\Traits\StaticObjectWatchdog
파일 보기 프로젝트 열기: kakserpom/phpdaemon 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$appInstances array Running application instances
$appResolver AppResolver AppResolver
$appResolverPath string Path to application resolver
$compatMode boolean Running under Apache/PHP-FPM in compatibility mode?
$config PHPDaemon\Config\Object Configuration object
$context object Running context
$defaultErrorLevel integer Default error reporting level
$logpointer resource Log file resource
$logpointerAsync object Log file async. resource
$noError boolean Mechanism of catching errors. Set it to true, then run your suspect code, and then check this property again. If false, there was error message.
$obInStack boolean Whether if the current execution stack contains ob-filter
$process PHPDaemon\Thread\Master | PHPDaemon\Thread\IPC | PHPDaemon\Thread\Worker Current thread object
$req PHPDaemon\Request\Generic Running request
$restrictErrorControl boolean Restrict error control. When true, operator '@' means nothing.
$runName string Base name of daemon instance
$runworkerMode boolean Is it running under master-less 'runworker' mode?
$shm_wstate PHPDaemon\Thread\Collection Shared memory 'WSTATE' entity
$startTime integer PHPDaemon start time
$version string PHPDaemon version
$wstateRev array Hash of possible worker states

보호된 프로퍼티들

프로퍼티 타입 설명
$initservervar array Copy of $_SERVER on the daemon start
$masters PHPDaemon\Thread\Collection Collection of masters
$support string Supported things array
$workers PHPDaemon\Thread\Collection Collection of workers

공개 메소드들

메소드 설명
callAutoGC ( ) : void Call automatic garbage collector
checkAutoGC ( ) : boolean Check if we need to run automatic garbage collector
compatRunEmul ( ) : boolean | null It allows to run your simple web-apps in spawn-fcgi/php-fpm environment.
errorHandler ( integer $errno, string $errstr, string $errfile, integer $errline, array $errcontext ) Error handler
getStateOfWorkers ( ) : array Get state of workers.
glob ( string $pattern, integer $flags ) : array Glob function with support of include_path
init ( ) : void Performs initial actions.
initSettings ( ) : void Loads default setting.
lintFile ( $filename ) : boolean Check file syntax via runkit_lint_file if supported or via php -l
loadConfig ( string $paths ) : boolean Load config-file
loadModuleIfAbsent ( string $mod, string $version = null, string $compare = '>=' ) : boolean Load PHP extension (module) if absent
log ( $args ) Send message to the log
openLogs ( ) : void Open logs
outputFilter ( $s ) : string Output filter
runWorker ( ) : void Run worker thread
spawnMaster ( ) : null | integer Spawn a master process
supported ( integer $what ) : boolean Is thing supported
uncaughtExceptionHandler ( Exception $e ) : void Uncaught exception handler
uniqid ( ) : string Generate a unique ID.

보호된 메소드들

메소드 설명
checkSupports ( ) : void Method to fill $support array

메소드 상세

callAutoGC() 공개 정적인 메소드

Call automatic garbage collector
public static callAutoGC ( ) : void
리턴 void

checkAutoGC() 공개 정적인 메소드

Check if we need to run automatic garbage collector
public static checkAutoGC ( ) : boolean
리턴 boolean

checkSupports() 보호된 정적인 메소드

Method to fill $support array
protected static checkSupports ( ) : void
리턴 void

compatRunEmul() 공개 정적인 메소드

It allows to run your simple web-apps in spawn-fcgi/php-fpm environment.
public static compatRunEmul ( ) : boolean | null
리턴 boolean | null - Success.

errorHandler() 공개 정적인 메소드

Error handler
public static errorHandler ( integer $errno, string $errstr, string $errfile, integer $errline, array $errcontext )
$errno integer
$errstr string
$errfile string
$errline integer
$errcontext array

getStateOfWorkers() 공개 정적인 메소드

Get state of workers.
public static getStateOfWorkers ( ) : array
리턴 array - information.

glob() 공개 정적인 메소드

Glob function with support of include_path
public static glob ( string $pattern, integer $flags ) : array
$pattern string
$flags integer
리턴 array

init() 공개 정적인 메소드

Performs initial actions.
public static init ( ) : void
리턴 void

initSettings() 공개 정적인 메소드

Loads default setting.
public static initSettings ( ) : void
리턴 void

lintFile() 공개 정적인 메소드

Check file syntax via runkit_lint_file if supported or via php -l
public static lintFile ( $filename ) : boolean
리턴 boolean

loadConfig() 공개 정적인 메소드

Load config-file
public static loadConfig ( string $paths ) : boolean
$paths string Path
리턴 boolean - Success.

loadModuleIfAbsent() 공개 정적인 메소드

Load PHP extension (module) if absent
public static loadModuleIfAbsent ( string $mod, string $version = null, string $compare = '>=' ) : boolean
$mod string
$version string
$compare string
리턴 boolean $success

log() 공개 정적인 메소드

Send message to the log
public static log ( $args )
$args

openLogs() 공개 정적인 메소드

Open logs
public static openLogs ( ) : void
리턴 void

outputFilter() 공개 정적인 메소드

Output filter
public static outputFilter ( $s ) : string
리턴 string Output

runWorker() 공개 정적인 메소드

Run worker thread
public static runWorker ( ) : void
리턴 void

spawnMaster() 공개 정적인 메소드

Spawn a master process
public static spawnMaster ( ) : null | integer
리턴 null | integer - success

supported() 공개 정적인 메소드

Is thing supported
public static supported ( integer $what ) : boolean
$what integer Thing to check
리턴 boolean

uncaughtExceptionHandler() 공개 정적인 메소드

Uncaught exception handler
public static uncaughtExceptionHandler ( Exception $e ) : void
$e Exception
리턴 void

uniqid() 공개 정적인 메소드

Generate a unique ID.
public static uniqid ( ) : string
리턴 string Returns the unique identifier, as a string.

프로퍼티 상세

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

Running application instances
public static array $appInstances
리턴 array

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

AppResolver
public static AppResolver,PHPDaemon\Core $appResolver
리턴 AppResolver

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

Path to application resolver
public static string $appResolverPath
리턴 string

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

Running under Apache/PHP-FPM in compatibility mode?
public static bool $compatMode
리턴 boolean

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

Configuration object
public static Object,PHPDaemon\Config $config
리턴 PHPDaemon\Config\Object

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

Running context
public static object $context
리턴 object

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

Default error reporting level
public static int $defaultErrorLevel
리턴 integer

$initservervar 보호되어 있는 정적으로 프로퍼티

Copy of $_SERVER on the daemon start
protected static array $initservervar
리턴 array

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

Log file resource
public static resource $logpointer
리턴 resource

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

Log file async. resource
public static object $logpointerAsync
리턴 object

$masters 보호되어 있는 정적으로 프로퍼티

Collection of masters
protected static Collection,PHPDaemon\Thread $masters
리턴 PHPDaemon\Thread\Collection

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

Mechanism of catching errors. Set it to true, then run your suspect code, and then check this property again. If false, there was error message.
public static bool $noError
리턴 boolean

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

Whether if the current execution stack contains ob-filter
public static bool $obInStack
리턴 boolean

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

Current thread object
public static Master,PHPDaemon\Thread|IPC,PHPDaemon\Thread|Worker,PHPDaemon\Thread $process
리턴 PHPDaemon\Thread\Master | PHPDaemon\Thread\IPC | PHPDaemon\Thread\Worker

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

Running request
public static Generic,PHPDaemon\Request $req
리턴 PHPDaemon\Request\Generic

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

Restrict error control. When true, operator '@' means nothing.
public static bool $restrictErrorControl
리턴 boolean

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

Base name of daemon instance
public static string $runName
리턴 string

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

Is it running under master-less 'runworker' mode?
public static bool $runworkerMode
리턴 boolean

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

Shared memory 'WSTATE' entity
public static Collection,PHPDaemon\Thread $shm_wstate
리턴 PHPDaemon\Thread\Collection

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

PHPDaemon start time
public static int $startTime
리턴 integer

$support 보호되어 있는 정적으로 프로퍼티

Supported things array
protected static string $support
리턴 string

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

PHPDaemon version
public static string $version
리턴 string

$workers 보호되어 있는 정적으로 프로퍼티

Collection of workers
protected static Collection,PHPDaemon\Thread $workers
리턴 PHPDaemon\Thread\Collection

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

Hash of possible worker states
public static array $wstateRev
리턴 array