Documentation

PipeSession
in package
uses LineSessionTrait

Table of Contents

Constants

METHOD_REGEX  = ';^[a-z][a-zA-Z0-9_]*$;'

Properties

$bufferSize  : int
Maximum size of the buffer for reading lines.
$delimiter  : string
Line-delimiter.
$input  : resource
$methods  : object
Open-ended object. Any public method from this object will be available during this session.
$output  : resource
$responsePrefix  : string|null
A value to display immediately before the response lines.
$trusted  : bool|null

Methods

__construct()  : mixed
getBufferSize()  : int
getResponsePrefix()  : string|null
isTrusted()  : bool
run()  : mixed
Run the main loop. Poll for commands on $input and write responses to $output.
setBufferSize()  : $this
setIO()  : $this
setResponsePrefix()  : $this
setTrusted()  : PipeSession
onConnect()  : string|null
onException()  : string|null
onRequest()  : string|null
write()  : void

Constants

METHOD_REGEX

protected mixed METHOD_REGEX = ';^[a-z][a-zA-Z0-9_]*$;'

Properties

$bufferSize

Maximum size of the buffer for reading lines.

protected int $bufferSize = 524288

Clients may need to set this if they submit large requests.

$methods

Open-ended object. Any public method from this object will be available during this session.

protected object $methods
Tags
see
PublicMethods

$responsePrefix

A value to display immediately before the response lines.

protected string|null $responsePrefix = NULL

Clients may set this is if they want to detect and skip buggy noise.

Ex: chr(1).chr(1)

Methods

__construct()

public __construct([resource|null $input = NULL ][, resource|null $output = NULL ]) : mixed
Parameters
$input : resource|null = NULL
$output : resource|null = NULL

getResponsePrefix()

public getResponsePrefix() : string|null
Return values
string|null

isTrusted()

public isTrusted() : bool
Return values
bool

run()

Run the main loop. Poll for commands on $input and write responses to $output.

public run([string $negotiationFlags = '' ]) : mixed
Parameters
$negotiationFlags : string = ''

List of pipe initialization flags. See Civi::pipe() for description of flags.

setBufferSize()

public setBufferSize(int $bufferSize) : $this
Parameters
$bufferSize : int
Return values
$this

setIO()

public setIO(resource $input, resource $output) : $this
Parameters
$input : resource
$output : resource
Return values
$this

setResponsePrefix()

public setResponsePrefix(string|null $responsePrefix) : $this
Parameters
$responsePrefix : string|null
Return values
$this

onConnect()

protected onConnect(string $negotiationFlags) : string|null
Parameters
$negotiationFlags : string
Tags
inheritDoc
Return values
string|null

onException()

protected onException(string $requestLine, Throwable $t) : string|null
Parameters
$requestLine : string
$t : Throwable
Tags
inheritDoc
Return values
string|null

onRequest()

protected onRequest(string $requestLine) : string|null
Parameters
$requestLine : string
Tags
inheritDoc
Return values
string|null

write()

protected write(string|null $response) : void
Parameters
$response : string|null

        
On this page

Search results