This repository was archived by the owner on Jan 14, 2023. It is now read-only.
Allow whitelisting class methods #52
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In most modern PHP applications the majority of class fields will be private or protected and there will be a set of getters to access those fields. This makes it difficult to use expressions in snapshots or logpoints because many times the information that interests you will be held in a private or protected field, so you will not be able to use a expression like
$object->privateMemberbecause you will not have access. By default you cannot call any method in an object and there is no way to whitelist method calls.In this PR we add a new PHP ini setting
stackdriver_debugger.method_whitelistthat will allow you to whitelist a list of class methods. This provides us with a way to whitelist method calls so that we can use expressions like$object->getPrivateMember(). By default no method call is allowed but if we know that some of them are safe we should be able to whitelist them, the same way that we do for generic functions using thestackdriver_debugger.function_whitelistFixes #51