google / cloud-debugger
Stackdriver Debugger Client for PHP
Requires
- php: ^8.0
- google/cloud-common-protos: ~0.5
- google/cloud-core: ^1.52.7
- google/cloud-logging: ^1.16
- google/gax: ^1.34.0
- psr/log: ^2.0||^3.0
Requires (Dev)
- erusev/parsedown: ^1.6
- google/cloud-tools: ^0.14.0
- kreait/firebase-php: ^6.9
- phpdocumentor/reflection: ^5.3.3
- phpdocumentor/reflection-docblock: ^5.3
- phpspec/prophecy-phpunit: ^2.0
- phpunit/phpunit: ^9.0
- squizlabs/php_codesniffer: 2.*
Suggests
- ext-grpc: The gRPC extension enables use of the performant gRPC transport
- ext-protobuf: Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions.
- ext-stackdriver_debugger: *
- kreait/firebase-php: ^6.9 for use of the Firebase connection class and snapshot-debugger (see https://github.com/GoogleCloudPlatform/snapshot-debugger)
- dev-main
- v1.9.1
- v1.9.0
- v1.8.8
- v1.8.7
- v1.8.6
- v1.8.5
- v1.8.4
- v1.8.3
- v1.8.2
- v1.8.1
- v1.8.0
- v1.7.0
- v1.6.4
- v1.6.3
- v1.6.2
- v1.6.1
- v1.6.0
- v1.5.1
- v1.5.0
- v1.4.16
- v1.4.15
- v1.4.14
- v1.4.13
- v1.4.12
- v1.4.11
- v1.4.10
- v1.4.9
- v1.4.8
- v1.4.7
- v1.4.6
- v1.4.5
- v1.4.4
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.6
- v1.3.5
- v1.3.4
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.0
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.0
- v0.21.2
- v0.21.1
- v0.21.0
- v0.20.0
- v0.19.1
- v0.19.0
- v0.18.5
- v0.18.4
- v0.18.3
- v0.18.2
- v0.18.1
- v0.18.0
- v0.17.0
- v0.16.3
- v0.16.2
- v0.16.1
- v0.16.0
- v0.15.0
- v0.14.2
- v0.14.1
- v0.14.0
- v0.13.0
- v0.12.3
- v0.12.2
- v0.12.1
- v0.12.0
- v0.11.0
- v0.10.0
- v0.9.0
- v0.8.0
- v0.7.0
- v0.6.2
- v0.6.1
- v0.6.0
- v0.5.0
- v0.4.0
- v0.3.0
- v0.2.0
- v0.1.0
This package is auto-updated.
Last update: 2024-11-06 21:56:33 UTC
README
Idiomatic PHP client for Stackdriver Debugger.
NOTE: This repository is part of Google Cloud PHP. Any support requests, bug reports, or development contributions should be directed to that project.
A feature of Google Cloud Platform that lets you inspect the state of an application, at any code location, without stopping or slowing down the running app. Stackdriver Debugger makes it easier to view the application state without adding logging statements.
Installation
-
Install the PHP extension from PECL.
$ pecl install stackdriver_debugger-alpha
On Windows, you can download pre-built .dll files from PECL.
You may also need to enable the extension in your
php.ini
file:# on Unix extension=stackdriver_debugger.so # on Windows extension=php_stackdriver_debugger.dll
-
Install with
composer
or add to yourcomposer.json
.$ composer require google/cloud-debugger
-
Run the batch daemon script in the background.
On Unix-based systems that have semaphore extensions installed, run the BatchDaemon:
$ vendor/bin/google-cloud-batch daemon
On Windows or systems that do not have semaphore extensions installed, run the Debugger Daemon:
$ vendor/bin/google-cloud-debugger -s <SOURCE_ROOT>
The
SOURCE_ROOT
is the base location of your deployed application.Alternatively, you can provide a configuration script:
$ vendor/bin/google-cloud-debugger -c <CONFIG_FILE>
-
Include and start the debugger
Agent
as the first action in your application:$agent = new Google\Cloud\Debugger\Agent();
If this file is not in your source root, you will need to provide the path to your application's source root as an optional parameter:
$agent = new Google\Cloud\Debugger\Agent([ 'sourceRoot' => '/path/to/source/root' ]);
This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits offered by gRPC (such as streaming methods) please see our gRPC installation guide.
Authentication
Please see our Authentication guide for more information on authenticating your client. Once authenticated, you'll be ready to start making requests.
Sample
use Google\Cloud\Debugger\DebuggerClient; $debugger = new DebuggerClient(); $debuggee = $debugger->debugee(); $debuggee->register();
Configuration
Snapshots
Debugger snapshots allow you to capture and inspect the call stack and local variables in your application without stopping or slowing it down. In general, you will set breakpoints via the Stackdriver Debugger UI in the Cloud Platform Console.
See Using Debug Snapshots for more information on snapshots.
Logpoints
Debugger logpoints allow you to inject logging into running services without restarting or interfering with the normal function of the service. This can be useful for debugging production issues without having to add log statements and redeploy.
By default, we will send all log messages to Stackdriver Logging, but you can
customize this by providing any PSR-3 compatible logger. For example, to use
monolog
:
$agent = new Google\Cloud\Debugger\Agent([ 'logger' => new Monolog\Logger('name') ]);
See Using Debug Logpoints for more information on logpoints.
Version
This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in any minor or patch releases. We will address issues and requests with the highest priority.
Next Steps
- Understand the official documentation.
- Take a look at in-depth usage samples.