-
Notifications
You must be signed in to change notification settings - Fork 67
Support for PHP Framework Yii2 #821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
For reference, here is the current detection trigger code: newrelic-php-agent/agent/fw_yii.c Lines 84 to 89 in 320ea57
This is the referenced source code from Yii1:
In Yii2, the Action class is renamed to:
Yii2 has automatic route naming function getUniqueId() that we should use, it prepends the module name too, when present. Please let me know if I can provide more information for fixing this. |
Discovered also the path here: newrelic-php-agent/agent/php_execute.c Lines 415 to 416 in 320ea57
This file is now named Yii.php , so correct path for v2 would be yiisoft/yii2/Yii.php or just yii2/Yii.php
The biggest problem is that currently the ErrorHandler is not wrapped at all, so no errors are displayed in NewRelic... newrelic-php-agent/agent/fw_laravel.c Line 573 in 320ea57
|
@razvanphp Thank you for providing the details of changes in Yii2 and your contribution. Our team is actively looking into incorporating these updates in one of the upcoming agent release. |
I can confirm that this works with the official version of PHP agent now. |
Yii 1.x support is still there, so for completion and given that this version is still widely used, I've udpated the docs to reflect that. See: newrelic/newrelic-php-agent#821
Hello,
I see that in the documentation of the agent it's stated that Yii 1.x support is built-in for automatic framework detection, but we've noticed that for Yii 2 this is not the case.
To give you some context about this, Yii 2.0 was released in Oct 2014 and it's been well maintained since then to be a reputable PHP framework used in (many) production deployments.
Yii 1.1 end of life was declared since 2023, but it still receives security updates from the community till 2026.
Since the integration extensions are not so great and have low quality of code, was wondering if it would be possible to develop the framework detection in the Newrelic Agent for everybody, I'm sure the community would love that.
Can we support somehow with the testing and implementation? Are contributions welcome for this? I could probably do it myself with some guidance and testing support.
PS: we also sent this internally through support, Feature Request ID: NR-158719
Thank you in advance!
R
The text was updated successfully, but these errors were encountered: