- sapi_post_entry entry = {NULL, 0, NULL, NULL};
-
- entry.post_reader = sapi_read_standard_form_data;
- entry.post_handler = php_json_post_handler;
-
- entry.content_type = "text/json";
- entry.content_type_len = sizeof("text/json")-1;
- sapi_register_post_entry(&entry TSRMLS_CC);
+ sapi_post_entry json_post_entries[] = {
+ { "text/json", sizeof("text/json")-1, sapi_read_standard_form_data, php_json_post_handler },
+ { "application/json", sizeof("application/json")-1, sapi_read_standard_form_data, php_json_post_handler },
+ { NULL, 0, NULL, NULL }
+ };
+
+#ifndef TSRMLS_CC
+# define TSRMLS_CC
+#endif
+ sapi_register_post_entries(json_post_entries TSRMLS_CC);