Skip to content

Commit

Permalink
Merge pull request #840 from newrelic/dev
Browse files Browse the repository at this point in the history
Release 10.18
  • Loading branch information
ZNeumann authored Mar 1, 2024
2 parents f4c8604 + a57b812 commit e78afe1
Show file tree
Hide file tree
Showing 193 changed files with 18,377 additions and 827 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/code-coverage-baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ jobs:
arch: [amd64]
steps:
- name: Checkout newrelic-php-agent code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: php-agent
repository: ${{ inputs.origin }}/newrelic-php-agent
ref: ${{ inputs.ref }}
- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down Expand Up @@ -77,13 +77,13 @@ jobs:
codecov: 1
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: php-agent
repository: ${{ inputs.origin }}/newrelic-php-agent
ref: ${{ inputs.ref }}
- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down Expand Up @@ -155,7 +155,7 @@ jobs:
codecov: 1
steps:
- name: Checkout integration tests
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: php-agent
repository: ${{ inputs.origin }}/newrelic-php-agent
Expand Down Expand Up @@ -187,7 +187,7 @@ jobs:
chmod 755 php-agent/bin/integration_runner
chmod 755 php-agent/agent/modules/newrelic.so
- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down Expand Up @@ -250,7 +250,7 @@ jobs:
echo "COMMIT_HASH=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Upload coverage reports to Codecov
if: ${{ matrix.codecov == 1 }}
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v3.1.5
with:
token: ${{ secrets.CODECOV_TOKEN }}
working-directory: ./php-agent
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/make-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ jobs:
php: ['8.0', '8.1', '8.2', '8.3']
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: php-agent
repository: ${{ inputs.origin }}/newrelic-php-agent
ref: ${{ inputs.ref }}
- name: Enable arm64 emulation
if: ${{ inputs.arch == 'arm64' }}
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:${{vars.BINFMT_IMAGE_VERSION}}
platforms: arm64
- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/make-for-platform-on-arch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,19 @@ jobs:
platform: [gnu, musl]
steps:
- name: Checkout newrelic-php-agent code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: php-agent
repository: ${{ inputs.origin }}/newrelic-php-agent
ref: ${{ inputs.ref }}
- name: Enable arm64 emulation
if: ${{ inputs.arch == 'arm64' }}
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:${{vars.BINFMT_IMAGE_VERSION}}
platforms: arm64
- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/make-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
php: ['8.0', '8.1', '8.2', '8.3']
steps:
- name: Checkout integration tests
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: php-agent
repository: ${{ inputs.origin }}/newrelic-php-agent
Expand All @@ -58,12 +58,12 @@ jobs:
chmod 755 php-agent/agent/modules/newrelic.so
- name: Enable arm64 emulation
if: ${{ inputs.arch == 'arm64' }}
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:${{vars.BINFMT_IMAGE_VERSION}}
platforms: arm64
- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ jobs:
arch: [amd64]
steps:
- name: Checkout newrelic-php-agent code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.client_payload.ref }}
path: newrelic-php-agent
- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down Expand Up @@ -69,12 +69,12 @@ jobs:
arch: [amd64]
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.client_payload.ref }}
path: newrelic-php-agent
- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/repolinter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ jobs:
steps:
- name: Test Default Branch
id: default-branch
uses: actions/github-script@v2
uses: actions/github-script@v7
with:
script: |
const data = await github.repos.get(context.repo)
const data = await github.rest.repos.get(context.repo)
return data.data && data.data.default_branch === context.ref.split('/').slice(-1)[0]
- name: Checkout Self
if: ${{ steps.default-branch.outputs.result == 'true' }}
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Run Repolinter
if: ${{ steps.default-branch.outputs.result == 'true' }}
uses: newrelic/repolinter-action@v1
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/test-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ jobs:
arch: [amd64, arm64]
steps:
- name: Checkout newrelic-php-agent code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: php-agent
- name: Enable arm64 emulation
if: ${{ matrix.arch == 'arm64' }}
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:${{vars.BINFMT_IMAGE_VERSION}}
platforms: arm64
- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down Expand Up @@ -91,17 +91,17 @@ jobs:
codecov: 1
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: php-agent
- name: Enable arm64 emulation
if: ${{ matrix.arch == 'arm64' }}
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:${{vars.BINFMT_IMAGE_VERSION}}
platforms: arm64
- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down Expand Up @@ -202,7 +202,7 @@ jobs:
codecov: 1
steps:
- name: Checkout integration tests
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: php-agent
- name: Get integration_runner
Expand Down Expand Up @@ -233,12 +233,12 @@ jobs:
chmod 755 php-agent/agent/modules/newrelic.so
- name: Enable arm64 emulation
if: ${{ matrix.arch == 'arm64' }}
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:${{vars.BINFMT_IMAGE_VERSION}}
platforms: arm64
- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down Expand Up @@ -296,7 +296,7 @@ jobs:
nr-php make gcov
- name: Upload coverage reports to Codecov
if: ${{ matrix.codecov == 1 }}
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v3.1.5
with:
token: ${{ secrets.CODECOV_TOKEN }}
working-directory: ./php-agent
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.17.0
10.18.0
2 changes: 1 addition & 1 deletion agent/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ if test "$PHP_NEWRELIC" = "yes"; then
php_explain_pdo_mysql.c php_extension.c php_file_get_contents.c \
php_globals.c php_hash.c php_header.c php_httprequest_send.c \
php_internal_instrument.c php_minit.c php_mshutdown.c php_mysql.c \
php_mysqli.c php_newrelic.c php_nrini.c php_output.c php_pdo.c \
php_mysqli.c php_newrelic.c php_nrini.c php_observer.c php_output.c php_pdo.c \
php_pdo_mysql.c php_pdo_pgsql.c php_pgsql.c php_psr7.c php_redis.c \
php_rinit.c php_rshutdown.c php_samplers.c php_stack.c \
php_stacked_segment.c php_txn.c php_user_instrument.c \
Expand Down
37 changes: 37 additions & 0 deletions agent/fw_cakephp.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ nr_framework_classification_t nr_cakephp_special_2(
* Component::initialize(). This function takes a controller as a parameter
* and we look into the params array of that controller object, and pick up
* the controller and action out of that array.
*
* CakePHP 1.x is end-of-life and no longer supported by the agent.
* Cake PHP 1.x does not support PHP 8+ and this wrapper is not updated for OAPI
* compatibility.
*
*/
NR_PHP_WRAPPER(nr_cakephp_name_the_wt_pre20) {
zval* arg1 = 0;
Expand Down Expand Up @@ -130,6 +135,17 @@ NR_PHP_WRAPPER_END
* and we get the action from the params array in that object. The
* controller object ($this) has a name, and that name is used (along
* with the word "Controller" appended which is what the CakePHP code does).
*
* CakePHP 2.x is end-of-life and in maintenance mode (critical bugfixes only).
* As such, functionality added in PHP 7.1+ is not well supported.
*
* txn naming scheme:
* In this case, `nr_txn_set_path` is called after `NR_PHP_WRAPPER_CALL` with
* `NR_NOT_OK_TO_OVERWRITE`
* This entails that the last wrapped call gets to name the txn.
* No changes required to ensure OAPI compatibility this corresponds to the
* default way of calling the wrapped function in func_end.
*
*/
NR_PHP_WRAPPER(nr_cakephp_name_the_wt_2) {
zval* arg1 = 0;
Expand Down Expand Up @@ -243,6 +259,11 @@ NR_PHP_WRAPPER_END
*
* Dispatch::cakeError will be called if there is a problem during dispatch
* (action or controller not found).
*
* CakePHP 1.x is end-of-life and no longer supported by the agent.
* Cake PHP 1.x does not support PHP 8+ and this wrapper is not updated for OAPI
* compatibility.
*
*/
NR_PHP_WRAPPER(nr_cakephp_problem_1) {
const char* name = "Dispatcher::cakeError";
Expand All @@ -266,6 +287,16 @@ NR_PHP_WRAPPER_END
* appropriate Exception will be created and thrown. We wrap the CakeException
* constructor instead of the Exception handler, since CakePHP allows for the
* handler to be completely replaced.
*
* CakePHP 2.x is end-of-life and in maintenance mode (critical bugfixes only).
* As such, functionality added in PHP 7.1+ is not well supported.
*
* txn naming scheme:
* In this case, `nr_txn_set_path` is called before `NR_PHP_WRAPPER_CALL` with
* `NR_NOT_OK_TO_OVERWRITE` and as this corresponds to calling the wrapped
* function in func_begin it needs to be explicitly set as a before_callback to
* ensure OAPI compatibility. This entails that the first wrapped call gets to
* name the txn.
*/
NR_PHP_WRAPPER(nr_cakephp_problem_2) {
const char* name = "Exception";
Expand Down Expand Up @@ -298,6 +329,12 @@ void nr_cakephp_enable_1(TSRMLS_D) {
void nr_cakephp_enable_2(TSRMLS_D) {
nr_php_wrap_user_function(NR_PSTR("Controller::invokeAction"),
nr_cakephp_name_the_wt_2 TSRMLS_CC);
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
nr_php_wrap_user_function_before_after_clean(
NR_PSTR("CakeException::__construct"), nr_cakephp_problem_2, NULL, NULL);
#else
nr_php_wrap_user_function(NR_PSTR("CakeException::__construct"),
nr_cakephp_problem_2 TSRMLS_CC);
#endif
}
Loading

0 comments on commit e78afe1

Please sign in to comment.