Stackdriver Debugger Client - Class Daemon (1.5.1)

Reference documentation and code samples for the Stackdriver Debugger Client class Daemon.

This class is responsible for registering itself as a Debuggee with the Stackdriver backend. It will fetch the list of breakpoints from the Stackdriver backend, validate and normalize them, and store them into the configured breakpoint storage.

Example:

use Google\Cloud\Debugger\Daemon;

$daemon = new Daemon();
$daemon->run();

Namespace

Google \ Cloud \ Debugger

Methods

__construct

Creates a new Daemon instance.

Parameters
NameDescription
options array

Configuration options.

↳ sourceRoot string

The full path to the source root. Defaults to the current working directory.

↳ clientConfig array

The options to instantiate the default DebuggerClient. Google\Cloud\Debugger\Google\Cloud\Debugger\DebuggerClient::__construct() for the available options.

↳ sourceContext array

The source code identifier. Defaults to values autodetected from the environment.

↳ extSourceContext array

The source code identifier. Defaults to the $sourceContext option.

↳ uniquifier string

A string when uniquely identifies this debuggee. Defaults to a value autodetected from the environment.

↳ description string

A display name for the debuggee in the Stackdriver Debugger UI. Defaults to a value autodetected from the environment.

↳ storage BreakpointStorageInterface

The breakpoint storage mechanism to use. Defaults to a new SysvBreakpointStorage instance.

↳ labels array

A set of custom debuggee properties, populated by the agent, to be displayed to the user. Defaults to labels detected from the environment.

↳ metadataProvider MetadataProviderInterface

Defaults to An automatically chosen provider, based on detected environment settings.

↳ closureSerializer ClosureSerializerInterface

An implementation responsible for serializing closures used in the $clientConfig. This is especially important when using the batch daemon. Defaults to Google\Cloud\Debugger\Google\Cloud\Core\Batch\OpisClosureSerializer if the opis/closure library is installed.

↳ register bool

Whether to start the worker in the background using the BatchRunner. Defaults to false.

run

Main loop for the daemon. Fetches breakpoints from the DebuggerClient and stores them in shared storage for the application to read. This function runs indefinitely.

Example:

$daemon->run();
Parameters
NameDescription
client Google\Cloud\Debugger\DebuggerClient
asDaemon mixed