PHP Class PHPDaemon\Config\Object

Author: Zorin Vasily ([email protected])
Inheritance: implements ArrayAccess, use trait PHPDaemon\Traits\ClassWatchdog
Show file Open project: kakserpom/phpdaemon Class Usage Examples

Public Properties

Property Type Description
$addincludepath string | PHPDaemon\Config\Entry\Generic Additional include path
$autogc integer | PHPDaemon\Config\Entry\Number Automatic garbage collector, number of iterations between GC call
$autoreimport boolean | PHPDaemon\Config\Entry\Generic Try to import updated code (runkit required)
$autoreload time Autoreload interval. Time interval between checks.
$chroot string | PHPDaemon\Config\Entry\Generic Chroot
$configfile string | PHPDaemon\Config\Entry\ConfigFile Config file
$cwd string Current directory
$defaultns path Default namespace
$defaultpidfile path Default PID file
$eioenabled boolean EIO enabled?
$eiosetmaxidle time EIO maximum idle time
$eiosetmaxparallel integer | PHPDaemon\Config\Entry\Number EIO maximum parallel threads
$eiosetmaxpollreqs integer | PHPDaemon\Config\Entry\Number EIO maximum poll requests
$eiosetmaxpolltime time EIO maximum poll time
$eiosetminparallel integer | PHPDaemon\Config\Entry\Number EIO minimum parallel threads
$group string | PHPDaemon\Config\Entry\Generic System group (setgid)
$ipcthreadpriority integer IPC thread priority
$lambdacachecapwindow integer Lambda cache cap window
$lambdacachemaxsize integer Lambda cache size
$lambdacachettl integer Lambda cache ttl
$lastRevision integer
$locale string | PHPDaemon\Config\Entry\Generic Comma-separated list of locales
$logerrors boolean Log errors?
$logformat string Log format
$logging boolean Logging?
$logsignals boolean Log signals?
$logstorage boolean | PHPDaemon\Config\Entry\Generic Log storage
$logworkersetstate boolean Log Worker->setState() ?
$masterpriority integer Master thread priority
$maxidle time Maximum idle time
$maxmemoryusage size Maximum memory usage
$maxrequests integer | PHPDaemon\Config\Entry\Number Max. requests before worker restart
$maxspareworkers integer | PHPDaemon\Config\Entry\Number Maximum number of spare workes
$maxworkers integer | PHPDaemon\Config\Entry\Number Maximum number of workers
$minspareworkers integer | PHPDaemon\Config\Entry\Number Minimum number of spare workes
$minworkers integer | PHPDaemon\Config\Entry\Number Minimum number of workers
$mpmdelay time Multi-Process Manager delay
$obfilterauto boolean IPC thread priority
$path string | PHPDaemon\Config\Entry\Generic Application resolver
$pidfile string | PHPDaemon\Config\Entry\Generic PID file
$restricterrorcontrol boolean Restrict usage of error-control functions (like @ operator), useful in debugging
$startworkers integer | PHPDaemon\Config\Entry\Number Start workers
$throwexceptiononshutdown boolean Throw exception on shutdown?
$user string | PHPDaemon\Config\Entry\Generic System user (setuid)
$verbosetty boolean Do not close STDOUT and STDERR pipes and send log messages there
$workerpriority integer Worker thread priority

Public Methods

Method Description
__construct ( ) : object Constructor
getRealPropertyName ( $prop ) : string Get real property name
loadCmdLineArgs ( $settings ) : boolean Imports parameters from command line args
loadFile ( $path ) : boolean Load config file
offsetExists ( $prop ) : boolean Checks if property exists
offsetGet ( $prop ) : mixed Get property by name
offsetSet ( $prop, $value ) : void Set property
offsetUnset ( $prop ) : void Unset property
parseCfgUri ( $uri, $source = null ) : boolean Checks if property exists
renameSection ( string $old, string $new, booelan $log = false ) : void Renames section

Protected Methods

Method Description
onLoad ( ) : void Called when config is loaded

Method Details

__construct() public method

Constructor
public __construct ( ) : object
return object

getRealPropertyName() public method

Get real property name
public getRealPropertyName ( $prop ) : string
return string Real property name

loadCmdLineArgs() public static method

Imports parameters from command line args
public static loadCmdLineArgs ( $settings ) : boolean
return boolean - Success.

loadFile() public method

Load config file
public loadFile ( $path ) : boolean
return boolean Success

offsetExists() public method

Checks if property exists
public offsetExists ( $prop ) : boolean
return boolean Exists?

offsetGet() public method

Get property by name
public offsetGet ( $prop ) : mixed
return mixed

offsetSet() public method

Set property
public offsetSet ( $prop, $value ) : void
return void

offsetUnset() public method

Unset property
public offsetUnset ( $prop ) : void
return void

onLoad() protected method

Called when config is loaded
protected onLoad ( ) : void
return void

parseCfgUri() public static method

Checks if property exists
public static parseCfgUri ( $uri, $source = null ) : boolean
return boolean Exists?

renameSection() public method

Renames section
public renameSection ( string $old, string $new, booelan $log = false ) : void
$old string
$new string
$log booelan Log?
return void

Property Details

$addincludepath public property

Additional include path
public string|Generic,PHPDaemon\Config\Entry $addincludepath
return string | PHPDaemon\Config\Entry\Generic

$autogc public property

