Closed p4veI closed 3 years ago
Hello @p4veI
The PHP SDK is not a substitute to the PHP extension. It enables you to programmatically create profiles and builds. There is indeed a legacy class for PHP 5.2, as the PHP extension is only available as of PHP 5.3.
I have a symfony app and want to profile run on certain endpoint of my app - e.g. I was meaning to include the configured client in the controller's constructor call the createProbe method - which enables the profiling and returns Probe, I have my code executed and before I return the response I call the endProbe method with the Probe instance and end profiling. and return response. This creates a profile in the web interface which I can examine.
This looks like a correct programmatic creation of a profile, yes. However, be careful not do trigger this on every request as you will:
You will find the documentation for the SDK here: https://blackfire.io/docs/php/integrations/sdk
If you have more questions, please consider using https://support.blackfire.io (using the chat). You may also send an email to support@blackfire.io
Hello, I'm confused from the documented configuration of Blackfire tools & options that are included here in this repository vs. what is included in the official documentation at https://blackfire.io/docs/php/configuration
Especially by this warning here:
WARNING: This code should only be used when installing the Blackfire PHP extension is not possible.
I have blackfire configured on the server where my application runs & also installed the PHP extension since it's possible. But as I understand from this warning if I installed the blackfire php extension and should not use this SDK, how do I make blackfire probe profile a certain part of my code without instantiating the probe at a specific place in the code?
Is the PHP extension intended to use with e.g. the browser extension or how should I enable profiling now?
Consider this example..
I have a symfony app and want to profile run on certain endpoint of my app - e.g. I was meaning to include the configured client in the controller's constructor call the
createProbe
method - which enables the profiling and returnsProbe
, I have my code executed and before I return the response I call theendProbe
method with theProbe
instance and end profiling. and return response. This creates a profile in the web interface which I can examine.Is this considered a correct usage?
Note this means I'm using both my php extension as well as the php sdk.
The official documentation does not mention anything about not using the SDK along with PHP extension.