Skip to content

Commit d0a6282

Browse files
committed
chore(agent): remove old code
1 parent fa779f5 commit d0a6282

File tree

2 files changed

+0
-158
lines changed

2 files changed

+0
-158
lines changed

agent/fw_cakephp.c

Lines changed: 0 additions & 152 deletions
Original file line numberDiff line numberDiff line change
@@ -15,122 +15,6 @@
1515

1616
#define PHP_PACKAGE_NAME "cakephp/cakephp"
1717

18-
nr_framework_classification_t nr_cakephp_special_1(
19-
const char* filename TSRMLS_DC) {
20-
NR_UNUSED_TSRMLS;
21-
22-
if (nr_strcaseidx(filename, "cake/libs/object.php") >= 0) {
23-
return FRAMEWORK_IS_SPECIAL;
24-
}
25-
26-
return FRAMEWORK_IS_NORMAL;
27-
}
28-
29-
nr_framework_classification_t nr_cakephp_special_2(
30-
const char* filename TSRMLS_DC) {
31-
NR_UNUSED_TSRMLS;
32-
33-
if (nr_strcaseidx(filename, "cake/core/app.php") >= 0) {
34-
return FRAMEWORK_IS_SPECIAL;
35-
}
36-
37-
return FRAMEWORK_IS_NORMAL;
38-
}
39-
40-
/*
41-
* For CakePHP 1.2 and 1.3 (and possibly earlier versions too) we hook into
42-
* Component::initialize(). This function takes a controller as a parameter
43-
* and we look into the params array of that controller object, and pick up
44-
* the controller and action out of that array.
45-
*
46-
* CakePHP 1.x is end-of-life and no longer supported by the agent.
47-
* Cake PHP 1.x does not support PHP 8+ and this wrapper is not updated for OAPI
48-
* compatibility.
49-
*
50-
*/
51-
NR_PHP_WRAPPER(nr_cakephp_name_the_wt_pre20) {
52-
zval* arg1 = 0;
53-
zval* params;
54-
zval* czval;
55-
zval* azval;
56-
char* controller = 0;
57-
char* action = 0;
58-
int clen = 0;
59-
int alen = 0;
60-
char* name;
61-
62-
(void)wraprec;
63-
NR_UNUSED_SPECIALFN;
64-
65-
NR_PHP_WRAPPER_REQUIRE_FRAMEWORK(NR_FW_CAKEPHP);
66-
67-
arg1 = nr_php_arg_get(1, NR_EXECUTE_ORIG_ARGS TSRMLS_CC);
68-
if (!nr_php_is_zval_valid_object(arg1)) {
69-
NR_PHP_WRAPPER_CALL;
70-
goto end;
71-
}
72-
73-
NR_PHP_WRAPPER_CALL;
74-
75-
params = nr_php_get_zval_object_property(arg1, "params" TSRMLS_CC);
76-
if (0 == params) {
77-
nrl_verbosedebug(NRL_FRAMEWORK, "CakePHP: no params found in component");
78-
goto end;
79-
}
80-
81-
if (IS_ARRAY != Z_TYPE_P(params)) {
82-
nrl_verbosedebug(NRL_FRAMEWORK,
83-
"CakePHP: component params is not an array");
84-
goto end;
85-
}
86-
87-
czval = nr_php_get_zval_object_property(params, "controller" TSRMLS_CC);
88-
if (0 == czval) {
89-
nrl_verbosedebug(NRL_FRAMEWORK,
90-
"CakePHP: no params['controller'] in component");
91-
} else {
92-
clen = Z_STRLEN_P(czval);
93-
controller = (char*)nr_alloca(clen + 1);
94-
nr_strxcpy(controller, Z_STRVAL_P(czval), clen);
95-
}
96-
97-
azval = nr_php_get_zval_object_property(params, "action" TSRMLS_CC);
98-
if (0 == azval) {
99-
nrl_verbosedebug(NRL_FRAMEWORK,
100-
"CakePHP: no params['action'] in component");
101-
} else {
102-
alen = Z_STRLEN_P(azval);
103-
action = (char*)nr_alloca(alen + 1);
104-
nr_strxcpy(action, Z_STRVAL_P(azval), alen);
105-
}
106-
107-
if ((0 == clen) && (0 == alen)) {
108-
nrl_verbosedebug(NRL_FRAMEWORK,
109-
"CakePHP: nothing to call the transaction (yet?)");
110-
goto end;
111-
}
112-
113-
name = (char*)nr_alloca(alen + clen + 2);
114-
if (clen) {
115-
nr_strcpy(name, controller);
116-
}
117-
if (alen) {
118-
if (clen) {
119-
nr_strcat(name, "/");
120-
nr_strcat(name, action);
121-
} else {
122-
nr_strcpy(name, action);
123-
}
124-
}
125-
126-
nr_txn_set_path("CakePHP", NRPRG(txn), name, NR_PATH_TYPE_ACTION,
127-
NR_NOT_OK_TO_OVERWRITE);
128-
129-
end:
130-
nr_php_arg_release(&arg1);
131-
}
132-
NR_PHP_WRAPPER_END
133-
13418
/*
13519
* For CakePHP 4.0 and on, we retrieve the current controller object
13620
* and are able to extract the controller name from that. We then
@@ -241,32 +125,6 @@ NR_PHP_WRAPPER(nr_cakephp_name_the_wt_4) {
241125
}
242126
NR_PHP_WRAPPER_END
243127

244-
/*
245-
* CakePHP 1.2, 1.3
246-
*
247-
* Dispatch::cakeError will be called if there is a problem during dispatch
248-
* (action or controller not found).
249-
*
250-
* CakePHP 1.x is end-of-life and no longer supported by the agent.
251-
* Cake PHP 1.x does not support PHP 8+ and this wrapper is not updated for OAPI
252-
* compatibility.
253-
*
254-
*/
255-
NR_PHP_WRAPPER(nr_cakephp_problem_1) {
256-
const char* name = "Dispatcher::cakeError";
257-
258-
(void)wraprec;
259-
NR_UNUSED_SPECIALFN;
260-
261-
NR_PHP_WRAPPER_REQUIRE_FRAMEWORK(NR_FW_CAKEPHP);
262-
263-
nr_txn_set_path("CakePHP", NRPRG(txn), name, NR_PATH_TYPE_ACTION,
264-
NR_NOT_OK_TO_OVERWRITE);
265-
266-
NR_PHP_WRAPPER_CALL;
267-
}
268-
NR_PHP_WRAPPER_END
269-
270128
/*
271129
* CakePHP 4.0+
272130
*
@@ -308,16 +166,6 @@ NR_PHP_WRAPPER(nr_cakephp_error_handler_wrapper) {
308166
}
309167
NR_PHP_WRAPPER_END
310168

311-
/*
312-
* Enable CakePHP 1.2, 1.3
313-
*/
314-
void nr_cakephp_enable_1(TSRMLS_D) {
315-
nr_php_wrap_user_function(NR_PSTR("Component::initialize"),
316-
nr_cakephp_name_the_wt_pre20 TSRMLS_CC);
317-
nr_php_wrap_user_function(NR_PSTR("Dispatcher::cakeError"),
318-
nr_cakephp_problem_1 TSRMLS_CC);
319-
}
320-
321169
/*
322170
* Enable CakePHP 4.0+
323171
*/

agent/fw_hooks.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,7 @@
1212
*/
1313
#include "php_execute.h"
1414

15-
extern void nr_cakephp_enable_1(TSRMLS_D);
1615
extern void nr_cakephp_enable(TSRMLS_D);
17-
extern nr_framework_classification_t nr_cakephp_special_1(
18-
const char* filename TSRMLS_DC);
19-
extern nr_framework_classification_t nr_cakephp_special_2(
20-
const char* filename TSRMLS_DC);
21-
2216
extern void nr_codeigniter_enable(TSRMLS_D);
2317

2418
extern int nr_drupal_is_framework(nrframework_t fw);

0 commit comments

Comments
 (0)