Automatic garbage collector, number of iterations between GC call
public int|Number,PHPDaemon\Config\Entry $autogc
return integer | PHPDaemon\Config\Entry\Number

$autoreimport public property

Try to import updated code (runkit required)
public bool|Generic,PHPDaemon\Config\Entry $autoreimport
return boolean | PHPDaemon\Config\Entry\Generic

$autoreload public property

Autoreload interval. Time interval between checks.
public time $autoreload
return time

$chroot public property

Chroot
public string|Generic,PHPDaemon\Config\Entry $chroot
return string | PHPDaemon\Config\Entry\Generic

$configfile public property

Config file
public string|ConfigFile,PHPDaemon\Config\Entry $configfile
return string | PHPDaemon\Config\Entry\ConfigFile

$cwd public property

Current directory
public string $cwd
return string

$defaultns public property

Default namespace
public path $defaultns
return path

$defaultpidfile public property

Default PID file
public path $defaultpidfile
return path

$eioenabled public property

EIO enabled?
public bool $eioenabled
return boolean

$eiosetmaxidle public property

EIO maximum idle time
public time $eiosetmaxidle
return time

$eiosetmaxparallel public property

EIO maximum parallel threads
public int|Number,PHPDaemon\Config\Entry $eiosetmaxparallel
return integer | PHPDaemon\Config\Entry\Number

$eiosetmaxpollreqs public property

EIO maximum poll requests
public int|Number,PHPDaemon\Config\Entry $eiosetmaxpollreqs
return integer | PHPDaemon\Config\Entry\Number

$eiosetmaxpolltime public property

EIO maximum poll time
public time $eiosetmaxpolltime
return time

$eiosetminparallel public property

EIO minimum parallel threads
public int|Number,PHPDaemon\Config\Entry $eiosetminparallel
return integer | PHPDaemon\Config\Entry\Number

$group public property

System group (setgid)
public string|Generic,PHPDaemon\Config\Entry $group
return string | PHPDaemon\Config\Entry\Generic

$ipcthreadpriority public property

IPC thread priority
public int $ipcthreadpriority
return integer

$lambdacachecapwindow public property

Lambda cache cap window
public int $lambdacachecapwindow
return integer

$lambdacachemaxsize public property

Lambda cache size
public int $lambdacachemaxsize
return integer

$lambdacachettl public property

Lambda cache ttl
public int $lambdacachettl
return integer

$lastRevision public static property

public static int $lastRevision
return integer

$locale public property

Comma-separated list of locales
public string|Generic,PHPDaemon\Config\Entry $locale
return string | PHPDaemon\Config\Entry\Generic

$logerrors public property

Log errors?
public bool $logerrors
return boolean

$logformat public property

Log format
public string $logformat
return string

$logging public property

Logging?
public bool $logging
return boolean

$logsignals public property

Log signals?
public bool $logsignals
return boolean

$logstorage public property

Log storage
public bool|Generic,PHPDaemon\Config\Entry $logstorage
return boolean | PHPDaemon\Config\Entry\Generic

$logworkersetstate public property

Log Worker->setState() ?
public bool $logworkersetstate
return boolean

$masterpriority public property

Master thread priority
public int $masterpriority
return integer

$maxidle public property

Maximum idle time
public time $maxidle
return time

$maxmemoryusage public property

Maximum memory usage
public size $maxmemoryusage
return size

$maxrequests public property

Max. requests before worker restart
public int|Number,PHPDaemon\Config\Entry $maxrequests
return integer | PHPDaemon\Config\Entry\Number

$maxspareworkers public property

Maximum number of spare workes
public int|Number,PHPDaemon\Config\Entry $maxspareworkers
return integer | PHPDaemon\Config\Entry\Number

$maxworkers public property

Maximum number of workers
public int|Number,PHPDaemon\Config\Entry $maxworkers
return integer | PHPDaemon\Config\Entry\Number

$minspareworkers public property

Minimum number of spare workes
public int|Number,PHPDaemon\Config\Entry $minspareworkers
return integer | PHPDaemon\Config\Entry\Number

$minworkers public property

Minimum number of workers
public int|Number,PHPDaemon\Config\Entry $minworkers
return integer | PHPDaemon\Config\Entry\Number

$mpmdelay public property

Multi-Process Manager delay
public time $mpmdelay
return time

$obfilterauto public property

IPC thread priority
public bool $obfilterauto
return boolean

$path public property

Application resolver
public string|Generic,PHPDaemon\Config\Entry $path
return string | PHPDaemon\Config\Entry\Generic

$pidfile public property

PID file
public string|Generic,PHPDaemon\Config\Entry $pidfile
return string | PHPDaemon\Config\Entry\Generic

$restricterrorcontrol public property

Restrict usage of error-control functions (like @ operator), useful in debugging
public bool $restricterrorcontrol
return boolean

$startworkers public property

Start workers
public int|Number,PHPDaemon\Config\Entry $startworkers
return integer | PHPDaemon\Config\Entry\Number

$throwexceptiononshutdown public property

Throw exception on shutdown?
public bool $throwexceptiononshutdown
return boolean

$user public property

System user (setuid)
public string|Generic,PHPDaemon\Config\Entry $user
return string | PHPDaemon\Config\Entry\Generic

$verbosetty public property

Do not close STDOUT and STDERR pipes and send log messages there
public bool $verbosetty
return boolean

$workerpriority public property

Worker thread priority
public int $workerpriority
return integer