Skip to content
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

Added Laminas 3.x support. #36

Merged
merged 6 commits into from
Nov 24, 2020
Merged

Added Laminas 3.x support. #36

merged 6 commits into from
Nov 24, 2020

Conversation

zsistla
Copy link
Contributor

@zsistla zsistla commented Nov 20, 2020

Duplicated the current Zend support with Laminas naming.

See https://source.datanerd.us/php-agent/multiverse/pull/56 for multiverse testing.

@zsistla
Copy link
Contributor Author

zsistla commented Nov 20, 2020

ok jenkins

#include "util_memory.h"

/*
* Laminas is a rebranding of Zend, but the logic remains the same,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there's an extra space here before the Laminas comment

nr_php_wrap_user_function(NR_PSTR(http_client_request),
nr_zend_http_client_request TSRMLS_CC);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra line needed

Comment on lines 33 to 37
static char library_name[50] = "Zend";
static char curl_adapter_typename[50] = "Zend_Http_Client_Adapter_Curl";
static char uri_http_typename[50] = "Zend_Uri_Http";
static char http_client[50] = "Zend_Http_Client";
static char http_client_request[50] = "Zend_Http_Client::request";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we can do this by freeing and allocating new memory for the laminas naming scheme in nr_laminas_http_enable(), instead of copying the strings over?

@kneitinger
Copy link
Contributor

Multiverse tests pass quite nicely.

running tests/laminas/3.x/test_action_forward.php
running tests/laminas/3.x/test_action_not_found.php
running tests/laminas/3.x/test_cat_and_synthetics_disabled.php
running tests/laminas/3.x/test_cat_curl_adapter.php
running tests/laminas/3.x/test_cat_disabled.php
running tests/laminas/3.x/test_cat_exception.php
running tests/laminas/3.x/test_cat_socket_adapter.php
running tests/laminas/3.x/test_controller_action.php
running tests/laminas/3.x/test_controller_not_found.php
running tests/laminas/3.x/test_home_route.php
running tests/laminas/3.x/test_library_cat_and_synthetics_disabled.php
running tests/laminas/3.x/test_library_cat_curl_adapter.php
running tests/laminas/3.x/test_library_cat_disabled.php
running tests/laminas/3.x/test_library_cat_exception.php
running tests/laminas/3.x/test_library_cat_socket_adapter.php
running tests/laminas/3.x/test_library_synthetics.php
running tests/laminas/3.x/test_library_synthetics_disabled.php
running tests/laminas/3.x/test_library_synthetics_with_cat_disabled.php
running tests/laminas/3.x/test_name_default_index.php
running tests/laminas/3.x/test_name_module_action.php
running tests/laminas/3.x/test_name_redirect.php
running tests/laminas/3.x/test_redirect.php
running tests/laminas/3.x/test_route_not_found.php
running tests/laminas/3.x/test_synthetics.php
running tests/laminas/3.x/test_synthetics_disabled.php
running tests/laminas/3.x/test_synthetics_with_cat_disabled.php
ok - tests/laminas/3.x/test_action_forward.php
ok - tests/laminas/3.x/test_action_not_found.php
ok - tests/laminas/3.x/test_cat_and_synthetics_disabled.php
ok - tests/laminas/3.x/test_cat_curl_adapter.php
ok - tests/laminas/3.x/test_cat_disabled.php
ok - tests/laminas/3.x/test_cat_exception.php
ok - tests/laminas/3.x/test_cat_socket_adapter.php
ok - tests/laminas/3.x/test_controller_action.php
ok - tests/laminas/3.x/test_controller_not_found.php
ok - tests/laminas/3.x/test_home_route.php
ok - tests/laminas/3.x/test_library_cat_and_synthetics_disabled.php
ok - tests/laminas/3.x/test_library_cat_curl_adapter.php
ok - tests/laminas/3.x/test_library_cat_disabled.php
ok - tests/laminas/3.x/test_library_cat_exception.php
ok - tests/laminas/3.x/test_library_cat_socket_adapter.php
ok - tests/laminas/3.x/test_library_synthetics.php
ok - tests/laminas/3.x/test_library_synthetics_disabled.php
xfail - tests/laminas/3.x/test_library_synthetics_with_cat_disabled.php
ok - tests/laminas/3.x/test_name_default_index.php
ok - tests/laminas/3.x/test_name_module_action.php
ok - tests/laminas/3.x/test_name_redirect.php
ok - tests/laminas/3.x/test_redirect.php
ok - tests/laminas/3.x/test_route_not_found.php
ok - tests/laminas/3.x/test_synthetics.php
ok - tests/laminas/3.x/test_synthetics_disabled.php
xfail - tests/laminas/3.x/test_synthetics_with_cat_disabled.php
# 24 passed
# 0 skipped
# 0 failed
# 2 xfail

kneitinger
kneitinger previously approved these changes Nov 24, 2020
Copy link
Contributor

@kneitinger kneitinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks and functions nicely!

Transparency of approval: I committed to this PR, but only cosmetic ordering of values, and the feedback that @Fahmy-Mohammed left.

Fahmy-Mohammed
Fahmy-Mohammed previously approved these changes Nov 24, 2020
Copy link
Contributor

@Fahmy-Mohammed Fahmy-Mohammed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks for fixing this. I just have a couple of cosmetic suggestions that you're welcome to ignore.

Comment on lines 46 to 50
char * library_name = LIB_NAME_Z;
char * curl_adapter_typename = CURL_ADAPTER_Z;
char * uri_http_typename = URI_HTTP_Z;
char * http_client = HTTP_CLIENT_Z;
char * http_client_request = HTTP_CLIENT_REQUEST_Z;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

char * -> char*

agent/fw_hooks.h Outdated
@@ -27,6 +27,7 @@ extern void nr_drupal_enable(TSRMLS_D);
extern void nr_drupal8_enable(TSRMLS_D);
extern void nr_joomla_enable(TSRMLS_D);
extern void nr_kohana_enable(TSRMLS_D);
extern void nr_fw_laminas3_enable(TSRMLS_D);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we change the name here for consistency. nr_fw_laminas3_enable -> nr_laminas3_enable

@kneitinger kneitinger dismissed stale reviews from Fahmy-Mohammed and themself via c5b17d3 November 24, 2020 17:59
@kneitinger kneitinger merged commit 914fc76 into newrelic:main Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants