-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify agent to conform with new PHP 8.0 internal API changes (#49)
Fixes #46 * Added defines for PHP8. * Added `TSRMLS` macros. * The Object Handlers API was changed to receive zend_object* instead of zval* and zend_string* instead of zval* for property names. Modified agent to toggle between zval and zend_object depending on PHP8 or not. * The zend_fcall_info no_separation flag has been removed, and separation is never allowed. If you wish to pass (or allow passing) arguments by reference, explicitly create those arguments as references using ZEND_MAKE_REF. This function is passed as a pointer in the agent here. This removal also affects call_user_function_ex() (example in agent), which should be replaced by call_user_function(). * Error notifications have a new API and the callback signature has changed. The current changes do not register a callback. * `display_disabled_function` (and therefore also `zif_display_disabled_function`) has been removed `zend_API.c.`. In PHP 8, a disabled function is indistinguishable from a function that does not exist. * Added `newrelic_arginfo_void` as `PHP_FE` no longer allows `0` as an argument. * Modified unit tests to work with PHP8. * `call_user_function_ex` was removed and `call_user_function` became the recommended function; however, it no longer gracefully handled the case of the 2nd parameter being passed in as NULL. We no longer assume graceful handling, and now we check for NULL before calling the function. * Take into account new `libphp.so` and `libphp.a` naming scheme. * `zend_get_resource_handle` now takes a different type parameter. * Added `#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO /* PHP 8.0+ */` around definition of `newrelic_arginfo_void` since all usages of this were also wrapped in PHP 8 `if` statements which would then result in an used arg error/warning on some builds. * Update opcode inspection to properly detect calls to `call_user_func_array`. On PHP 8.0, there's an additional opcode added when the function is compiled. Co-authored-by: Joshua Benuck <[email protected]>
- Loading branch information
1 parent
c196db4
commit 73ff3da
Showing
23 changed files
with
340 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.