PHP Класс PHPPM\ProcessSlave

Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$slave ProcessSlave Current instance, used by global functions.

Защищенные свойства (Protected)

Свойство Тип Описание
$appBootstrap string
$baseServer array Copy of $_SERVER during bootstrap.
$bridge PHPPM\Bridges\BridgeInterface
$bridgeName string
$config array 'port' => int (server port) 'appenv' => string (App environment) 'static' => boolean (true) (If it should server static files) 'logging' => boolean (false) (If it should log all requests) ...
$controller React\Socket\Connection Connection to ProcessManager, master process.
$errorLogger PHPPM\Debug\BufferingLogger
$inShutdown boolean
$lastSentFiles array | null Contains the cached version of last sent files, for performance reasons
$logFormat
$loop React\EventLoop\LibEventLoop | React\EventLoop\StreamSelectLoop
$server PHPPM\React\Server The HTTP Server.
$watchedFiles string[]

Открытые методы

Метод Описание
__construct ( $bridgeName = null, $appBootstrap, array $config = [] )
commandBootstrap ( array $data, Connection $conn )
isDebug ( ) : boolean
isLogging ( ) : boolean
onRequest ( React\Http\Request $request, PHPPM\React\HttpResponse $response ) Handles incoming requests and transforms a $request into a $response by reference.
registerFile ( string $path ) Adds a file path to the watcher list queue which will be sent to the master process after each request.
run ( ) Connects to ProcessManager, master process.
shutdown ( ) Shuts down the event loop. This basically exits the process.

Защищенные методы

Метод Описание
bootstrap ( string $appBootstrap, string $appenv, boolean $debug ) Bootstraps the actual application.
getBridge ( ) : PHPPM\Bridges\BridgeInterface
handleRequest ( React\Http\Request $request, PHPPM\React\HttpResponse $response ) Handle a redirected request from master.
isServingStatic ( ) : boolean
mimeContentType ( string $filename ) : string
prepareEnvironment ( React\Http\Request $request )
sendCurrentFiles ( ) Sends to the master a snapshot of current known php files, so it can track those files and restart slaves if necessary.
serveStatic ( React\Http\Request $request, PHPPM\React\HttpResponse $response ) : boolean
setupResponseLogging ( React\Http\Request $request, PHPPM\React\HttpResponse $response )

Описание методов

__construct() публичный Метод

public __construct ( $bridgeName = null, $appBootstrap, array $config = [] )
$config array

bootstrap() защищенный Метод

Bootstraps the actual application.
protected bootstrap ( string $appBootstrap, string $appenv, boolean $debug )
$appBootstrap string
$appenv string
$debug boolean

commandBootstrap() публичный Метод

public commandBootstrap ( array $data, Connection $conn )
$data array
$conn React\Socket\Connection

getBridge() защищенный Метод

protected getBridge ( ) : PHPPM\Bridges\BridgeInterface
Результат PHPPM\Bridges\BridgeInterface

handleRequest() защищенный Метод

Handle a redirected request from master.
protected handleRequest ( React\Http\Request $request, PHPPM\React\HttpResponse $response )
$request React\Http\Request
$response PHPPM\React\HttpResponse

isDebug() публичный Метод

public isDebug ( ) : boolean
Результат boolean

isLogging() публичный Метод

public isLogging ( ) : boolean
Результат boolean

isServingStatic() защищенный Метод

protected isServingStatic ( ) : boolean
Результат boolean

mimeContentType() защищенный Метод

protected mimeContentType ( string $filename ) : string
$filename string
Результат string

onRequest() публичный Метод

Handles incoming requests and transforms a $request into a $response by reference.
public onRequest ( React\Http\Request $request, PHPPM\React\HttpResponse $response )
$request React\Http\Request
$response PHPPM\React\HttpResponse

prepareEnvironment() защищенный Метод

protected prepareEnvironment ( React\Http\Request $request )
$request React\Http\Request

registerFile() публичный Метод

Adds a file path to the watcher list queue which will be sent to the master process after each request.
public registerFile ( string $path )
$path string

run() публичный Метод

Connects to ProcessManager, master process.
public run ( )

sendCurrentFiles() защищенный Метод

Sends to the master a snapshot of current known php files, so it can track those files and restart slaves if necessary.
protected sendCurrentFiles ( )

serveStatic() защищенный Метод

protected serveStatic ( React\Http\Request $request, PHPPM\React\HttpResponse $response ) : boolean
$request React\Http\Request
$response PHPPM\React\HttpResponse
Результат boolean returns true if successfully served

setupResponseLogging() защищенный Метод

protected setupResponseLogging ( React\Http\Request $request, PHPPM\React\HttpResponse $response )
$request React\Http\Request
$response PHPPM\React\HttpResponse

shutdown() публичный Метод

Shuts down the event loop. This basically exits the process.
public shutdown ( )

Описание свойств

$appBootstrap защищенное свойство

protected string $appBootstrap
Результат string

$baseServer защищенное свойство

Copy of $_SERVER during bootstrap.
protected array $baseServer
Результат array

$bridge защищенное свойство

protected BridgeInterface,PHPPM\Bridges $bridge
Результат PHPPM\Bridges\BridgeInterface

$bridgeName защищенное свойство

protected string $bridgeName
Результат string

$config защищенное свойство

'port' => int (server port) 'appenv' => string (App environment) 'static' => boolean (true) (If it should server static files) 'logging' => boolean (false) (If it should log all requests) ...
protected array $config
Результат array

$controller защищенное свойство

Connection to ProcessManager, master process.
protected Connection,React\Socket $controller
Результат React\Socket\Connection

$errorLogger защищенное свойство

protected BufferingLogger,PHPPM\Debug $errorLogger
Результат PHPPM\Debug\BufferingLogger

$inShutdown защищенное свойство

protected bool $inShutdown
Результат boolean

$lastSentFiles защищенное свойство

Contains the cached version of last sent files, for performance reasons
protected array|null $lastSentFiles
Результат array | null

$logFormat защищенное свойство

protected $logFormat

$loop защищенное свойство

protected LibEventLoop,React\EventLoop|StreamSelectLoop,React\EventLoop $loop
Результат React\EventLoop\LibEventLoop | React\EventLoop\StreamSelectLoop

$server защищенное свойство

The HTTP Server.
protected Server,PHPPM\React $server
Результат PHPPM\React\Server

$slave публичное статическое свойство

Current instance, used by global functions.
public static ProcessSlave,phppm $slave
Результат ProcessSlave

$watchedFiles защищенное свойство

protected string[] $watchedFiles
Результат string[]