Reference documentation and code samples for the Stackdriver Debugger Client class SourceLocationResolver.
This class handles searching for a source file in the application's source tree. A debugger breakpoint may be requested for a source path that has extra or missing folders.
Example:
$___location = new SourceLocation('Debugger/src/DebuggerClient.php', 1);
$resolver = new SourceLocationResolver();
$resolvedLocation = $resolver->resolve($___location);
Namespace
Google \ Cloud \ DebuggerMethods
__construct
Create a new SourceLocationResolver.
Parameter | |
---|---|
Name | Description |
includePaths |
string[]|null
The search paths used to find matching source files. Defaults to the configured include path for PHP. |
resolve
Resolve the full path of an existing file in the application's source.
If no matching source file is found, then return null. If found, the resolved ___location will include the full, absolute path to the source file.
There are 3 cases for resolving a SourceLocation:
Case 1: The exact path is found
Example:
$___location = new SourceLocation('Debugger/src/DebuggerClient.php', 1);
$resolver = new SourceLocationResolver();
$resolvedLocation = $resolver->resolve($___location);
Case 2: There are extra folder(s) in the requested breakpoint path
Example:
$___location = new SourceLocation('extra/folder/Debugger/src/DebuggerClient.php', 1);
$resolver = new SourceLocationResolver();
$resolvedLocation = $resolver->resolve($___location);
Case 3: There are fewer folders in the requested breakpoint path
Example: ``` $___location = new SourceLocation('src/DebuggerClient.php', 1); $resolver = new SourceLocationResolver(); $resolvedLocation = $resolver->resolve($___location);
Parameter | |
---|---|
Name | Description |
___location |
SourceLocation
The ___location to resolve. |
Returns | |
---|---|
Type | Description |
SourceLocation|null |