PHP Class Workerman\WebServer

Inheritance: extends Worker
Exibir arquivo Open project: walkor/workerman Class Usage Examples

Protected Properties

Property Type Description
$_onWorkerStart callback Used to save user OnWorkerStart callback settings.
$mimeTypeMap array Mime mapping.
$serverRoot Virtual host to path mapping.

Public Methods

Method Description
__construct ( string $socket_name, array $context_option = [] ) Construct.
addRoot ( string $domain, string $root_path ) : void Add virtual host.
initMimeTypeMap ( ) : void Init mime map.
onMessage ( TcpConnection $connection ) : void Emit when http message coming.
onWorkerStart ( ) Emit when process start.
run ( ) Run webserver instance.
sendFile ( $connection, $file_path )

Method Details

__construct() public method

Construct.
public __construct ( string $socket_name, array $context_option = [] )
$socket_name string
$context_option array

addRoot() public method

Add virtual host.
public addRoot ( string $domain, string $root_path ) : void
$domain string
$root_path string
return void

initMimeTypeMap() public method

Init mime map.
public initMimeTypeMap ( ) : void
return void

onMessage() public method

Emit when http message coming.
public onMessage ( TcpConnection $connection ) : void
$connection Workerman\Connection\TcpConnection
return void

onWorkerStart() public method

Emit when process start.
public onWorkerStart ( )

run() public method

Run webserver instance.
public run ( )

sendFile() public static method

public static sendFile ( $connection, $file_path )

Property Details

$_onWorkerStart protected_oe property

Used to save user OnWorkerStart callback settings.
protected callback $_onWorkerStart
return callback

$mimeTypeMap protected_oe static_oe property

Mime mapping.
protected static array $mimeTypeMap
return array

$serverRoot protected_oe property

Virtual host to path mapping.
protected $serverRoot