#define PHP_HTTP_EXT_VERSION "2.0.0dev10"
-extern zend_module_entry http_module_entry;
+zend_module_entry http_module_entry;
#define phpext_http_ptr &http_module_entry
-extern int http_module_number;
+int http_module_number;
#endif /* PHP_EXT_HTTP_H */
if (Z_STRLEN_P(zcn)
&& (class_entry = zend_fetch_class(Z_STRVAL_P(zcn), Z_STRLEN_P(zcn), 0 TSRMLS_CC))
- && (SUCCESS == php_http_new(&ov, class_entry, (php_http_new_t) php_http_message_object_new_ex, php_http_client_response_class_entry, msg, NULL TSRMLS_CC))) {
+ && (SUCCESS == php_http_new(&ov, class_entry, (php_http_new_t) php_http_message_object_new_ex, php_http_client_response_get_class_entry(), msg, NULL TSRMLS_CC))) {
return ov;
} else {
- return php_http_message_object_new_ex(php_http_client_response_class_entry, msg, NULL TSRMLS_CC);
+ return php_http_message_object_new_ex(php_http_client_response_get_class_entry(), msg, NULL TSRMLS_CC);
}
}
/* update the actual request message */
MAKE_STD_ZVAL(message);
- ZVAL_OBJVAL(message, php_http_message_object_new_ex(php_http_message_class_entry, php_http_message_copy_ex(msg, NULL, 0), NULL TSRMLS_CC), 0);
+ ZVAL_OBJVAL(message, php_http_message_object_new_ex(php_http_message_get_class_entry(), php_http_message_copy_ex(msg, NULL, 0), NULL TSRMLS_CC), 0);
zend_update_property(php_http_client_class_entry, zclient, ZEND_STRL("requestMessage"), message TSRMLS_CC);
zval_ptr_dtor(&message);
}
void php_http_client_options_get_subr(zval *this_ptr, char *key, size_t len, zval *return_value TSRMLS_DC)
{
zend_class_entry *this_ce = Z_OBJCE_P(getThis());
- zval **options, *opts = zend_read_property(php_http_client_class_entry, getThis(), ZEND_STRL("options"), 0 TSRMLS_CC);
+ zval **options, *opts = zend_read_property(this_ce, getThis(), ZEND_STRL("options"), 0 TSRMLS_CC);
if ((Z_TYPE_P(opts) == IS_ARRAY) && (SUCCESS == zend_symtable_find(Z_ARRVAL_P(opts), key, len, (void *) &options))) {
RETVAL_ZVAL(*options, 1, 0);
PHP_METHOD(HttpClient, __construct)
{
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
zval *os, *opts = NULL;
MAKE_STD_ZVAL(os);
PHP_METHOD(HttpClient, getObservers)
{
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
if (SUCCESS == zend_parse_parameters_none()) {
RETVAL_PROP(php_http_client_class_entry, "observers");
}
PHP_METHOD(HttpClient, getResponseMessage)
{
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
if (SUCCESS == zend_parse_parameters_none()) {
zval *message = zend_read_property(php_http_client_class_entry, getThis(), ZEND_STRL("responseMessage"), 0 TSRMLS_CC);
PHP_METHOD(HttpClient, getRequestMessage)
{
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
if (SUCCESS == zend_parse_parameters_none()) {
zval *message = zend_read_property(php_http_client_class_entry, getThis(), ZEND_STRL("requestMessage"), 0 TSRMLS_CC);
PHP_METHOD(HttpClient, getHistory)
{
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
if (SUCCESS == zend_parse_parameters_none()) {
zval *hist = zend_read_property(php_http_client_class_entry, getThis(), ZEND_STRL("history"), 0 TSRMLS_CC);
RETVAL_FALSE;
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O!", &zreq, php_http_client_request_get_class_entry())) {
if (SUCCESS == php_http_client_object_handle_request(getThis(), &zreq TSRMLS_CC)) {
php_http_client_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);
PHP_MINIT_FUNCTION(http_client)
{
- PHP_HTTP_REGISTER_CLASS(http\\Client, AbstractClient, http_client, php_http_object_class_entry, ZEND_ACC_ABSTRACT);
+ PHP_HTTP_REGISTER_CLASS(http\\Client, AbstractClient, http_client, php_http_object_get_class_entry(), ZEND_ACC_ABSTRACT);
php_http_client_class_entry->create_object = php_http_client_object_new;
memcpy(&php_http_client_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
php_http_client_object_handlers.clone_obj = php_http_client_object_clone;
- zend_class_implements(php_http_client_class_entry TSRMLS_CC, 2, spl_ce_SplSubject, php_http_client_interface_class_entry);
+ zend_class_implements(php_http_client_class_entry TSRMLS_CC, 2, spl_ce_SplSubject, php_http_client_interface_get_class_entry());
zend_declare_property_string(php_http_client_class_entry, ZEND_STRL("responseMessageClass"), "", ZEND_ACC_PRIVATE TSRMLS_CC);
zend_declare_property_null(php_http_client_class_entry, ZEND_STRL("observers"), ZEND_ACC_PRIVATE TSRMLS_CC);
PHP_MINIT_FUNCTION(http_client_datashare)
{
- PHP_HTTP_REGISTER_CLASS(http\\Client\\DataShare, AbstractDataShare, http_client_datashare, php_http_object_class_entry, 0);
+ PHP_HTTP_REGISTER_CLASS(http\\Client\\DataShare, AbstractDataShare, http_client_datashare, php_http_object_get_class_entry(), 0);
php_http_client_datashare_class_entry->create_object = php_http_client_datashare_object_new;
memcpy(&php_http_client_datashare_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
php_http_client_datashare_object_handlers.clone_obj = NULL;
return FAILURE;
}
-static zend_class_entry *php_http_client_factory_get_class_entry(zval *this_ptr, const char *for_str, size_t for_len TSRMLS_DC)
+static zend_class_entry *php_http_client_factory_find_class_entry(zval *this_ptr, const char *for_str, size_t for_len TSRMLS_DC)
{
/* stupid non-const api */
char *sc = estrndup(for_str, for_len);
PHP_HTTP_EMPTY_ARGS(getDriver);
PHP_HTTP_EMPTY_ARGS(getAvailableDrivers);
-zend_class_entry *php_http_client_factory_class_entry;
-zend_function_entry php_http_client_factory_method_entry[] = {
+static zend_class_entry *php_http_client_factory_class_entry;
+
+zend_class_entry *php_http_client_factory_get_class_entry(void)
+{
+ return php_http_client_factory_class_entry;
+}
+
+static zend_function_entry php_http_client_factory_method_entry[] = {
PHP_HTTP_REQUEST_FACTORY_ME(__construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
PHP_HTTP_REQUEST_FACTORY_ME(createClient, ZEND_ACC_PUBLIC)
PHP_HTTP_REQUEST_FACTORY_ME(createPool, ZEND_ACC_PUBLIC)
PHP_METHOD(HttpClientFactory, __construct)
{
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
HashTable *options = NULL;
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|h", &options)) {
{
zval *options = NULL;
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|a!", &options)) {
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
zval *zdriver;
zend_object_value ov;
zend_class_entry *class_entry = NULL;
req = php_http_client_init(NULL, driver.client_ops, rf, NULL TSRMLS_CC);
if (req) {
- if (!(class_entry = php_http_client_factory_get_class_entry(getThis(), ZEND_STRL("clientClass") TSRMLS_CC))) {
+ if (!(class_entry = php_http_client_factory_find_class_entry(getThis(), ZEND_STRL("clientClass") TSRMLS_CC))) {
class_entry = driver.client_ops->class_entry();
}
int argc = 0;
zval ***argv;
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|*", &argv, &argc)) {
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
int i;
zval *zdriver;
zend_object_value ov;
pool = php_http_client_pool_init(NULL, driver.client_pool_ops, rf, NULL TSRMLS_CC);
if (pool) {
- if (!(class_entry = php_http_client_factory_get_class_entry(getThis(), ZEND_STRL("clientPoolClass") TSRMLS_CC))) {
+ if (!(class_entry = php_http_client_factory_find_class_entry(getThis(), ZEND_STRL("clientPoolClass") TSRMLS_CC))) {
class_entry = driver.client_pool_ops->class_entry();
}
int argc = 0;
zval ***argv;
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|*", &argv, &argc)) {
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
int i;
zval *zdriver;
zend_object_value ov;
share = php_http_client_datashare_init(NULL, driver.client_datashare_ops, rf, NULL TSRMLS_CC);
if (share) {
- if (!(class_entry = php_http_client_factory_get_class_entry(getThis(), ZEND_STRL("clientDataShareClass") TSRMLS_CC))) {
+ if (!(class_entry = php_http_client_factory_find_class_entry(getThis(), ZEND_STRL("clientDataShareClass") TSRMLS_CC))) {
class_entry = driver.client_datashare_ops->class_entry();
}
{
zend_hash_init(&php_http_client_factory_drivers, 0, NULL, NULL, 1);
- PHP_HTTP_REGISTER_CLASS(http\\Client, Factory, http_client_factory, php_http_object_class_entry, 0);
+ PHP_HTTP_REGISTER_CLASS(http\\Client, Factory, http_client_factory, php_http_object_get_class_entry(), 0);
php_http_client_factory_class_entry->create_object = php_http_client_factory_new;
zend_declare_property_stringl(php_http_client_factory_class_entry, ZEND_STRL("driver"), ZEND_STRL("curl"), ZEND_ACC_PROTECTED TSRMLS_CC);
PHP_HTTP_API STATUS php_http_client_factory_add_driver(const char *name_str, size_t name_len, php_http_client_factory_driver_t *driver);
PHP_HTTP_API STATUS php_http_client_factory_get_driver(const char *name_str, size_t name_len, php_http_client_factory_driver_t *driver);
-extern zend_class_entry *php_http_client_factory_class_entry;
-extern zend_function_entry php_http_client_factory_method_entry[];
+zend_class_entry *php_http_client_factory_get_class_entry(void);
#define php_http_client_factory_new php_http_object_new
#define PHP_HTTP_BEGIN_ARGS(method, req_args) PHP_HTTP_BEGIN_ARGS_EX(HttpClient, method, 0, req_args)
#define PHP_HTTP_EMPTY_ARGS(method) PHP_HTTP_EMPTY_ARGS_EX(HttpClient, method, 0)
-#define PHP_HTTP_CLIENT_ME(method, visibility) PHP_ME(HttpClient, method, PHP_HTTP_ARGS(HttpClient, method), visibility)
+#define PHP_HTTP_CLIENT_ME(method) PHP_ABSTRACT_ME(HttpClient, method, PHP_HTTP_ARGS(HttpClient, method))
PHP_HTTP_BEGIN_ARGS(send, 1)
PHP_HTTP_ARG_VAL(request, 0)
PHP_HTTP_END_ARGS;
-zend_class_entry *php_http_client_interface_class_entry;
+static zend_class_entry *php_http_client_interface_class_entry;
+
+zend_class_entry *php_http_client_interface_get_class_entry(void)
+{
+ return php_http_client_interface_class_entry;
+}
zend_function_entry php_http_client_interface_method_entry[] = {
- PHP_HTTP_CLIENT_ME(send, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
+ PHP_HTTP_CLIENT_ME(send)
{NULL, NULL, NULL}
};
+--------------------------------------------------------------------+
*/
-#ifndef PHP_HTTP_CLIENT_H
+#ifndef PHP_HTTP_CLIENT_INTERFACE_H
-extern zend_class_entry *php_http_client_interface_class_entry;
-extern zend_function_entry php_http_client_interface_method_entry[];
+zend_class_entry *php_http_client_interface_get_class_entry(void);
PHP_MINIT_FUNCTION(http_client_interface);
PHP_METHOD(HttpClientPool, attach)
{
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
zval *request;
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &request, php_http_client_get_class_entry())) {
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
php_http_client_pool_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);
if (obj->iterator.pos > 0 && obj->iterator.pos < zend_llist_count(&obj->pool->clients.attached)) {
{
RETVAL_FALSE;
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
zval *request;
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &request, php_http_client_get_class_entry())) {
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
php_http_client_pool_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);
obj->iterator.pos = -1;
{
RETVAL_FALSE;
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
if (SUCCESS == zend_parse_parameters_none()) {
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
php_http_client_pool_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);
php_http_client_pool_exec(obj->pool);
PHP_MINIT_FUNCTION(http_client_pool)
{
- PHP_HTTP_REGISTER_CLASS(http\\Client\\Pool, AbstractPool, http_client_pool, php_http_object_class_entry, 0);
+ PHP_HTTP_REGISTER_CLASS(http\\Client\\Pool, AbstractPool, http_client_pool, php_http_object_get_class_entry(), 0);
php_http_client_pool_class_entry->create_object = php_http_client_pool_object_new;
memcpy(&php_http_client_pool_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
php_http_client_pool_object_handlers.clone_obj = NULL;
int meth_len = 0, url_len = 0;
zval *zheaders = NULL, *zbody = NULL;
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
- if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!s!a!O!", &meth_str, &meth_len, &url_str, &url_len, &zheaders, &zbody, php_http_message_body_class_entry)) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
+ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!s!a!O!", &meth_str, &meth_len, &url_str, &url_len, &zheaders, &zbody, php_http_message_body_get_class_entry())) {
php_http_message_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);
if (obj->message) {
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &qdata)) {
php_http_message_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);
php_url *old_url = NULL, new_url = {NULL};
- char empty[] = "";
zval arr, str;
PHP_MINIT_FUNCTION(http_client_request)
{
- PHP_HTTP_REGISTER_CLASS(http\\Client, Request, http_client_request, php_http_message_class_entry, 0);
+ PHP_HTTP_REGISTER_CLASS(http\\Client, Request, http_client_request, php_http_message_get_class_entry(), 0);
zend_declare_property_null(php_http_client_request_class_entry, ZEND_STRL("options"), ZEND_ACC_PROTECTED TSRMLS_CC);
zval *cookie;
MAKE_STD_ZVAL(cookie);
- ZVAL_OBJVAL(cookie, php_http_cookie_object_new_ex(php_http_cookie_class_entry, list, NULL TSRMLS_CC), 0);
+ ZVAL_OBJVAL(cookie, php_http_cookie_object_new_ex(php_http_cookie_get_class_entry(), list, NULL TSRMLS_CC), 0);
add_next_index_zval(return_value, cookie);
}
zval_ptr_dtor(&data);
zval *cookie;
MAKE_STD_ZVAL(cookie);
- ZVAL_OBJVAL(cookie, php_http_cookie_object_new_ex(php_http_cookie_class_entry, list, NULL TSRMLS_CC), 0);
+ ZVAL_OBJVAL(cookie, php_http_cookie_object_new_ex(php_http_cookie_get_class_entry(), list, NULL TSRMLS_CC), 0);
add_next_index_zval(return_value, cookie);
}
zval_ptr_dtor(&data);
}
-zend_class_entry *php_http_client_response_class_entry;
-zend_function_entry php_http_client_response_method_entry[] = {
+static zend_class_entry *php_http_client_response_class_entry;
+
+zend_class_entry *php_http_client_response_get_class_entry(void)
+{
+ return php_http_client_response_class_entry;
+}
+
+static zend_function_entry php_http_client_response_method_entry[] = {
PHP_HTTP_CLIENT_RESPONSE_ME(getCookies, ZEND_ACC_PUBLIC)
EMPTY_FUNCTION_ENTRY
};
PHP_MINIT_FUNCTION(http_client_response)
{
- PHP_HTTP_REGISTER_CLASS(http\\Client, Response, http_client_response, php_http_message_class_entry, 0);
+ PHP_HTTP_REGISTER_CLASS(http\\Client, Response, http_client_response, php_http_message_get_class_entry(), 0);
return SUCCESS;
}
#ifndef PHP_HTTP_CLIENT_RESPONSE_H
#define PHP_HTTP_CLIENT_RESPONSE_H
-extern zend_class_entry *php_http_client_response_class_entry;
-extern zend_function_entry php_http_client_response_method_entry[];
+zend_class_entry *php_http_client_response_get_class_entry(void);
PHP_METHOD(HttpClientResponse, getCookies);
PHP_HTTP_ARG_VAL(name, 0)
PHP_HTTP_END_ARGS;
-zend_class_entry *php_http_cookie_class_entry;
-zend_function_entry php_http_cookie_method_entry[] = {
+static zend_class_entry *php_http_cookie_class_entry;
+
+zend_class_entry *php_http_cookie_get_class_entry(void)
+{
+ return php_http_cookie_class_entry;
+}
+
+static zend_function_entry php_http_cookie_method_entry[] = {
PHP_HTTP_COOKIE_ME(__construct, ZEND_ACC_PUBLIC)
PHP_HTTP_COOKIE_ME(getCookies, ZEND_ACC_PUBLIC)
PHP_HTTP_COOKIE_ME(setCookies, ZEND_ACC_PUBLIC)
PHP_METHOD(HttpCookie, __construct)
{
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
zval *zcookie = NULL;
long flags = 0;
HashTable *allowed_extras = NULL;
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z!lH", &zcookie, &flags, &allowed_extras)) {
if (zcookie) {
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
char **ae = NULL;
php_http_cookie_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);
PHP_MINIT_FUNCTION(http_cookie)
{
- PHP_HTTP_REGISTER_CLASS(http, Cookie, http_cookie, php_http_object_class_entry, 0);
+ PHP_HTTP_REGISTER_CLASS(http, Cookie, http_cookie, php_http_object_get_class_entry(), 0);
php_http_cookie_class_entry->create_object = php_http_cookie_object_new;
memcpy(&php_http_cookie_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
php_http_cookie_object_handlers.clone_obj = php_http_cookie_object_clone;
PHP_HTTP_API void php_http_cookie_list_to_struct(php_http_cookie_list_t *list, zval *strct);
-extern zend_class_entry *php_http_cookie_class_entry;
-extern zend_function_entry php_http_cookie_method_entry[];
+zend_class_entry *php_http_cookie_get_class_entry(void);
typedef struct php_http_cookie_object {
zend_object o;
#include <curl/curl.h>
#define PHP_HTTP_CURL_VERSION(x, y, z) (LIBCURL_VERSION_NUM >= (((x)<<16) + ((y)<<8) + (z)))
-extern PHP_MINIT_FUNCTION(http_curl);
-extern PHP_MSHUTDOWN_FUNCTION(http_curl);
+PHP_MINIT_FUNCTION(http_curl);
+PHP_MSHUTDOWN_FUNCTION(http_curl);
#endif /* PHP_HTTP_HAVE_CURL */
return SUCCESS;
}
-STATUS php_http_curl_client_prepare(php_http_client_t *h, php_http_message_t *msg)
+PHP_HTTP_API STATUS php_http_curl_client_prepare(php_http_client_t *h, php_http_message_t *msg)
{
size_t body_size;
php_http_curl_client_t *curl = h->ctx;
php_http_curl_dtor
};
-static zend_class_entry *get_class_entry(void)
-{
- return php_http_curl_client_class_entry;
-}
-
static php_http_client_ops_t php_http_curl_client_ops = {
&php_http_curl_client_resource_factory_ops,
php_http_curl_client_init,
php_http_curl_client_setopt,
php_http_curl_client_getopt,
(php_http_new_t) php_http_curl_client_object_new_ex,
- get_class_entry
+ php_http_curl_client_get_class_entry
};
PHP_HTTP_API php_http_client_ops_t *php_http_curl_client_get_ops(void)
PHP_HTTP_ARG_VAL(request, 0)
PHP_HTTP_END_ARGS;
-zend_class_entry *php_http_curl_client_class_entry;
-zend_function_entry php_http_curl_client_method_entry[] = {
+static zend_class_entry *php_http_curl_client_class_entry;
+
+zend_class_entry *php_http_curl_client_get_class_entry(void)
+{
+ return php_http_curl_client_class_entry;
+}
+
+static zend_function_entry php_http_curl_client_method_entry[] = {
PHP_HTTP_CURL_CLIENT_CLIENT_MALIAS(send, ZEND_ACC_PUBLIC)
EMPTY_FUNCTION_ENTRY
};
return st;
}
-extern STATUS php_http_curl_client_prepare(php_http_client_t *h, php_http_message_t *msg);
+PHP_HTTP_API STATUS php_http_curl_client_prepare(php_http_client_t *h, php_http_message_t *msg);
-extern zend_class_entry *php_http_curl_client_class_entry;
-extern zend_function_entry php_http_curl_client_method_entry[];
+zend_class_entry *php_http_curl_client_get_class_entry(void);
-extern zend_object_value php_http_curl_client_object_new(zend_class_entry *ce TSRMLS_DC);
-extern zend_object_value php_http_curl_client_object_new_ex(zend_class_entry *ce, php_http_client_t *r, php_http_client_object_t **ptr TSRMLS_DC);
+zend_object_value php_http_curl_client_object_new(zend_class_entry *ce TSRMLS_DC);
+zend_object_value php_http_curl_client_object_new_ex(zend_class_entry *ce, php_http_client_t *r, php_http_client_object_t **ptr TSRMLS_DC);
PHP_MINIT_FUNCTION(http_curl_client);
php_http_curlsh_dtor
};
-static zend_class_entry *get_class_entry(void)
-{
- return php_http_curl_client_datashare_class_entry;
-}
-
static php_http_client_datashare_ops_t php_http_curl_client_datashare_ops = {
&php_http_curlsh_resource_factory_ops,
php_http_curl_client_datashare_init,
php_http_curl_client_datashare_detach,
php_http_curl_client_datashare_setopt,
(php_http_new_t) php_http_curl_client_datashare_object_new_ex,
- get_class_entry
+ php_http_curl_client_datashare_get_class_entry
};
PHP_HTTP_API php_http_client_datashare_ops_t *php_http_curl_client_datashare_get_ops(void)
#define PHP_HTTP_EMPTY_ARGS(method) PHP_HTTP_EMPTY_ARGS_EX(HttpClientDataShare, method, 0)
#define PHP_HTTP_RSHARE_ME(method, visibility) PHP_ME(HttpClientDataShare, method, PHP_HTTP_ARGS(HttpClientDataShare, method), visibility)
-zend_class_entry *php_http_curl_client_datashare_class_entry;
-zend_function_entry php_http_curl_client_datashare_method_entry[] = {
+static zend_class_entry *php_http_curl_client_datashare_class_entry;
+
+zend_class_entry *php_http_curl_client_datashare_get_class_entry(void)
+{
+ return php_http_curl_client_datashare_class_entry;
+}
+
+static zend_function_entry php_http_curl_client_datashare_method_entry[] = {
EMPTY_FUNCTION_ENTRY
};
PHP_HTTP_API php_http_client_datashare_ops_t *php_http_curl_client_datashare_get_ops(void);
-extern zend_class_entry *php_http_curl_client_datashare_class_entry;
-extern zend_function_entry php_http_curl_client_datashare_method_entry[];
+zend_class_entry *php_http_curl_client_datashare_get_class_entry(void);
-extern zend_object_value php_http_curl_client_datashare_object_new(zend_class_entry *ce TSRMLS_DC);
-extern zend_object_value php_http_curl_client_datashare_object_new_ex(zend_class_entry *ce, php_http_client_datashare_t *share, php_http_client_datashare_object_t **ptr TSRMLS_DC);
+zend_object_value php_http_curl_client_datashare_object_new(zend_class_entry *ce TSRMLS_DC);
+zend_object_value php_http_curl_client_datashare_object_new_ex(zend_class_entry *ce, php_http_client_datashare_t *share, php_http_client_datashare_object_t **ptr TSRMLS_DC);
PHP_MINIT_FUNCTION(http_curl_client_datashare);
php_http_curlm_dtor
};
-static zend_class_entry *get_class_entry(void)
-{
- return php_http_curl_client_pool_class_entry;
-}
-
static php_http_client_pool_ops_t php_http_curl_client_pool_ops = {
&php_http_curlm_resource_factory_ops,
php_http_curl_client_pool_init,
php_http_curl_client_pool_detach,
php_http_curl_client_pool_setopt,
(php_http_new_t) php_http_curl_client_pool_object_new_ex,
- get_class_entry
+ php_http_curl_client_pool_get_class_entry
};
PHP_HTTP_API php_http_client_pool_ops_t *php_http_curl_client_pool_get_ops(void)
#define PHP_HTTP_CURL_ALIAS(method, func) PHP_HTTP_STATIC_ME_ALIAS(method, func, PHP_HTTP_ARGS(HttpClientCURL, method))
#define PHP_HTTP_CURL_MALIAS(me, al, vis) ZEND_FENTRY(me, ZEND_MN(HttpClientCURL_##al), PHP_HTTP_ARGS(HttpClientCURL, al), vis)
-zend_class_entry *php_http_curl_client_pool_class_entry;
-zend_function_entry php_http_curl_client_pool_method_entry[] = {
+static zend_class_entry *php_http_curl_client_pool_class_entry;
+
+zend_class_entry *php_http_curl_client_pool_get_class_entry(void)
+{
+ return php_http_curl_client_pool_class_entry;
+}
+
+static zend_function_entry php_http_curl_client_pool_method_entry[] = {
EMPTY_FUNCTION_ENTRY
};
PHP_HTTP_API php_http_client_pool_ops_t *php_http_curl_client_pool_get_ops(void);
-extern zend_class_entry *php_http_curl_client_pool_class_entry;
-extern zend_function_entry php_http_curl_client_pool_method_entry[];
+zend_class_entry *php_http_curl_client_pool_get_class_entry(void);
-extern zend_object_value php_http_curl_client_pool_object_new(zend_class_entry *ce TSRMLS_DC);
-extern zend_object_value php_http_curl_client_pool_object_new_ex(zend_class_entry *ce, php_http_client_pool_t *p, php_http_client_pool_object_t **ptr TSRMLS_DC);
+zend_object_value php_http_curl_client_pool_object_new(zend_class_entry *ce TSRMLS_DC);
+zend_object_value php_http_curl_client_pool_object_new_ex(zend_class_entry *ce, php_http_client_pool_t *p, php_http_client_pool_object_t **ptr TSRMLS_DC);
#if PHP_HTTP_HAVE_EVENT
struct php_http_curl_globals {
PHP_HTTP_EMPTY_ARGS(done);
PHP_HTTP_EMPTY_ARGS(finish);
-zend_class_entry *php_http_encoding_stream_class_entry;
-zend_function_entry php_http_encoding_stream_method_entry[] = {
+static zend_class_entry *php_http_encoding_stream_class_entry;
+
+zend_class_entry *php_http_encoding_stream_get_class_entry(void)
+{
+ return php_http_encoding_stream_class_entry;
+}
+
+static zend_function_entry php_http_encoding_stream_method_entry[] = {
PHP_HTTP_ENCSTREAM_ME(__construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
PHP_HTTP_ENCSTREAM_ME(update, ZEND_ACC_PUBLIC)
PHP_HTTP_ENCSTREAM_ME(flush, ZEND_ACC_PUBLIC)
PHP_METHOD(HttpEncodingStream, __construct)
{
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
long flags = 0;
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flags)) {
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
php_http_encoding_stream_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);
if (!obj->stream) {
php_http_encoding_stream_ops_t *ops = NULL;
- if (instanceof_function(obj->zo.ce, php_http_deflate_stream_class_entry TSRMLS_CC)) {
+ if (instanceof_function(obj->zo.ce, php_http_deflate_stream_get_class_entry() TSRMLS_CC)) {
ops = &php_http_encoding_deflate_ops;
- } else if (instanceof_function(obj->zo.ce, php_http_inflate_stream_class_entry TSRMLS_CC)) {
+ } else if (instanceof_function(obj->zo.ce, php_http_inflate_stream_get_class_entry() TSRMLS_CC)) {
ops = &php_http_encoding_inflate_ops;
- } else if (instanceof_function(obj->zo.ce, php_http_dechunk_stream_class_entry TSRMLS_CC)) {
+ } else if (instanceof_function(obj->zo.ce, php_http_dechunk_stream_get_class_entry() TSRMLS_CC)) {
ops = &php_http_encoding_dechunk_ops;
}
PHP_HTTP_ARG_VAL(flags, 0)
PHP_HTTP_END_ARGS;
-zend_class_entry *php_http_deflate_stream_class_entry;
-zend_function_entry php_http_deflate_stream_method_entry[] = {
+static zend_class_entry *php_http_deflate_stream_class_entry;
+
+zend_class_entry *php_http_deflate_stream_get_class_entry(void)
+{
+ return php_http_deflate_stream_class_entry;
+}
+
+static zend_function_entry php_http_deflate_stream_method_entry[] = {
PHP_HTTP_DEFLATE_ME(encode, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
EMPTY_FUNCTION_ENTRY
PHP_HTTP_ARG_VAL(data, 0)
PHP_HTTP_END_ARGS;
-zend_class_entry *php_http_inflate_stream_class_entry;
-zend_function_entry php_http_inflate_stream_method_entry[] = {
+static zend_class_entry *php_http_inflate_stream_class_entry;
+
+zend_class_entry *php_http_inflate_stream_get_class_entry(void)
+{
+ return php_http_inflate_stream_class_entry;
+}
+
+static zend_function_entry php_http_inflate_stream_method_entry[] = {
PHP_HTTP_INFLATE_ME(decode, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
EMPTY_FUNCTION_ENTRY
PHP_HTTP_ARG_VAL(decoded_len, 1)
PHP_HTTP_END_ARGS;
-zend_class_entry *php_http_dechunk_stream_class_entry;
-zend_function_entry php_http_dechunk_stream_method_entry[] = {
+static zend_class_entry *php_http_dechunk_stream_class_entry;
+
+zend_class_entry *php_http_dechunk_stream_get_class_entry(void)
+{
+ return php_http_dechunk_stream_class_entry;
+}
+
+static zend_function_entry php_http_dechunk_stream_method_entry[] = {
PHP_HTTP_DECHUNK_ME(decode, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
EMPTY_FUNCTION_ENTRY
PHP_MINIT_FUNCTION(http_encoding)
{
- PHP_HTTP_REGISTER_CLASS(http\\Encoding, Stream, http_encoding_stream, php_http_object_class_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
+ PHP_HTTP_REGISTER_CLASS(http\\Encoding, Stream, http_encoding_stream, php_http_object_get_class_entry(), ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
php_http_encoding_stream_class_entry->create_object = php_http_encoding_stream_object_new;
memcpy(&php_http_encoding_stream_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
php_http_encoding_stream_object_handlers.clone_obj = php_http_encoding_stream_object_clone;
#endif
};
-extern php_http_encoding_stream_ops_t *php_http_encoding_stream_get_deflate_ops(void);
-extern php_http_encoding_stream_ops_t *php_http_encoding_stream_get_inflate_ops(void);
-extern php_http_encoding_stream_ops_t *php_http_encoding_stream_get_dechunk_ops(void);
+PHP_HTTP_API php_http_encoding_stream_ops_t *php_http_encoding_stream_get_deflate_ops(void);
+PHP_HTTP_API php_http_encoding_stream_ops_t *php_http_encoding_stream_get_inflate_ops(void);
+PHP_HTTP_API php_http_encoding_stream_ops_t *php_http_encoding_stream_get_dechunk_ops(void);
PHP_HTTP_API php_http_encoding_stream_t *php_http_encoding_stream_init(php_http_encoding_stream_t *s, php_http_encoding_stream_ops_t *ops, unsigned flags TSRMLS_DC);
PHP_HTTP_API php_http_encoding_stream_t *php_http_encoding_stream_copy(php_http_encoding_stream_t *from, php_http_encoding_stream_t *to);
php_http_encoding_stream_t *stream;
} php_http_encoding_stream_object_t;
-extern zend_class_entry *php_http_encoding_stream_class_entry;
-extern zend_function_entry php_http_encoding_stream_method_entry[];
+zend_class_entry *php_http_encoding_stream_get_class_entry(void);
-extern zend_object_value php_http_encoding_stream_object_new(zend_class_entry *ce TSRMLS_DC);
-extern zend_object_value php_http_encoding_stream_object_new_ex(zend_class_entry *ce, php_http_encoding_stream_t *s, php_http_encoding_stream_object_t **ptr TSRMLS_DC);
-extern zend_object_value php_http_encoding_stream_object_clone(zval *object TSRMLS_DC);
-extern void php_http_encoding_stream_object_free(void *object TSRMLS_DC);
+zend_object_value php_http_encoding_stream_object_new(zend_class_entry *ce TSRMLS_DC);
+zend_object_value php_http_encoding_stream_object_new_ex(zend_class_entry *ce, php_http_encoding_stream_t *s, php_http_encoding_stream_object_t **ptr TSRMLS_DC);
+zend_object_value php_http_encoding_stream_object_clone(zval *object TSRMLS_DC);
+void php_http_encoding_stream_object_free(void *object TSRMLS_DC);
-extern zend_class_entry *php_http_deflate_stream_class_entry;
-extern zend_function_entry php_http_deflate_stream_method_entry[];
-extern zend_class_entry *php_http_inflate_stream_class_entry;
-extern zend_function_entry php_http_inflate_stream_method_entry[];
-extern zend_class_entry *php_http_dechunk_stream_class_entry;
-extern zend_function_entry php_http_dechunk_stream_method_entry[];
+zend_class_entry *php_http_deflate_stream_get_class_entry(void);
+zend_class_entry *php_http_inflate_stream_get_class_entry(void);
+zend_class_entry *php_http_dechunk_stream_get_class_entry(void);
PHP_METHOD(HttpEncodingStream, __construct);
PHP_METHOD(HttpEncodingStream, update);
return php_http_strlist_find(php_http_env_response_status, 100, code);
}
-zend_class_entry *php_http_env_class_entry;
#define PHP_HTTP_BEGIN_ARGS(method, req_args) PHP_HTTP_BEGIN_ARGS_EX(HttpEnv, method, 0, req_args)
#define PHP_HTTP_EMPTY_ARGS(method) PHP_HTTP_EMPTY_ARGS_EX(HttpEnv, method, 0)
PHP_HTTP_ARG_VAL(ident, 0)
PHP_HTTP_END_ARGS;
-zend_function_entry php_http_env_method_entry[] = {
+static zend_class_entry *php_http_env_class_entry;
+
+zend_class_entry *php_http_env_get_class_entry(void)
+{
+ return php_http_env_class_entry;
+}
+
+static zend_function_entry php_http_env_method_entry[] = {
PHP_HTTP_ENV_ME(getRequestHeader)
PHP_HTTP_ENV_ME(getRequestBody)
PHP_METHOD(HttpEnv, getRequestBody)
{
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
- zend_class_entry *class_entry = php_http_message_body_class_entry;
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
+ zend_class_entry *class_entry = php_http_message_body_get_class_entry();
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|C", &class_entry)) {
zend_object_value ov;
php_http_message_body_t *body = php_http_env_get_request_body(TSRMLS_C);
- if (SUCCESS == php_http_new(&ov, class_entry, (php_http_new_t) php_http_message_body_object_new_ex, php_http_message_body_class_entry, php_http_message_body_copy(body, NULL, 0), NULL TSRMLS_CC)) {
+ if (SUCCESS == php_http_new(&ov, class_entry, (php_http_new_t) php_http_message_body_object_new_ex, php_http_message_body_get_class_entry(), php_http_message_body_copy(body, NULL, 0), NULL TSRMLS_CC)) {
RETVAL_OBJVAL(ov, 0);
}
}
#define php_http_env_got_server_var(v) (NULL != php_http_env_get_server_var((v), strlen(v), 1 TSRMLS_CC))
PHP_HTTP_API zval *php_http_env_get_superglobal(const char *key, size_t key_len TSRMLS_DC);
-extern zend_class_entry *php_http_env_class_entry;
-extern zend_function_entry php_http_env_method_entry[];
+zend_class_entry *php_http_env_get_class_entry(void);
PHP_METHOD(HttpEnv, getRequestHeader);
PHP_METHOD(HttpEnv, getRequestBody);
#include "php_http_api.h"
-zend_class_entry *php_http_env_request_class_entry;
-
#undef PHP_HTTP_BEGIN_ARGS
#undef PHP_HTTP_EMPTY_ARGS
#define PHP_HTTP_BEGIN_ARGS(method, req_args) PHP_HTTP_BEGIN_ARGS_EX(HttpEnvRequest, method, 0, req_args)
PHP_HTTP_EMPTY_ARGS(getQuery);
PHP_HTTP_EMPTY_ARGS(getFiles);
+static zend_class_entry *php_http_env_request_class_entry;
+
+zend_class_entry *php_http_env_request_get_class_entry(void)
+{
+ return php_http_env_request_class_entry;
+}
+
zend_function_entry php_http_env_request_method_entry[] = {
PHP_HTTP_ENV_REQUEST_ME(__construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
PHP_HTTP_ENV_REQUEST_ME(getForm, ZEND_ACC_PUBLIC)
PHP_METHOD(HttpEnvRequest, __construct)
{
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
if (SUCCESS == zend_parse_parameters_none()) {
php_http_message_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);
zval *zsg;
zval *zquery;
MAKE_STD_ZVAL(zquery);
- object_init_ex(zquery, php_http_querystring_class_entry);
+ object_init_ex(zquery, php_http_querystring_get_class_entry());
if (SUCCESS == php_http_querystring_ctor(zquery, zsg TSRMLS_CC)) {
zend_update_property(php_http_env_request_class_entry, getThis(), ZEND_STRL("query"), zquery TSRMLS_CC);
}
zval *zpost;
MAKE_STD_ZVAL(zpost);
- object_init_ex(zpost, php_http_querystring_class_entry);
+ object_init_ex(zpost, php_http_querystring_get_class_entry());
if (SUCCESS == php_http_querystring_ctor(zpost, zsg TSRMLS_CC)) {
zend_update_property(php_http_env_request_class_entry, getThis(), ZEND_STRL("form"), zpost TSRMLS_CC);
}
PHP_MINIT_FUNCTION(http_env_request)
{
- PHP_HTTP_REGISTER_CLASS(http\\Env, Request, http_env_request, php_http_message_class_entry, 0);
+ PHP_HTTP_REGISTER_CLASS(http\\Env, Request, http_env_request, php_http_message_get_class_entry(), 0);
zend_declare_property_null(php_http_env_request_class_entry, ZEND_STRL("query"), ZEND_ACC_PROTECTED TSRMLS_CC);
zend_declare_property_null(php_http_env_request_class_entry, ZEND_STRL("form"), ZEND_ACC_PROTECTED TSRMLS_CC);
zend_declare_property_null(php_http_env_request_class_entry, ZEND_STRL("files"), ZEND_ACC_PROTECTED TSRMLS_CC);
#ifndef PHP_HTTP_ENV_REQUEST_H
#define PHP_HTTP_ENV_REQUEST_H
-extern zend_class_entry *php_http_env_request_class_entry;
-extern zend_function_entry php_http_env_request_method_entry[];
+zend_class_entry *php_http_env_request_get_class_entry(void);
PHP_METHOD(HttpEnvRequest, __construct);
PHP_METHOD(HttpEnvRequest, getForm);
if ( !(zbody = get_option(options, ZEND_STRL("body") TSRMLS_CC))
|| !(Z_TYPE_P(zbody) == IS_OBJECT)
- || !instanceof_function(Z_OBJCE_P(zbody), php_http_message_body_class_entry TSRMLS_CC)
+ || !instanceof_function(Z_OBJCE_P(zbody), php_http_message_body_get_class_entry() TSRMLS_CC)
) {
if (zbody) {
zval_ptr_dtor(&zbody);
if ( !(zbody = get_option(options, ZEND_STRL("body") TSRMLS_CC))
|| !(Z_TYPE_P(zbody) == IS_OBJECT)
- || !instanceof_function(Z_OBJCE_P(zbody), php_http_message_body_class_entry TSRMLS_CC)
+ || !instanceof_function(Z_OBJCE_P(zbody), php_http_message_body_get_class_entry() TSRMLS_CC)
) {
if (zbody) {
zval_ptr_dtor(&zbody);
if ( (zbody = get_option(r->options, ZEND_STRL("body") TSRMLS_CC))
&& (Z_TYPE_P(zbody) == IS_OBJECT)
- && instanceof_function(Z_OBJCE_P(zbody), php_http_message_body_class_entry TSRMLS_CC)
+ && instanceof_function(Z_OBJCE_P(zbody), php_http_message_body_get_class_entry() TSRMLS_CC)
) {
php_http_message_body_object_t *obj = zend_object_store_get_object(zbody TSRMLS_CC);
/* check for ranges */
if ( (zbody = get_option(r->options, ZEND_STRL("body") TSRMLS_CC))
&& (Z_TYPE_P(zbody) == IS_OBJECT)
- && instanceof_function(Z_OBJCE_P(zbody), php_http_message_body_class_entry TSRMLS_CC)
+ && instanceof_function(Z_OBJCE_P(zbody), php_http_message_body_get_class_entry() TSRMLS_CC)
) {
php_http_message_body_object_t *obj = zend_object_store_get_object(zbody TSRMLS_CC);
return SUCCESS;
}
-zend_class_entry *php_http_env_response_class_entry;
-
#undef PHP_HTTP_BEGIN_ARGS
#undef PHP_HTTP_EMPTY_ARGS
#define PHP_HTTP_BEGIN_ARGS(method, req_args) PHP_HTTP_BEGIN_ARGS_EX(HttpEnvResponse, method, 0, req_args)
PHP_HTTP_EMPTY_ARGS(send);
+static zend_class_entry *php_http_env_response_class_entry;
+
+zend_class_entry *php_http_env_response_get_class_entry(void)
+{
+ return php_http_env_response_class_entry;
+}
-zend_function_entry php_http_env_response_method_entry[] = {
+static zend_function_entry php_http_env_response_method_entry[] = {
PHP_HTTP_ENV_RESPONSE_ME(__construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
PHP_HTTP_ENV_RESPONSE_ME(__invoke, ZEND_ACC_PUBLIC)
PHP_HTTP_ENV_RESPONSE_ME(setContentType, ZEND_ACC_PUBLIC)
PHP_METHOD(HttpEnvResponse, __construct)
{
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
if (SUCCESS == zend_parse_parameters_none()) {
php_http_message_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
obj->message = php_http_message_init_env(obj->message, PHP_HTTP_RESPONSE TSRMLS_CC);
} end_error_handling();
}
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &ob_str, &ob_len, &ob_flags)) {
php_http_message_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);
- if (obj->body.handle || SUCCESS == php_http_new(&obj->body, php_http_message_body_class_entry, (php_http_new_t) php_http_message_body_object_new_ex, NULL, (void *) php_http_message_body_copy(&obj->message->body, NULL, 0), NULL TSRMLS_CC)) {
+ if (obj->body.handle || SUCCESS == php_http_new(&obj->body, php_http_message_body_get_class_entry(), (php_http_new_t) php_http_message_body_object_new_ex, NULL, (void *) php_http_message_body_copy(&obj->message->body, NULL, 0), NULL TSRMLS_CC)) {
php_http_message_body_append(&obj->message->body, ob_str, ob_len);
RETURN_TRUE;
}
PHP_MINIT_FUNCTION(http_env_response)
{
- PHP_HTTP_REGISTER_CLASS(http\\Env, Response, http_env_response, php_http_message_class_entry, 0);
+ PHP_HTTP_REGISTER_CLASS(http\\Env, Response, http_env_response, php_http_message_get_class_entry(), 0);
zend_declare_class_constant_long(php_http_env_response_class_entry, ZEND_STRL("CONTENT_ENCODING_NONE"), PHP_HTTP_CONTENT_ENCODING_NONE TSRMLS_CC);
zend_declare_class_constant_long(php_http_env_response_class_entry, ZEND_STRL("CONTENT_ENCODING_GZIP"), PHP_HTTP_CONTENT_ENCODING_GZIP TSRMLS_CC);
PHP_HTTP_API php_http_cache_status_t php_http_env_is_response_cached_by_etag(zval *options, const char *header_str, size_t header_len TSRMLS_DC);
PHP_HTTP_API php_http_cache_status_t php_http_env_is_response_cached_by_last_modified(zval *options, const char *header_str, size_t header_len TSRMLS_DC);
-extern zend_class_entry *php_http_env_response_class_entry;
-extern zend_function_entry php_http_env_response_method_entry[];
+zend_class_entry *php_http_env_response_get_class_entry(void);
PHP_METHOD(HttpEnvResponse, __construct);
PHP_METHOD(HttpEnvResponse, __invoke);
# define PHP_HTTP_DBG_EXCEPTIONS 0
#endif
-zend_class_entry *php_http_exception_class_entry;
+static zend_class_entry *php_http_exception_class_entry;
-zend_function_entry php_http_exception_method_entry[] = {
- EMPTY_FUNCTION_ENTRY
-};
+zend_class_entry *php_http_exception_get_class_entry(void)
+{
+ return php_http_exception_class_entry;
+}
#if PHP_HTTP_DBG_EXCEPTIONS
static void php_http_exception_hook(zval *ex TSRMLS_DC)
{
PHP_HTTP_REGISTER_EXCEPTION(Exception, php_http_exception_class_entry, zend_exception_get_default(TSRMLS_C));
- zend_declare_class_constant_long(php_http_exception_class_entry, ZEND_STRL("E_UNKNOWN"), PHP_HTTP_E_UNKNOWN TSRMLS_CC);
- zend_declare_class_constant_long(php_http_exception_class_entry, ZEND_STRL("E_RUNTIME"), PHP_HTTP_E_RUNTIME TSRMLS_CC);
- zend_declare_class_constant_long(php_http_exception_class_entry, ZEND_STRL("E_INVALID_PARAM"), PHP_HTTP_E_INVALID_PARAM TSRMLS_CC);
- zend_declare_class_constant_long(php_http_exception_class_entry, ZEND_STRL("E_HEADER"), PHP_HTTP_E_HEADER TSRMLS_CC);
- zend_declare_class_constant_long(php_http_exception_class_entry, ZEND_STRL("E_MALFORMED_HEADERS"), PHP_HTTP_E_MALFORMED_HEADERS TSRMLS_CC);
- zend_declare_class_constant_long(php_http_exception_class_entry, ZEND_STRL("E_MESSAGE"), PHP_HTTP_E_MESSAGE TSRMLS_CC);
- zend_declare_class_constant_long(php_http_exception_class_entry, ZEND_STRL("E_MESSAGE_TYPE"), PHP_HTTP_E_MESSAGE_TYPE TSRMLS_CC);
- zend_declare_class_constant_long(php_http_exception_class_entry, ZEND_STRL("E_MESSAGE_BODY"), PHP_HTTP_E_MESSAGE_BODY TSRMLS_CC);
- zend_declare_class_constant_long(php_http_exception_class_entry, ZEND_STRL("E_ENCODING"), PHP_HTTP_E_ENCODING TSRMLS_CC);
- zend_declare_class_constant_long(php_http_exception_class_entry, ZEND_STRL("E_CLIENT"), PHP_HTTP_E_CLIENT TSRMLS_CC);
- zend_declare_class_constant_long(php_http_exception_class_entry, ZEND_STRL("E_CLIENT_POOL"), PHP_HTTP_E_CLIENT_POOL TSRMLS_CC);
- zend_declare_class_constant_long(php_http_exception_class_entry, ZEND_STRL("E_CLIENT_DATASHARE"), PHP_HTTP_E_CLIENT_DATASHARE TSRMLS_CC);
- zend_declare_class_constant_long(php_http_exception_class_entry, ZEND_STRL("E_SOCKET"), PHP_HTTP_E_SOCKET TSRMLS_CC);
- zend_declare_class_constant_long(php_http_exception_class_entry, ZEND_STRL("E_RESPONSE"), PHP_HTTP_E_RESPONSE TSRMLS_CC);
- zend_declare_class_constant_long(php_http_exception_class_entry, ZEND_STRL("E_URL"), PHP_HTTP_E_URL TSRMLS_CC);
- zend_declare_class_constant_long(php_http_exception_class_entry, ZEND_STRL("E_QUERYSTRING"), PHP_HTTP_E_QUERYSTRING TSRMLS_CC);
- zend_declare_class_constant_long(php_http_exception_class_entry, ZEND_STRL("E_COOKIE"), PHP_HTTP_E_COOKIE TSRMLS_CC);
+ zend_declare_class_constant_long(php_http_exception_get_class_entry(), ZEND_STRL("E_UNKNOWN"), PHP_HTTP_E_UNKNOWN TSRMLS_CC);
+ zend_declare_class_constant_long(php_http_exception_get_class_entry(), ZEND_STRL("E_RUNTIME"), PHP_HTTP_E_RUNTIME TSRMLS_CC);
+ zend_declare_class_constant_long(php_http_exception_get_class_entry(), ZEND_STRL("E_INVALID_PARAM"), PHP_HTTP_E_INVALID_PARAM TSRMLS_CC);
+ zend_declare_class_constant_long(php_http_exception_get_class_entry(), ZEND_STRL("E_HEADER"), PHP_HTTP_E_HEADER TSRMLS_CC);
+ zend_declare_class_constant_long(php_http_exception_get_class_entry(), ZEND_STRL("E_MALFORMED_HEADERS"), PHP_HTTP_E_MALFORMED_HEADERS TSRMLS_CC);
+ zend_declare_class_constant_long(php_http_exception_get_class_entry(), ZEND_STRL("E_MESSAGE"), PHP_HTTP_E_MESSAGE TSRMLS_CC);
+ zend_declare_class_constant_long(php_http_exception_get_class_entry(), ZEND_STRL("E_MESSAGE_TYPE"), PHP_HTTP_E_MESSAGE_TYPE TSRMLS_CC);
+ zend_declare_class_constant_long(php_http_exception_get_class_entry(), ZEND_STRL("E_MESSAGE_BODY"), PHP_HTTP_E_MESSAGE_BODY TSRMLS_CC);
+ zend_declare_class_constant_long(php_http_exception_get_class_entry(), ZEND_STRL("E_ENCODING"), PHP_HTTP_E_ENCODING TSRMLS_CC);
+ zend_declare_class_constant_long(php_http_exception_get_class_entry(), ZEND_STRL("E_CLIENT"), PHP_HTTP_E_CLIENT TSRMLS_CC);
+ zend_declare_class_constant_long(php_http_exception_get_class_entry(), ZEND_STRL("E_CLIENT_POOL"), PHP_HTTP_E_CLIENT_POOL TSRMLS_CC);
+ zend_declare_class_constant_long(php_http_exception_get_class_entry(), ZEND_STRL("E_CLIENT_DATASHARE"), PHP_HTTP_E_CLIENT_DATASHARE TSRMLS_CC);
+ zend_declare_class_constant_long(php_http_exception_get_class_entry(), ZEND_STRL("E_SOCKET"), PHP_HTTP_E_SOCKET TSRMLS_CC);
+ zend_declare_class_constant_long(php_http_exception_get_class_entry(), ZEND_STRL("E_RESPONSE"), PHP_HTTP_E_RESPONSE TSRMLS_CC);
+ zend_declare_class_constant_long(php_http_exception_get_class_entry(), ZEND_STRL("E_URL"), PHP_HTTP_E_URL TSRMLS_CC);
+ zend_declare_class_constant_long(php_http_exception_get_class_entry(), ZEND_STRL("E_QUERYSTRING"), PHP_HTTP_E_QUERYSTRING TSRMLS_CC);
+ zend_declare_class_constant_long(php_http_exception_get_class_entry(), ZEND_STRL("E_COOKIE"), PHP_HTTP_E_COOKIE TSRMLS_CC);
#if PHP_HTTP_DBG_EXCEPTIONS
zend_throw_exception_hook = php_http_exception_hook;
#ifndef PHP_HTTP_EXCEPTION_H
#define PHP_HTTP_EXCEPTION_H
-PHP_MINIT_FUNCTION(http_exception_object);
-
-extern zend_class_entry *php_http_exception_class_entry;
-extern zend_function_entry php_http_exception_method_entry[];
+zend_class_entry *php_http_exception_get_class_entry(void);
PHP_MINIT_FUNCTION(http_exception);
return f;
}
-php_stream_filter_factory php_http_filter_factory = {
+PHP_HTTP_API php_stream_filter_factory php_http_filter_factory = {
http_filter_create
};
#ifndef PHP_HTTP_FILTER_H
#define PHP_HTTP_FILTER_H
-extern php_stream_filter_factory php_http_filter_factory;
+PHP_HTTP_API php_stream_filter_factory php_http_filter_factory;
PHP_MINIT_FUNCTION(http_filter);
#endif
+++ /dev/null
-
-#include "php_http.h"
-
-zend_class_entry *php_http_fluently_callable_class_entry;
-zend_function_entry php_http_fluently_callable_method_entry[] = {
- EMPTY_FUNCTION_ENTRY
-};
-
-PHP_MINIT_FUNCTION(http_fluently_callable)
-{
- PHP_HTTP_REGISTER_INTERFACE(http, FluentlyCallable, http_fluently_callable, 0);
- return SUCCESS;
-}
+++ /dev/null
-#ifndef PHP_HTTP_FLUENTLY_CALLABLE_H
-#define PHP_HTTP_FLUENTLY_CALLABLE_H
-
-extern zend_class_entry *php_http_fluently_callable_class_entry;
-extern zend_function_entry php_http_fluently_callable_method_entry[];
-
-extern PHP_MINIT_FUNCTION(http_fluently_callable);
-
-#endif /* PHP_HTTP_FLUENTLY_CALLABLE_H */
return SUCCESS;
}
-zend_class_entry *php_http_header_class_entry;
-
#define PHP_HTTP_BEGIN_ARGS(method, req_args) PHP_HTTP_BEGIN_ARGS_EX(HttpHeader, method, 0, req_args)
#define PHP_HTTP_EMPTY_ARGS(method) PHP_HTTP_EMPTY_ARGS_EX(HttpHeader, method, 0)
#define PHP_HTTP_HEADER_ME(method, v) PHP_ME(HttpHeader, method, PHP_HTTP_ARGS(HttpHeader, method), v)
PHP_HTTP_ARG_VAL(value, 0)
PHP_HTTP_END_ARGS;
-PHP_HTTP_EMPTY_ARGS(toString);
+PHP_HTTP_EMPTY_ARGS(serialize);
PHP_HTTP_BEGIN_ARGS(unserialize, 1)
PHP_HTTP_ARG_VAL(serialized, 0)
PHP_HTTP_END_ARGS;
PHP_HTTP_ARG_VAL(flags, 0)
PHP_HTTP_END_ARGS;
-zend_function_entry php_http_header_method_entry[] = {
+static zend_class_entry *php_http_header_class_entry;
+
+zend_class_entry *php_http_header_get_class_entry(void)
+{
+ return php_http_header_class_entry;
+}
+
+static zend_function_entry php_http_header_method_entry[] = {
PHP_HTTP_HEADER_ME(__construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
- PHP_HTTP_HEADER_ME(toString, ZEND_ACC_PUBLIC)
- ZEND_MALIAS(HttpHeader, __toString, toString, PHP_HTTP_ARGS(HttpHeader, toString), ZEND_ACC_PUBLIC)
- ZEND_MALIAS(HttpHeader, serialize, toString, PHP_HTTP_ARGS(HttpHeader, toString), ZEND_ACC_PUBLIC)
+ PHP_HTTP_HEADER_ME(serialize, ZEND_ACC_PUBLIC)
+ ZEND_MALIAS(HttpHeader, __toString, serialize, PHP_HTTP_ARGS(HttpHeader, serialize), ZEND_ACC_PUBLIC)
+ ZEND_MALIAS(HttpHeader, toString, serialize, PHP_HTTP_ARGS(HttpHeader, serialize), ZEND_ACC_PUBLIC)
PHP_HTTP_HEADER_ME(unserialize, ZEND_ACC_PUBLIC)
PHP_HTTP_HEADER_ME(match, ZEND_ACC_PUBLIC)
EMPTY_FUNCTION_ENTRY
char *name_str = NULL, *value_str = NULL;
int name_len = 0, value_len = 0;
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!s!", &name_str, &name_len, &value_str, &value_len)) {
if (name_str && name_len) {
char *pretty_str = estrndup(name_str, name_len);
} end_error_handling();
}
-PHP_METHOD(HttpHeader, toString)
+PHP_METHOD(HttpHeader, serialize)
{
php_http_buffer_t buf;
zval *zname, *zvalue;
PHP_MINIT_FUNCTION(http_header)
{
- PHP_HTTP_REGISTER_CLASS(http, Header, http_header, php_http_object_class_entry, 0);
+ PHP_HTTP_REGISTER_CLASS(http, Header, http_header, php_http_object_get_class_entry(), 0);
zend_class_implements(php_http_header_class_entry TSRMLS_CC, 1, zend_ce_serializable);
zend_declare_class_constant_long(php_http_header_class_entry, ZEND_STRL("MATCH_LOOSE"), PHP_HTTP_MATCH_LOOSE TSRMLS_CC);
zend_declare_class_constant_long(php_http_header_class_entry, ZEND_STRL("MATCH_CASE"), PHP_HTTP_MATCH_CASE TSRMLS_CC);
return SUCCESS;
}
+
/*
* Local variables:
* tab-width: 4
PHP_HTTP_API STATUS php_http_headers_parse(const char *header, size_t length, HashTable *headers, php_http_info_callback_t callback_func, void **callback_data TSRMLS_DC);
-extern zend_class_entry *php_http_header_class_entry;
-extern zend_function_entry php_http_header_method_entry[];
+zend_class_entry *php_http_header_get_class_entry(void);
PHP_METHOD(HttpHeader, __construct);
-PHP_METHOD(HttpHeader, toString);
+PHP_METHOD(HttpHeader, serialize);
PHP_METHOD(HttpHeader, unserialize);
PHP_METHOD(HttpHeader, match);
static zval **php_http_message_object_get_prop_ptr(zval *object, zval *member, const zend_literal *literal_key TSRMLS_DC);
static HashTable *php_http_message_object_get_props(zval *object TSRMLS_DC);
-zend_class_entry *php_http_message_class_entry;
-zend_function_entry php_http_message_method_entry[] = {
+static zend_class_entry *php_http_message_class_entry;
+
+zend_class_entry *php_http_message_get_class_entry(void)
+{
+ return php_http_message_class_entry;
+}
+
+static zend_function_entry php_http_message_method_entry[] = {
PHP_HTTP_MESSAGE_ME(__construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
PHP_HTTP_MESSAGE_ME(getBody, ZEND_ACC_PUBLIC)
PHP_HTTP_MESSAGE_ME(setBody, ZEND_ACC_PUBLIC)
}
}
static void php_http_message_object_prophandler_set_body(php_http_message_object_t *obj, zval *value TSRMLS_DC) {
- if (Z_TYPE_P(value) == IS_OBJECT && instanceof_function(Z_OBJCE_P(value), php_http_message_body_class_entry TSRMLS_CC)) {
+ if (Z_TYPE_P(value) == IS_OBJECT && instanceof_function(Z_OBJCE_P(value), php_http_message_body_get_class_entry() TSRMLS_CC)) {
if (obj->body.handle) {
zend_objects_store_del_ref_by_handle(obj->body.handle TSRMLS_CC);
}
PHP_MINIT_FUNCTION(http_message)
{
- PHP_HTTP_REGISTER_CLASS(http, Message, http_message, php_http_object_class_entry, 0);
+ PHP_HTTP_REGISTER_CLASS(http, Message, http_message, php_http_object_get_class_entry(), 0);
php_http_message_class_entry->create_object = php_http_message_object_new;
memcpy(&php_http_message_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
php_http_message_object_handlers.clone_obj = php_http_message_object_clone;
if (msg->parent) {
o->parent = php_http_message_object_new_ex(ce, msg->parent, NULL TSRMLS_CC);
}
- o->body = php_http_message_body_object_new_ex(php_http_message_body_class_entry, php_http_message_body_copy(&msg->body, NULL, 0), NULL TSRMLS_CC);
+ o->body = php_http_message_body_object_new_ex(php_http_message_body_get_class_entry(), php_http_message_body_copy(&msg->body, NULL, 0), NULL TSRMLS_CC);
}
ov.handle = zend_objects_store_put((zend_object *) o, NULL, php_http_message_object_free, NULL TSRMLS_CC);
MAKE_STD_ZVAL(body);
if (!obj->body.handle) {
- php_http_new(&obj->body, php_http_message_body_class_entry, (php_http_new_t) php_http_message_body_object_new_ex, NULL, (void *) php_http_message_body_copy(&obj->message->body, NULL, 0), NULL TSRMLS_CC);
+ php_http_new(&obj->body, php_http_message_body_get_class_entry(), (php_http_new_t) php_http_message_body_object_new_ex, NULL, (void *) php_http_message_body_copy(&obj->message->body, NULL, 0), NULL TSRMLS_CC);
}
ZVAL_OBJVAL(body, obj->body, 1);
ASSOC_PROP(array, zval, "body", body);
php_http_message_t *msg = NULL;
php_http_message_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z!", &zmessage) && zmessage) {
if (Z_TYPE_P(zmessage) == IS_RESOURCE) {
php_stream *s;
PHP_METHOD(HttpMessage, getBody)
{
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
if (SUCCESS == zend_parse_parameters_none()) {
php_http_message_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);
obj->message = php_http_message_init(NULL, 0 TSRMLS_CC);
}
- if (obj->body.handle || SUCCESS == php_http_new(&obj->body, php_http_message_body_class_entry, (php_http_new_t) php_http_message_body_object_new_ex, NULL, (void *) php_http_message_body_copy(&obj->message->body, NULL, 0), NULL TSRMLS_CC)) {
+ if (obj->body.handle || SUCCESS == php_http_new(&obj->body, php_http_message_body_get_class_entry(), (php_http_new_t) php_http_message_body_object_new_ex, NULL, (void *) php_http_message_body_copy(&obj->message->body, NULL, 0), NULL TSRMLS_CC)) {
RETVAL_OBJVAL(obj->body, 1);
}
}
{
zval *zbody;
- if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &zbody, php_http_message_body_class_entry)) {
+ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &zbody, php_http_message_body_get_class_entry())) {
php_http_message_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);
php_http_message_body_object_t *body_obj = zend_object_store_get_object(zbody TSRMLS_CC);
{
zval *new_body;
- if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &new_body, php_http_message_body_class_entry)) {
+ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &new_body, php_http_message_body_get_class_entry())) {
php_http_message_body_object_t *old_obj = zend_object_store_get_object(getThis() TSRMLS_CC);
php_http_message_body_object_t *new_obj = zend_object_store_get_object(new_body TSRMLS_CC);
PHP_METHOD(HttpMessage, getParentMessage)
{
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
if (SUCCESS == zend_parse_parameters_none()) {
php_http_message_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);
PHP_METHOD(HttpMessage, detach)
{
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
if (SUCCESS == zend_parse_parameters_none()) {
php_http_message_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);
zval *iterator;
} php_http_message_object_t;
-extern zend_class_entry *php_http_message_class_entry;
-extern zend_function_entry http_message_method_entry[];
+zend_class_entry *php_http_message_get_class_entry(void);
-extern PHP_MINIT_FUNCTION(http_message);
-extern PHP_MSHUTDOWN_FUNCTION(http_message);
+PHP_MINIT_FUNCTION(http_message);
+PHP_MSHUTDOWN_FUNCTION(http_message);
-extern void php_http_message_object_prepend(zval *this_ptr, zval *prepend, zend_bool top /* = 1 */ TSRMLS_DC);
-extern void php_http_message_object_reverse(zval *this_ptr, zval *return_value TSRMLS_DC);
+void php_http_message_object_prepend(zval *this_ptr, zval *prepend, zend_bool top /* = 1 */ TSRMLS_DC);
+void php_http_message_object_reverse(zval *this_ptr, zval *return_value TSRMLS_DC);
-extern zend_object_value php_http_message_object_new(zend_class_entry *ce TSRMLS_DC);
-extern zend_object_value php_http_message_object_new_ex(zend_class_entry *ce, php_http_message_t *msg, php_http_message_object_t **ptr TSRMLS_DC);
-extern zend_object_value php_http_message_object_clone(zval *object TSRMLS_DC);
-extern void php_http_message_object_free(void *object TSRMLS_DC);
+zend_object_value php_http_message_object_new(zend_class_entry *ce TSRMLS_DC);
+zend_object_value php_http_message_object_new_ex(zend_class_entry *ce, php_http_message_t *msg, php_http_message_object_t **ptr TSRMLS_DC);
+zend_object_value php_http_message_object_clone(zval *object TSRMLS_DC);
+void php_http_message_object_free(void *object TSRMLS_DC);
PHP_METHOD(HttpMessage, __construct);
PHP_METHOD(HttpMessage, getBody);
PHP_HTTP_ARG_VAL(what, 0)
PHP_HTTP_END_ARGS;
-zend_class_entry *php_http_message_body_class_entry;
-zend_function_entry php_http_message_body_method_entry[] = {
+static zend_class_entry *php_http_message_body_class_entry;
+
+zend_class_entry *php_http_message_body_get_class_entry(void)
+{
+ return php_http_message_body_class_entry;
+}
+
+static zend_function_entry php_http_message_body_method_entry[] = {
PHP_HTTP_MESSAGE_BODY_ME(__construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
PHP_HTTP_MESSAGE_BODY_ME(__toString, ZEND_ACC_PUBLIC)
PHP_MALIAS(HttpMessageBody, toString, __toString, args_for_HttpMessageBody___toString, ZEND_ACC_PUBLIC)
PHP_MINIT_FUNCTION(http_message_body)
{
- PHP_HTTP_REGISTER_CLASS(http\\Message, Body, http_message_body, php_http_object_class_entry, 0);
+ PHP_HTTP_REGISTER_CLASS(http\\Message, Body, http_message_body, php_http_object_get_class_entry(), 0);
php_http_message_body_class_entry->create_object = php_http_message_body_object_new;
memcpy(&php_http_message_body_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
php_http_message_body_object_handlers.clone_obj = php_http_message_body_object_clone;
zval *zstream = NULL;
php_stream *stream;
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r!", &zstream)) {
if (zstream) {
php_stream_from_zval(stream, &zstream);
{
zval *zobj;
- if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &zobj, php_http_message_class_entry)) {
+ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &zobj, php_http_message_get_class_entry())) {
php_http_message_body_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);
php_http_message_object_t *mobj = zend_object_store_get_object(zobj TSRMLS_CC);
php_http_message_body_t *body;
} php_http_message_body_object_t;
-extern zend_class_entry *php_http_message_body_class_entry;
-extern zend_function_entry php_http_message_body_method_entry[];
+zend_class_entry *php_http_message_body_get_class_entry(void);
-extern PHP_MINIT_FUNCTION(http_message_body);
+PHP_MINIT_FUNCTION(http_message_body);
-extern zend_object_value php_http_message_body_object_new(zend_class_entry *ce TSRMLS_DC);
-extern zend_object_value php_http_message_body_object_new_ex(zend_class_entry *ce, php_http_message_body_t *body, php_http_message_body_object_t **ptr TSRMLS_DC);
-extern zend_object_value php_http_message_body_object_clone(zval *object TSRMLS_DC);
-extern void php_http_message_body_object_free(void *object TSRMLS_DC);
+zend_object_value php_http_message_body_object_new(zend_class_entry *ce TSRMLS_DC);
+zend_object_value php_http_message_body_object_new_ex(zend_class_entry *ce, php_http_message_body_t *body, php_http_message_body_object_t **ptr TSRMLS_DC);
+zend_object_value php_http_message_body_object_clone(zval *object TSRMLS_DC);
+void php_http_message_body_object_free(void *object TSRMLS_DC);
PHP_METHOD(HttpMessageBody, __construct);
PHP_METHOD(HttpMessageBody, __toString);
return EH_THROW;
}
- if (EG(This) && instanceof_function(Z_OBJCE_P(EG(This)), php_http_object_class_entry TSRMLS_CC)) {
+ if (EG(This) && instanceof_function(Z_OBJCE_P(EG(This)), php_http_object_get_class_entry() TSRMLS_CC)) {
return php_http_object_get_error_handling(EG(This) TSRMLS_CC);
}
switch (scope_error_handling(type TSRMLS_CC)) {
case EH_THROW: {
char *message;
- zend_class_entry *ce = php_http_exception_class_entry;
+ zend_class_entry *ce = php_http_exception_get_class_entry();
- if (0&& EG(exception_class) && instanceof_function(EG(exception_class), php_http_exception_class_entry TSRMLS_CC)) {
+ /* FIXME wat? */
+ if (0&& EG(exception_class) && instanceof_function(EG(exception_class), ce TSRMLS_CC)) {
ce = EG(exception_class);
}
#define PHP_HTTP_MATCH_FULL 0x20
#define PHP_HTTP_MATCH_STRICT (PHP_HTTP_MATCH_CASE|PHP_HTTP_MATCH_FULL)
-extern int php_http_match(const char *haystack, const char *needle, int flags);
-extern char *php_http_pretty_key(char *key, size_t key_len, zend_bool uctitle, zend_bool xhyphen);
-extern size_t php_http_boundary(char *buf, size_t len TSRMLS_DC);
-extern int php_http_select_str(const char *cmp, int argc, ...);
+int php_http_match(const char *haystack, const char *needle, int flags);
+char *php_http_pretty_key(char *key, size_t key_len, zend_bool uctitle, zend_bool xhyphen);
+size_t php_http_boundary(char *buf, size_t len TSRMLS_DC);
+int php_http_select_str(const char *cmp, int argc, ...);
static inline const char *php_http_locate_str(const char *h, size_t h_len, const char *n, size_t n_len)
{
#define ARRAY_JOIN_PRETTIFY 2
#define array_join(src, dst, append, flags) zend_hash_apply_with_arguments(src TSRMLS_CC, (append)?php_http_array_apply_append_func:php_http_array_apply_merge_func, 2, dst, (int)flags)
-extern int php_http_array_apply_append_func(void *pDest TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key);
-extern int php_http_array_apply_merge_func(void *pDest TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key);
+int php_http_array_apply_append_func(void *pDest TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key);
+int php_http_array_apply_merge_func(void *pDest TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key);
/* PASS CALLBACK */
#include "php_http_api.h"
-STATUS php_http_new(zend_object_value *ov, zend_class_entry *ce, php_http_new_t create, zend_class_entry *parent_ce, void *intern_ptr, void **obj_ptr TSRMLS_DC)
+PHP_HTTP_API STATUS php_http_new(zend_object_value *ov, zend_class_entry *ce, php_http_new_t create, zend_class_entry *parent_ce, void *intern_ptr, void **obj_ptr TSRMLS_DC)
{
if (!ce) {
ce = parent_ce;
zval_ptr_dtor(&lzeh);
return eh;
}
- zeh = zend_read_static_property(php_http_object_class_entry, ZEND_STRL("defaultErrorHandling"), 0 TSRMLS_CC);
+ zeh = zend_read_static_property(php_http_object_get_class_entry(), ZEND_STRL("defaultErrorHandling"), 0 TSRMLS_CC);
if (Z_TYPE_P(zeh) != IS_NULL) {
lzeh = php_http_ztyp(IS_LONG, zeh);
eh = Z_LVAL_P(lzeh);
PHP_HTTP_ARG_VAL(error_message, 0)
PHP_HTTP_END_ARGS;
-zend_class_entry *php_http_object_class_entry;
-zend_function_entry php_http_object_method_entry[] = {
+static zend_class_entry *php_http_object_class_entry;
+
+zend_class_entry *php_http_object_get_class_entry(void)
+{
+ return php_http_object_class_entry;
+}
+
+static zend_function_entry php_http_object_method_entry[] = {
PHP_HTTP_OBJECT_ME(setErrorHandling, ZEND_ACC_PUBLIC)
PHP_HTTP_OBJECT_ME(getErrorHandling, ZEND_ACC_PUBLIC)
PHP_HTTP_OBJECT_ME(setDefaultErrorHandling, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
PHP_METHOD(HttpObject, getErrorHandling)
{
- RETURN_PROP(php_http_object_class_entry, "errorHandling");
+ RETURN_PROP(php_http_object_get_class_entry(), "errorHandling");
}
PHP_METHOD(HttpObject, setErrorHandling)
case EH_NORMAL:
case EH_SUPPRESS:
case EH_THROW:
- zend_update_property_long(php_http_object_class_entry, getThis(), ZEND_STRL("errorHandling"), eh TSRMLS_CC);
+ zend_update_property_long(php_http_object_get_class_entry(), getThis(), ZEND_STRL("errorHandling"), eh TSRMLS_CC);
break;
default:
PHP_METHOD(HttpObject, getDefaultErrorHandling)
{
- RETURN_SPROP(php_http_object_class_entry, "defaultErrorHandling");
+ RETURN_SPROP(php_http_object_get_class_entry(), "defaultErrorHandling");
}
PHP_METHOD(HttpObject, setDefaultErrorHandling)
case EH_NORMAL:
case EH_SUPPRESS:
case EH_THROW:
- zend_update_static_property_long(php_http_object_class_entry, ZEND_STRL("defaultErrorHandling"), eh TSRMLS_CC);
+ zend_update_static_property_long(php_http_object_get_class_entry(), ZEND_STRL("defaultErrorHandling"), eh TSRMLS_CC);
break;
default:
PHP_MINIT_FUNCTION(http_object)
{
PHP_HTTP_REGISTER_CLASS(http, Object, http_object, NULL, ZEND_ACC_ABSTRACT);
- php_http_object_class_entry->create_object = php_http_object_new;
+ php_http_object_get_class_entry()->create_object = php_http_object_new;
- zend_declare_property_null(php_http_object_class_entry, ZEND_STRL("defaultErrorHandling"), (ZEND_ACC_STATIC|ZEND_ACC_PROTECTED) TSRMLS_CC);
- zend_declare_property_null(php_http_object_class_entry, ZEND_STRL("errorHandling"), ZEND_ACC_PROTECTED TSRMLS_CC);
+ zend_declare_property_null(php_http_object_get_class_entry(), ZEND_STRL("defaultErrorHandling"), (ZEND_ACC_STATIC|ZEND_ACC_PROTECTED) TSRMLS_CC);
+ zend_declare_property_null(php_http_object_get_class_entry(), ZEND_STRL("errorHandling"), ZEND_ACC_PROTECTED TSRMLS_CC);
- zend_declare_class_constant_long(php_http_object_class_entry, ZEND_STRL("EH_NORMAL"), EH_NORMAL TSRMLS_CC);
- zend_declare_class_constant_long(php_http_object_class_entry, ZEND_STRL("EH_SUPPRESS"), EH_SUPPRESS TSRMLS_CC);
- zend_declare_class_constant_long(php_http_object_class_entry, ZEND_STRL("EH_THROW"), EH_THROW TSRMLS_CC);
+ zend_declare_class_constant_long(php_http_object_get_class_entry(), ZEND_STRL("EH_NORMAL"), EH_NORMAL TSRMLS_CC);
+ zend_declare_class_constant_long(php_http_object_get_class_entry(), ZEND_STRL("EH_SUPPRESS"), EH_SUPPRESS TSRMLS_CC);
+ zend_declare_class_constant_long(php_http_object_get_class_entry(), ZEND_STRL("EH_THROW"), EH_THROW TSRMLS_CC);
return SUCCESS;
}
typedef zend_object_value (*php_http_new_t)(zend_class_entry *ce, void *, void ** TSRMLS_DC);
-extern STATUS php_http_new(zend_object_value *ov, zend_class_entry *ce, php_http_new_t create, zend_class_entry *parent_ce, void *intern_ptr, void **obj_ptr TSRMLS_DC);
+PHP_HTTP_API STATUS php_http_new(zend_object_value *ov, zend_class_entry *ce, php_http_new_t create, zend_class_entry *parent_ce, void *intern_ptr, void **obj_ptr TSRMLS_DC);
typedef struct php_http_object {
zend_object zo;
} php_http_object_t;
-extern zend_class_entry *php_http_object_class_entry;
-extern zend_function_entry php_http_object_method_entry[];
+zend_class_entry *php_http_object_get_class_entry(void);
-extern PHP_MINIT_FUNCTION(http_object);
+PHP_MINIT_FUNCTION(http_object);
-extern zend_object_value php_http_object_new(zend_class_entry *ce TSRMLS_DC);
-extern zend_object_value php_http_object_new_ex(zend_class_entry *ce, void *nothing, php_http_object_t **ptr TSRMLS_DC);
+zend_object_value php_http_object_new(zend_class_entry *ce TSRMLS_DC);
+zend_object_value php_http_object_new_ex(zend_class_entry *ce, void *nothing, php_http_object_t **ptr TSRMLS_DC);
PHP_HTTP_API zend_error_handling_t php_http_object_get_error_handling(zval *object TSRMLS_DC);
PHP_HTTP_ARG_VAL(value, 0)
PHP_HTTP_END_ARGS;
-zend_class_entry *php_http_params_class_entry;
-zend_function_entry php_http_params_method_entry[] = {
+static zend_class_entry *php_http_params_class_entry;
+
+zend_class_entry *php_http_params_get_class_entry(void)
+{
+ return php_http_params_class_entry;
+}
+
+static zend_function_entry php_http_params_method_entry[] = {
PHP_HTTP_PARAMS_ME(__construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR|ZEND_ACC_FINAL)
PHP_HTTP_PARAMS_ME(toArray, ZEND_ACC_PUBLIC)
PHP_MINIT_FUNCTION(http_params)
{
- PHP_HTTP_REGISTER_CLASS(http, Params, http_params, php_http_object_class_entry, 0);
+ PHP_HTTP_REGISTER_CLASS(http, Params, http_params, php_http_object_get_class_entry(), 0);
zend_class_implements(php_http_params_class_entry TSRMLS_CC, 1, zend_ce_arrayaccess);
PHP_METHOD(HttpParams, __construct)
{
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
zval *zcopy, *zparams = NULL, *param_sep = NULL, *arg_sep = NULL, *val_sep = NULL;
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z!/z/z/z/", &zparams, ¶m_sep, &arg_sep, &val_sep)) {
typedef php_http_object_t php_http_params_object_t;
-extern zend_class_entry *php_http_params_class_entry;
-extern zend_function_entry php_http_params_method_entry[];
+zend_class_entry *php_http_params_get_class_entry(void);
PHP_MINIT_FUNCTION(http_params);
# define PHP_HTTP_PPDBG 0
#endif
-php_http_property_proxy_t *php_http_property_proxy_init(php_http_property_proxy_t *proxy, zval *object, zval *member, zval *parent TSRMLS_DC)
+PHP_HTTP_API php_http_property_proxy_t *php_http_property_proxy_init(php_http_property_proxy_t *proxy, zval *object, zval *member, zval *parent TSRMLS_DC)
{
if (!proxy) {
proxy = emalloc(sizeof(*proxy));
memset(proxy, 0, sizeof(*proxy));
MAKE_STD_ZVAL(proxy->myself);
- ZVAL_OBJVAL(proxy->myself, php_http_property_proxy_object_new_ex(php_http_property_proxy_class_entry, proxy, NULL TSRMLS_CC), 0);
+ ZVAL_OBJVAL(proxy->myself, php_http_property_proxy_object_new_ex(php_http_property_proxy_get_class_entry(), proxy, NULL TSRMLS_CC), 0);
Z_ADDREF_P(object);
proxy->object = object;
proxy->member = php_http_ztyp(IS_STRING, member);
return proxy;
}
-void php_http_property_proxy_dtor(php_http_property_proxy_t *proxy)
+PHP_HTTP_API void php_http_property_proxy_dtor(php_http_property_proxy_t *proxy)
{
zval_ptr_dtor(&proxy->object);
zval_ptr_dtor(&proxy->member);
}
}
-void php_http_property_proxy_free(php_http_property_proxy_t **proxy)
+PHP_HTTP_API void php_http_property_proxy_free(php_http_property_proxy_t **proxy)
{
if (*proxy) {
php_http_property_proxy_dtor(*proxy);
PHP_HTTP_EMPTY_ARGS(__construct);
-zend_class_entry *php_http_property_proxy_class_entry;
-zend_function_entry php_http_property_proxy_method_entry[] = {
+static zend_class_entry *php_http_property_proxy_class_entry;
+
+zend_class_entry *php_http_property_proxy_get_class_entry(void)
+{
+ return php_http_property_proxy_class_entry;
+}
+
+static zend_function_entry php_http_property_proxy_method_entry[] = {
PHP_HTTP_PP_ME(__construct, ZEND_ACC_FINAL|ZEND_ACC_PRIVATE)
EMPTY_FUNCTION_ENTRY
};
+
static zend_object_handlers php_http_property_proxy_object_handlers;
zend_object_value php_http_property_proxy_object_new(zend_class_entry *ce TSRMLS_DC)
php_http_property_proxy_t *proxy;
} php_http_property_proxy_object_t;
-extern zend_class_entry *php_http_property_proxy_class_entry;
-extern zend_function_entry php_http_property_proxy_method_entry[];
+zend_class_entry *php_http_property_proxy_get_class_entry(void);
-extern zend_object_value php_http_property_proxy_object_new(zend_class_entry *ce TSRMLS_DC);
-extern zend_object_value php_http_property_proxy_object_new_ex(zend_class_entry *ce, php_http_property_proxy_t *proxy, php_http_property_proxy_object_t **ptr TSRMLS_DC);
-extern void php_http_property_proxy_object_free(void *object TSRMLS_DC);
+zend_object_value php_http_property_proxy_object_new(zend_class_entry *ce TSRMLS_DC);
+zend_object_value php_http_property_proxy_object_new_ex(zend_class_entry *ce, php_http_property_proxy_t *proxy, php_http_property_proxy_object_t **ptr TSRMLS_DC);
+void php_http_property_proxy_object_free(void *object TSRMLS_DC);
PHP_METHOD(HttpPropertyProxy, __construct);
zval *qa;
if (flags & QS_MERGE) {
- qa = php_http_zsep(1, IS_ARRAY, zend_read_property(php_http_querystring_class_entry, instance, ZEND_STRL("queryArray"), 0 TSRMLS_CC));
+ qa = php_http_zsep(1, IS_ARRAY, zend_read_property(php_http_querystring_get_class_entry(), instance, ZEND_STRL("queryArray"), 0 TSRMLS_CC));
} else {
MAKE_STD_ZVAL(qa);
array_init(qa);
}
php_http_querystring_update(qa, params, NULL TSRMLS_CC);
- zend_update_property(php_http_querystring_class_entry, instance, ZEND_STRL("queryArray"), qa TSRMLS_CC);
+ zend_update_property(php_http_querystring_get_class_entry(), instance, ZEND_STRL("queryArray"), qa TSRMLS_CC);
zval_ptr_dtor(&qa);
}
static inline void php_http_querystring_str(zval *instance, zval *return_value TSRMLS_DC)
{
- zval *qa = zend_read_property(php_http_querystring_class_entry, instance, ZEND_STRL("queryArray"), 0 TSRMLS_CC);
+ zval *qa = zend_read_property(php_http_querystring_get_class_entry(), instance, ZEND_STRL("queryArray"), 0 TSRMLS_CC);
if (Z_TYPE_P(qa) == IS_ARRAY) {
php_http_querystring_update(qa, NULL, return_value TSRMLS_CC);
static inline void php_http_querystring_get(zval *this_ptr, int type, char *name, uint name_len, zval *defval, zend_bool del, zval *return_value TSRMLS_DC)
{
- zval **arrval, *qarray = zend_read_property(php_http_querystring_class_entry, getThis(), ZEND_STRL("queryArray"), 0 TSRMLS_CC);
+ zval **arrval, *qarray = zend_read_property(php_http_querystring_get_class_entry(), getThis(), ZEND_STRL("queryArray"), 0 TSRMLS_CC);
if ((Z_TYPE_P(qarray) == IS_ARRAY) && (SUCCESS == zend_symtable_find(Z_ARRVAL_P(qarray), name, name_len + 1, (void *) &arrval))) {
if (type) {
ZVAL_NULL(&zv);
/* squeeze the hash out of the zval */
- if (Z_TYPE_P(params) == IS_OBJECT && instanceof_function(Z_OBJCE_P(params), php_http_querystring_class_entry TSRMLS_CC)) {
- zv_ptr = php_http_ztyp(IS_ARRAY, zend_read_property(php_http_querystring_class_entry, params, ZEND_STRL("queryArray"), 0 TSRMLS_CC));
+ if (Z_TYPE_P(params) == IS_OBJECT && instanceof_function(Z_OBJCE_P(params), php_http_querystring_get_class_entry() TSRMLS_CC)) {
+ zv_ptr = php_http_ztyp(IS_ARRAY, zend_read_property(php_http_querystring_get_class_entry(), params, ZEND_STRL("queryArray"), 0 TSRMLS_CC));
ptr = Z_ARRVAL_P(zv_ptr);
} else if (Z_TYPE_P(params) == IS_OBJECT || Z_TYPE_P(params) == IS_ARRAY) {
ptr = HASH_OF(params);
PHP_HTTP_EMPTY_ARGS(getIterator);
-zend_class_entry *php_http_querystring_class_entry;
-zend_function_entry php_http_querystring_method_entry[] = {
+static zend_class_entry *php_http_querystring_class_entry;
+
+zend_class_entry *php_http_querystring_get_class_entry(void)
+{
+ return php_http_querystring_class_entry;
+}
+
+static zend_function_entry php_http_querystring_method_entry[] = {
PHP_HTTP_QUERYSTRING_ME(__construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR|ZEND_ACC_FINAL)
PHP_HTTP_QUERYSTRING_ME(toArray, ZEND_ACC_PUBLIC)
PHP_MINIT_FUNCTION(http_querystring)
{
- PHP_HTTP_REGISTER_CLASS(http, QueryString, http_querystring, php_http_object_class_entry, 0);
+ PHP_HTTP_REGISTER_CLASS(http, QueryString, http_querystring, php_http_object_get_class_entry(), 0);
zend_class_implements(php_http_querystring_class_entry TSRMLS_CC, 3, zend_ce_serializable, zend_ce_arrayaccess, zend_ce_aggregate);
{
zval *params = NULL;
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z", ¶ms)) {
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
php_http_querystring_set(getThis(), params, 0 TSRMLS_CC);
} end_error_handling();
}
PHP_METHOD(HttpQueryString, getGlobalInstance)
{
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
if (SUCCESS == zend_parse_parameters_none()) {
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
zval *instance = *zend_std_get_static_property(php_http_querystring_class_entry, ZEND_STRL("instance"), 0, NULL TSRMLS_CC);
if (Z_TYPE_P(instance) != IS_OBJECT) {
PHP_METHOD(HttpQueryString, getIterator)
{
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
if (SUCCESS == zend_parse_parameters_none()) {
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
zval *retval = NULL, *qa = zend_read_property(php_http_querystring_class_entry, getThis(), ZEND_STRL("queryArray"), 0 TSRMLS_CC);
object_init_ex(return_value, spl_ce_RecursiveArrayIterator);
{
zval *params;
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", ¶ms)) {
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
ZVAL_OBJVAL(return_value, Z_OBJ_HT_P(getThis())->clone_obj(getThis() TSRMLS_CC), 0);
php_http_querystring_set(return_value, params, QS_MERGE TSRMLS_CC);
} end_error_handling();
#ifdef PHP_HTTP_HAVE_ICONV
PHP_METHOD(HttpQueryString, xlate)
{
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
char *ie, *oe;
int ie_len, oe_len;
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &ie, &ie_len, &oe, &oe_len)) {
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
zval *na, *qa = php_http_ztyp(IS_ARRAY, zend_read_property(php_http_querystring_class_entry, getThis(), ZEND_STRL("queryArray"), 0 TSRMLS_CC));
MAKE_STD_ZVAL(na);
{
zval *serialized;
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &serialized)) {
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
if (Z_TYPE_P(serialized) == IS_STRING) {
php_http_querystring_set(getThis(), serialized, 0 TSRMLS_CC);
} else {
#define PHP_HTTP_QUERYSTRING_TYPE_ARRAY IS_ARRAY
#define PHP_HTTP_QUERYSTRING_TYPE_OBJECT IS_OBJECT
-extern zend_class_entry *php_http_querystring_class_entry;
-extern zend_function_entry php_http_querystring_method_entry[];
+zend_class_entry *php_http_querystring_get_class_entry(void);
-extern PHP_MINIT_FUNCTION(http_querystring);
+PHP_MINIT_FUNCTION(http_querystring);
#define php_http_querystring_object_new php_http_object_new
#define php_http_querystring_object_new_ex php_http_object_new_ex
+++ /dev/null
-/*
- +--------------------------------------------------------------------+
- | PECL :: http |
- +--------------------------------------------------------------------+
- | Redistribution and use in source and binary forms, with or without |
- | modification, are permitted provided that the conditions mentioned |
- | in the accompanying LICENSE file are met. |
- +--------------------------------------------------------------------+
- | Copyright (c) 2004-2011, Michael Wallner <mike@php.net> |
- +--------------------------------------------------------------------+
-*/
-
-#ifndef PHP_HTTP_SERF_H
-#define PHP_HTTP_SERF_H
-
-#if PHP_HTTP_HAVE_SERF
-
-php_http_request_ops_t *php_http_serf_get_request_ops(void);
-
-PHP_MINIT_FUNCTION(http_serf);
-PHP_MSHUTDOWN_FUNCTION(http_serf);
-
-extern zend_class_entry *php_http_serf_class_entry;
-extern zend_function_entry php_http_serf_method_entry[];
-
-#define php_http_serf_new php_http_object_new
-
-PHP_METHOD(HttpSERF, __construct);
-
-#endif /* PHP_HTTP_HAVE_SERF */
-#endif /* PHP_HTTP_SERF_H */
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */
-
PHP_HTTP_ARG_VAL(flags, 0)
PHP_HTTP_END_ARGS;
-zend_class_entry *php_http_url_class_entry;
-zend_function_entry php_http_url_method_entry[] = {
+static zend_class_entry *php_http_url_class_entry;
+
+zend_class_entry *php_http_url_get_class_entry(void)
+{
+ return php_http_url_class_entry;
+}
+
+static zend_function_entry php_http_url_method_entry[] = {
PHP_HTTP_URL_ME(__construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
PHP_HTTP_URL_ME(mod, ZEND_ACC_PUBLIC)
PHP_HTTP_URL_ME(toString, ZEND_ACC_PUBLIC)
PHP_METHOD(HttpUrl, __construct)
{
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
zval *new_url = NULL, *old_url = NULL;
long flags = PHP_HTTP_URL_FROM_ENV;
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z!z!l", &old_url, &new_url, &flags)) {
- with_error_handling(EH_THROW, php_http_exception_class_entry) {
+ with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
php_url *res_purl, *new_purl = NULL, *old_purl = NULL;
if (new_url) {
PHP_MINIT_FUNCTION(http_url)
{
- PHP_HTTP_REGISTER_CLASS(http, Url, http_url, php_http_object_class_entry, 0);
+ PHP_HTTP_REGISTER_CLASS(http, Url, http_url, php_http_object_get_class_entry(), 0);
zend_declare_property_null(php_http_url_class_entry, ZEND_STRL("scheme"), ZEND_ACC_PUBLIC TSRMLS_CC);
zend_declare_property_null(php_http_url_class_entry, ZEND_STRL("user"), ZEND_ACC_PUBLIC TSRMLS_CC);
return Z_ARRVAL(arr);
}
-extern zend_class_entry *php_http_url_class_entry;
-extern zend_function_entry php_http_url_method_entry[];
+zend_class_entry *php_http_url_get_class_entry(void);
#define php_http_url_object_new php_http_object_new
#define php_http_url_object_new_ex php_http_object_new_ex
PHP_METHOD(HttpUrl, toString);
PHP_METHOD(HttpUrl, toArray);
-extern PHP_MINIT_FUNCTION(http_url);
+PHP_MINIT_FUNCTION(http_url);
#endif