|
15 | 15 |
|
16 | 16 | #define PHP_PACKAGE_NAME "cakephp/cakephp"
|
17 | 17 |
|
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 |
| - |
134 | 18 | /*
|
135 | 19 | * For CakePHP 4.0 and on, we retrieve the current controller object
|
136 | 20 | * 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) {
|
241 | 125 | }
|
242 | 126 | NR_PHP_WRAPPER_END
|
243 | 127 |
|
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 |
| - |
270 | 128 | /*
|
271 | 129 | * CakePHP 4.0+
|
272 | 130 | *
|
@@ -308,16 +166,6 @@ NR_PHP_WRAPPER(nr_cakephp_error_handler_wrapper) {
|
308 | 166 | }
|
309 | 167 | NR_PHP_WRAPPER_END
|
310 | 168 |
|
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 |
| - |
321 | 169 | /*
|
322 | 170 | * Enable CakePHP 4.0+
|
323 | 171 | */
|
|
0 commit comments