zend_hash_apply_with_argument(&php_http_client_drivers, apply_driver_list, ht);
}
+static zend_class_entry *php_http_client_class_entry;
+zend_class_entry *php_http_client_get_class_entry(void)
+{
+ return php_http_client_class_entry;
+}
+
void php_http_client_options_set_subr(zval *instance, char *key, size_t len, zval *opts, int overwrite)
{
if (overwrite || (opts && zend_hash_num_elements(Z_ARRVAL_P(opts)))) {
return FAILURE;
}
-zend_class_entry *php_http_client_class_entry;
static zend_object_handlers php_http_client_object_handlers;
void php_http_client_object_free(zend_object *object)
php_http_message_t *req_copy = php_http_message_copy(request, NULL);
php_http_message_t *res_copy = php_http_message_copy(response, NULL);
php_http_message_t *zipped = php_http_message_zip(res_copy, req_copy);
- php_http_message_object_t *obj = php_http_message_object_new_ex(php_http_message_class_entry, zipped);
+ php_http_message_object_t *obj = php_http_message_object_new_ex(php_http_message_get_class_entry(), zipped);
ZVAL_OBJ(&new_hist, &obj->zo);
php_http_message_free(&msg->parent);
*response = NULL;
- msg_obj = php_http_message_object_new_ex(php_http_client_response_class_entry, msg);
+ msg_obj = php_http_message_object_new_ex(php_http_get_client_response_class_entry(), msg);
ZVAL_OBJ(&zresponse, &msg_obj->zo);
ZVAL_OBJECT(&zrequest, &((php_http_message_object_t *) e->opaque)->zo, 1);
object_init(&info);
info_ht = HASH_OF(&info);
php_http_client_getopt(client, PHP_HTTP_CLIENT_OPT_TRANSFER_INFO, e->request, &info_ht);
- zend_update_property(php_http_client_response_class_entry, &zresponse, ZEND_STRL("transferInfo"), &info);
+ zend_update_property(php_http_get_client_response_class_entry(), &zresponse, ZEND_STRL("transferInfo"), &info);
zval_ptr_dtor(&info);
Z_ADDREF(zresponse);
php_http_message_object_t *msg_obj;
php_http_client_enqueue_t q;
- php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "O|f", &request, php_http_client_request_class_entry, &fci, &fcc), invalid_arg, return);
+ php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "O|f", &request, php_http_get_client_request_class_entry(), &fci, &fcc), invalid_arg, return);
obj = PHP_HTTP_OBJ(NULL, getThis());
msg_obj = PHP_HTTP_OBJ(NULL, request);
php_http_client_object_t *obj;
php_http_message_object_t *msg_obj;
- php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "O", &request, php_http_client_request_class_entry), invalid_arg, return);
+ php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "O", &request, php_http_get_client_request_class_entry()), invalid_arg, return);
obj = PHP_HTTP_OBJ(NULL, getThis());
msg_obj = PHP_HTTP_OBJ(NULL, request);
php_http_message_object_t *msg_obj;
php_http_client_enqueue_t q;
- php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "O|f", &request, php_http_client_request_class_entry, &fci, &fcc), invalid_arg, return);
+ php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "O|f", &request, php_http_get_client_request_class_entry(), &fci, &fcc), invalid_arg, return);
obj = PHP_HTTP_OBJ(NULL, getThis());
msg_obj = PHP_HTTP_OBJ(NULL, request);
zval *zrequest = NULL;
php_http_client_object_t *obj;
- php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|O", &zrequest, php_http_client_request_class_entry), invalid_arg, return);
+ php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|O", &zrequest, php_http_get_client_request_class_entry()), invalid_arg, return);
obj = PHP_HTTP_OBJ(NULL, getThis());
php_http_client_object_t *client_obj;
struct notify_arg arg = {NULL};
- php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|O!o!", &request, php_http_client_request_class_entry, &zprogress), invalid_arg, return);
+ php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|O!o!", &request, php_http_get_client_request_class_entry(), &zprogress), invalid_arg, return);
client_obj = PHP_HTTP_OBJ(NULL, getThis());
observers = zend_read_property(php_http_client_class_entry, getThis(), ZEND_STRL("observers"), 0, &observers_tmp);
php_http_message_object_t *req_obj;
php_http_client_progress_state_t *progress;
- php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "O", &request, php_http_client_request_class_entry), invalid_arg, return);
+ php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "O", &request, php_http_get_client_request_class_entry()), invalid_arg, return);
obj = PHP_HTTP_OBJ(NULL, getThis());
req_obj = PHP_HTTP_OBJ(NULL, request);
php_http_client_object_t *obj;
php_http_message_object_t *req_obj;
- php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "O", &request, php_http_client_request_class_entry), invalid_arg, return);
+ php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "O", &request, php_http_get_client_request_class_entry()), invalid_arg, return);
obj = PHP_HTTP_OBJ(NULL, getThis());
req_obj = PHP_HTTP_OBJ(NULL, request);
zend_llist responses;
} php_http_client_t;
-PHP_HTTP_API zend_class_entry *php_http_client_class_entry;
+PHP_HTTP_API zend_class_entry *php_http_client_get_class_entry();
typedef struct php_http_client_object {
php_http_client_t *client;
#include "php_http_api.h"
+static zend_class_entry *php_http_client_request_class_entry;
+zend_class_entry *php_http_get_client_request_class_entry(void)
+{
+ return php_http_client_request_class_entry;
+}
+
void php_http_client_options_set_subr(zval *this_ptr, char *key, size_t len, zval *opts, int overwrite);
void php_http_client_options_set(zval *this_ptr, zval *opts);
void php_http_client_options_get_subr(zval *this_ptr, char *key, size_t len, zval *return_value);
zval *zheaders = NULL, *zbody = NULL, *zurl = NULL;
php_http_message_object_t *obj;
- php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|s!z!a!O!", &meth_str, &meth_len, &zurl, &zheaders, &zbody, php_http_message_body_class_entry), invalid_arg, return);
+ php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|s!z!a!O!", &meth_str, &meth_len, &zurl, &zheaders, &zbody, php_http_get_message_body_class_entry()), invalid_arg, return);
obj = PHP_HTTP_OBJ(NULL, getThis());
EMPTY_FUNCTION_ENTRY
};
-zend_class_entry *php_http_client_request_class_entry;
-
PHP_MINIT_FUNCTION(http_client_request)
{
zend_class_entry ce = {0};
INIT_NS_CLASS_ENTRY(ce, "http\\Client", "Request", php_http_client_request_methods);
- php_http_client_request_class_entry = zend_register_internal_class_ex(&ce, php_http_message_class_entry);
+ php_http_client_request_class_entry = zend_register_internal_class_ex(&ce, php_http_message_get_class_entry());
zend_declare_property_null(php_http_client_request_class_entry, ZEND_STRL("options"), ZEND_ACC_PROTECTED);
#ifndef PHP_HTTP_CLIENT_REQUEST_H
#define PHP_HTTP_CLIENT_REQUEST_H
-PHP_HTTP_API zend_class_entry *php_http_client_request_class_entry;
+PHP_HTTP_API zend_class_entry *php_http_get_client_request_class_entry(void);
PHP_MINIT_FUNCTION(http_client_request);
#endif /* PHP_HTTP_CLIENT_REQUEST_H */
#include "php_http_api.h"
+static zend_class_entry *php_http_client_response_class_entry;
+zend_class_entry *php_http_get_client_response_class_entry(void)
+{
+ return php_http_client_response_class_entry;
+}
+
ZEND_BEGIN_ARG_INFO_EX(ai_HttpClientResponse_getCookies, 0, 0, 0)
ZEND_ARG_INFO(0, flags)
ZEND_ARG_INFO(0, allowed_extras)
if ((list = php_http_cookie_list_parse(NULL, zs->val, zs->len, flags, allowed_extras))) {
zval cookie;
- ZVAL_OBJ(&cookie, &php_http_cookie_object_new_ex(php_http_cookie_class_entry, list)->zo);
+ ZVAL_OBJ(&cookie, &php_http_cookie_object_new_ex(php_http_cookie_get_class_entry(), list)->zo);
add_next_index_zval(return_value, &cookie);
}
zend_string_release(zs);
if ((list = php_http_cookie_list_parse(NULL, zs->val, zs->len, flags, allowed_extras))) {
zval cookie;
- ZVAL_OBJ(&cookie, &php_http_cookie_object_new_ex(php_http_cookie_class_entry, list)->zo);
+ ZVAL_OBJ(&cookie, &php_http_cookie_object_new_ex(php_http_cookie_get_class_entry(), list)->zo);
add_next_index_zval(return_value, &cookie);
}
zend_string_release(zs);
EMPTY_FUNCTION_ENTRY
};
-zend_class_entry *php_http_client_response_class_entry;
-
PHP_MINIT_FUNCTION(http_client_response)
{
zend_class_entry ce = {0};
INIT_NS_CLASS_ENTRY(ce, "http\\Client", "Response", php_http_client_response_methods);
- php_http_client_response_class_entry = zend_register_internal_class_ex(&ce, php_http_message_class_entry);
+ php_http_client_response_class_entry = zend_register_internal_class_ex(&ce, php_http_message_get_class_entry());
zend_declare_property_null(php_http_client_response_class_entry, ZEND_STRL("transferInfo"), ZEND_ACC_PROTECTED);
#ifndef PHP_HTTP_CLIENT_RESPONSE_H
#define PHP_HTTP_CLIENT_RESPONSE_H
-PHP_HTTP_API zend_class_entry *php_http_client_response_class_entry;
+PHP_HTTP_API zend_class_entry *php_http_get_client_response_class_entry(void);
PHP_MINIT_FUNCTION(http_client_response);
#endif /* PHP_HTTP_CLIENT_RESPONSE_H */
}
+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_object_handlers php_http_cookie_object_handlers;
obj = PHP_HTTP_OBJ(NULL, getThis());
- zend_replace_error_handling(EH_THROW, php_http_exception_runtime_class_entry, &zeh);
+ zend_replace_error_handling(EH_THROW, php_http_get_exception_runtime_class_entry(), &zeh);
if (zcookie) {
if (allowed_extras && zend_hash_num_elements(allowed_extras)) {
EMPTY_FUNCTION_ENTRY
};
-zend_class_entry *php_http_cookie_class_entry;
-
PHP_MINIT_FUNCTION(http_cookie)
{
zend_class_entry ce = {0};
PHP_HTTP_API php_http_cookie_list_t *php_http_cookie_list_from_struct(php_http_cookie_list_t *list, zval *strct);
PHP_HTTP_API void php_http_cookie_list_to_struct(php_http_cookie_list_t *list, zval *strct);
-PHP_HTTP_API zend_class_entry *php_http_cookie_class_entry;
+PHP_HTTP_API zend_class_entry *php_http_cookie_get_class_entry(void);
typedef struct php_http_cookie_object {
php_http_cookie_list_t *list;
zend_object_std_dtor(object);
}
+static zend_class_entry *php_http_encoding_stream_class_entry;
+zend_class_entry *php_http_get_encoding_stream_class_entry(void)
+{
+ return php_http_encoding_stream_class_entry;
+}
+static zend_class_entry *php_http_deflate_stream_class_entry;
+zend_class_entry *php_http_get_deflate_stream_class_entry(void)
+{
+ return php_http_deflate_stream_class_entry;
+}
+static zend_class_entry *php_http_inflate_stream_class_entry;
+zend_class_entry *php_http_get_inflate_stream_class_entry(void)
+{
+ return php_http_inflate_stream_class_entry;
+}
+static zend_class_entry *php_http_dechunk_stream_class_entry;
+zend_class_entry *php_http_get_dechunk_stream_class_entry(void)
+{
+ return php_http_dechunk_stream_class_entry;
+}
+
ZEND_BEGIN_ARG_INFO_EX(ai_HttpEncodingStream___construct, 0, 0, 0)
ZEND_ARG_INFO(0, flags)
ZEND_END_ARG_INFO();
EMPTY_FUNCTION_ENTRY
};
-zend_class_entry *php_http_encoding_stream_class_entry;
-zend_class_entry *php_http_deflate_stream_class_entry;
-zend_class_entry *php_http_inflate_stream_class_entry;
-zend_class_entry *php_http_dechunk_stream_class_entry;
-
PHP_MINIT_FUNCTION(http_encoding)
{
zend_class_entry ce = {0};
zend_object zo;
} php_http_encoding_stream_object_t;
-PHP_HTTP_API zend_class_entry *php_http_encoding_stream_class_entry;
+PHP_HTTP_API zend_class_entry *php_http_get_encoding_stream_class_entry(void);
zend_object *php_http_encoding_stream_object_new(zend_class_entry *ce);
php_http_encoding_stream_object_t *php_http_encoding_stream_object_new_ex(zend_class_entry *ce, php_http_encoding_stream_t *s);
zend_object *php_http_encoding_stream_object_clone(zval *object);
void php_http_encoding_stream_object_free(zend_object *object);
-PHP_HTTP_API zend_class_entry *php_http_deflate_stream_class_entry;
-PHP_HTTP_API zend_class_entry *php_http_inflate_stream_class_entry;
-PHP_HTTP_API zend_class_entry *php_http_dechunk_stream_class_entry;
+PHP_HTTP_API zend_class_entry *php_http_get_deflate_stream_class_entry(void);
+PHP_HTTP_API zend_class_entry *php_http_get_inflate_stream_class_entry(void);
+PHP_HTTP_API zend_class_entry *php_http_get_dechunk_stream_class_entry(void);
#endif
{
php_http_message_body_t *body;
php_http_message_body_object_t *body_obj;
- zend_class_entry *class_entry = php_http_message_body_class_entry;
+ zend_class_entry *class_entry = php_http_get_message_body_class_entry();
php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|C", &class_entry), invalid_arg, return);
body = php_http_env_get_request_body();
- if (SUCCESS == php_http_new((void *) &body_obj, class_entry, (php_http_new_t) php_http_message_body_object_new_ex, php_http_message_body_class_entry, body)) {
+ if (SUCCESS == php_http_new((void *) &body_obj, class_entry, (php_http_new_t) php_http_message_body_object_new_ex, php_http_get_message_body_class_entry(), body)) {
php_http_message_body_addref(body);
RETVAL_OBJ(&body_obj->zo);
}
EMPTY_FUNCTION_ENTRY
};
-zend_class_entry *php_http_env_class_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;
+}
PHP_MINIT_FUNCTION(http_env)
{
}
-PHP_HTTP_API zend_class_entry *php_http_env_class_entry;
+PHP_HTTP_API zend_class_entry *php_http_env_get_class_entry(void);
PHP_MINIT_FUNCTION(http_env);
PHP_RSHUTDOWN_FUNCTION(http_env);
} \
} while(0)
+static zend_class_entry *php_http_env_request_class_entry;
+zend_class_entry *php_http_get_env_request_class_entry(void)
+{
+ return php_http_env_request_class_entry;
+}
ZEND_BEGIN_ARG_INFO_EX(ai_HttpEnvRequest___construct, 0, 0, 0)
ZEND_END_ARG_INFO();
php_http_expect(obj->message = php_http_message_init_env(obj->message, PHP_HTTP_REQUEST), unexpected_val, return);
zsg = php_http_env_get_superglobal(ZEND_STRL("_GET"));
- object_init_ex(&zqs, php_http_querystring_class_entry);
+ object_init_ex(&zqs, php_http_querystring_get_class_entry());
php_http_expect(SUCCESS == php_http_querystring_ctor(&zqs, zsg), unexpected_val, return);
zend_update_property(php_http_env_request_class_entry, getThis(), ZEND_STRL("query"), &zqs);
zval_ptr_dtor(&zqs);
zsg = php_http_env_get_superglobal(ZEND_STRL("_POST"));
- object_init_ex(&zqs, php_http_querystring_class_entry);
+ object_init_ex(&zqs, php_http_querystring_get_class_entry());
php_http_expect(SUCCESS == php_http_querystring_ctor(&zqs, zsg), unexpected_val, return);
zend_update_property(php_http_env_request_class_entry, getThis(), ZEND_STRL("form"), &zqs);
zval_ptr_dtor(&zqs);
zsg = php_http_env_get_superglobal(ZEND_STRL("_COOKIE"));
- object_init_ex(&zqs, php_http_querystring_class_entry);
+ object_init_ex(&zqs, php_http_querystring_get_class_entry());
php_http_expect(SUCCESS == php_http_querystring_ctor(&zqs, zsg), unexpected_val, return);
zend_update_property(php_http_env_request_class_entry, getThis(), ZEND_STRL("cookie"), &zqs);
zval_ptr_dtor(&zqs);
EMPTY_FUNCTION_ENTRY
};
-zend_class_entry *php_http_env_request_class_entry;
-
PHP_MINIT_FUNCTION(http_env_request)
{
zend_class_entry ce = {0};
INIT_NS_CLASS_ENTRY(ce, "http\\Env", "Request", php_http_env_request_methods);
- php_http_env_request_class_entry = zend_register_internal_class_ex(&ce, php_http_message_class_entry);
+ php_http_env_request_class_entry = zend_register_internal_class_ex(&ce, php_http_message_get_class_entry());
zend_declare_property_null(php_http_env_request_class_entry, ZEND_STRL("query"), ZEND_ACC_PROTECTED);
zend_declare_property_null(php_http_env_request_class_entry, ZEND_STRL("form"), ZEND_ACC_PROTECTED);
#ifndef PHP_HTTP_ENV_REQUEST_H
#define PHP_HTTP_ENV_REQUEST_H
-PHP_HTTP_API zend_class_entry *php_http_env_request_class_entry;
+PHP_HTTP_API zend_class_entry *php_http_get_env_request_class_entry(void);
PHP_MINIT_FUNCTION(http_env_request);
#endif
php_http_message_body_t *body = NULL;
if ((zbody = get_option(options, ZEND_STRL("body"), &zbody_tmp))) {
- if ((Z_TYPE_P(zbody) == IS_OBJECT) && instanceof_function(Z_OBJCE_P(zbody), php_http_message_body_class_entry)) {
+ if ((Z_TYPE_P(zbody) == IS_OBJECT) && instanceof_function(Z_OBJCE_P(zbody), php_http_get_message_body_class_entry())) {
php_http_message_body_object_t *body_obj = PHP_HTTP_OBJ(NULL, zbody);
body = body_obj->body;
php_http_message_t *request = NULL;
if ((zrequest = get_option(options, ZEND_STRL("request"), &zrequest_tmp))) {
- if (Z_TYPE_P(zrequest) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zrequest), php_http_message_class_entry)) {
+ if (Z_TYPE_P(zrequest) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zrequest), php_http_message_get_class_entry())) {
php_http_message_object_t *request_obj = PHP_HTTP_OBJ(NULL, zrequest);
request = request_obj->message;
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(zoption), zcookie)
{
- if (Z_TYPE_P(zcookie) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zcookie), php_http_cookie_class_entry)) {
+ if (Z_TYPE_P(zcookie) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zcookie), php_http_cookie_get_class_entry())) {
php_http_cookie_object_t *obj = PHP_HTTP_OBJ(NULL, zcookie);
char *str;
size_t len;
{
zval *env_req = NULL;
- php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|O", &env_req, php_http_message_class_entry), invalid_arg, return);
+ php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|O", &env_req, php_http_message_get_class_entry()), invalid_arg, return);
set_option(getThis(), ZEND_STRL("request"), IS_OBJECT, env_req, 0);
RETVAL_ZVAL(getThis(), 1, 0);
php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zcookie_new), invalid_arg, return);
- zend_replace_error_handling(EH_THROW, php_http_exception_unexpected_val_class_entry, &zeh);
+ zend_replace_error_handling(EH_THROW, php_http_get_exception_unexpected_val_class_entry(), &zeh);
switch (Z_TYPE_P(zcookie_new)) {
case IS_OBJECT:
- if (instanceof_function(Z_OBJCE_P(zcookie_new), php_http_cookie_class_entry)) {
+ if (instanceof_function(Z_OBJCE_P(zcookie_new), php_http_cookie_get_class_entry())) {
Z_ADDREF_P(zcookie_new);
break;
}
case IS_ARRAY:
list = php_http_cookie_list_from_struct(NULL, zcookie_new);
zcookie_new = &tmp;
- ZVAL_OBJECT(zcookie_new, &php_http_cookie_object_new_ex(php_http_cookie_class_entry, list)->zo, 0);
+ ZVAL_OBJECT(zcookie_new, &php_http_cookie_object_new_ex(php_http_cookie_get_class_entry(), list)->zo, 0);
break;
default:
list = php_http_cookie_list_parse(NULL, zs->val, zs->len, 0, NULL);
zend_string_release(zs);
zcookie_new = &tmp;
- ZVAL_OBJECT(zcookie_new, &php_http_cookie_object_new_ex(php_http_cookie_class_entry, list)->zo, 0);
+ ZVAL_OBJECT(zcookie_new, &php_http_cookie_object_new_ex(php_http_cookie_get_class_entry(), list)->zo, 0);
}
zend_restore_error_handling(&zeh);
EMPTY_FUNCTION_ENTRY
};
-zend_class_entry *php_http_env_response_class_entry;
+static zend_class_entry *php_http_env_response_class_entry;
+zend_class_entry *php_http_get_env_response_class_entry(void)
+{
+ return php_http_env_response_class_entry;
+}
PHP_MINIT_FUNCTION(http_env_response)
{
zend_class_entry ce = {0};
INIT_NS_CLASS_ENTRY(ce, "http\\Env", "Response", php_http_env_response_methods);
- php_http_env_response_class_entry = zend_register_internal_class_ex(&ce, php_http_message_class_entry);
+ php_http_env_response_class_entry = zend_register_internal_class_ex(&ce, php_http_message_get_class_entry());
zend_declare_class_constant_long(php_http_env_response_class_entry, ZEND_STRL("CONTENT_ENCODING_NONE"), PHP_HTTP_CONTENT_ENCODING_NONE);
zend_declare_class_constant_long(php_http_env_response_class_entry, ZEND_STRL("CONTENT_ENCODING_GZIP"), PHP_HTTP_CONTENT_ENCODING_GZIP);
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, php_http_message_t *request);
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, php_http_message_t *request);
-PHP_HTTP_API zend_class_entry *php_http_env_response_class_entry;
+PHP_HTTP_API zend_class_entry *php_http_get_env_response_class_entry();
PHP_MINIT_FUNCTION(http_env_response);
#endif
}
#endif
-zend_class_entry *php_http_exception_interface_class_entry;
-zend_class_entry *php_http_exception_runtime_class_entry;
-zend_class_entry *php_http_exception_unexpected_val_class_entry;
-zend_class_entry *php_http_exception_bad_method_call_class_entry;
-zend_class_entry *php_http_exception_invalid_arg_class_entry;
-zend_class_entry *php_http_exception_bad_header_class_entry;
-zend_class_entry *php_http_exception_bad_url_class_entry;
-zend_class_entry *php_http_exception_bad_message_class_entry;
-zend_class_entry *php_http_exception_bad_conversion_class_entry;
-zend_class_entry *php_http_exception_bad_querystring_class_entry;
+static zend_class_entry *php_http_exception_interface_class_entry;
+zend_class_entry *php_http_get_exception_interface_class_entry(void)
+{
+ return php_http_exception_interface_class_entry;
+}
+static zend_class_entry *php_http_exception_runtime_class_entry;
+zend_class_entry *php_http_get_exception_runtime_class_entry(void)
+{
+ return php_http_exception_runtime_class_entry;
+}
+static zend_class_entry *php_http_exception_unexpected_val_class_entry;
+zend_class_entry *php_http_get_exception_unexpected_val_class_entry(void)
+{
+ return php_http_exception_unexpected_val_class_entry;
+}
+static zend_class_entry *php_http_exception_bad_method_call_class_entry;
+zend_class_entry *php_http_get_exception_bad_method_call_class_entry(void)
+{
+ return php_http_exception_bad_method_call_class_entry;
+}
+static zend_class_entry *php_http_exception_invalid_arg_class_entry;
+zend_class_entry *php_http_get_exception_invalid_arg_class_entry(void)
+{
+ return php_http_exception_invalid_arg_class_entry;
+}
+static zend_class_entry *php_http_exception_bad_header_class_entry;
+zend_class_entry *php_http_get_exception_bad_header_class_entry(void)
+{
+ return php_http_exception_bad_header_class_entry;
+}
+static zend_class_entry *php_http_exception_bad_url_class_entry;
+zend_class_entry *php_http_get_exception_bad_url_class_entry(void)
+{
+ return php_http_exception_bad_url_class_entry;
+}
+static zend_class_entry *php_http_exception_bad_message_class_entry;
+zend_class_entry *php_http_get_exception_bad_message_class_entry(void)
+{
+ return php_http_exception_bad_message_class_entry;
+}
+static zend_class_entry *php_http_exception_bad_conversion_class_entry;
+zend_class_entry *php_http_get_exception_bad_conversion_class_entry(void)
+{
+ return php_http_exception_bad_conversion_class_entry;
+}
+static zend_class_entry *php_http_exception_bad_querystring_class_entry;
+zend_class_entry *php_http_get_exception_bad_querystring_class_entry(void)
+{
+ return php_http_exception_bad_querystring_class_entry;
+}
PHP_MINIT_FUNCTION(http_exception)
{
/* short hand for zend_throw_exception_ex */
#define php_http_throw(e, fmt, ...) \
- zend_throw_exception_ex(php_http_exception_ ##e## _class_entry, 0, fmt, __VA_ARGS__)
+ zend_throw_exception_ex(php_http_get_exception_ ##e## _class_entry(), 0, fmt, __VA_ARGS__)
/* wrap a call with replaced zend_error_handling */
#define php_http_expect(test, e, fail) \
do { \
zend_error_handling __zeh; \
- zend_replace_error_handling(EH_THROW, php_http_exception_ ##e## _class_entry, &__zeh); \
+ zend_replace_error_handling(EH_THROW, php_http_get_exception_ ##e## _class_entry(), &__zeh); \
if (!(test)) { \
zend_restore_error_handling(&__zeh); \
fail; \
zend_restore_error_handling(&__zeh); \
} while(0)
-PHP_HTTP_API zend_class_entry *php_http_exception_interface_class_entry;
-PHP_HTTP_API zend_class_entry *php_http_exception_runtime_class_entry;
-PHP_HTTP_API zend_class_entry *php_http_exception_unexpected_val_class_entry;
-PHP_HTTP_API zend_class_entry *php_http_exception_bad_method_call_class_entry;
-PHP_HTTP_API zend_class_entry *php_http_exception_invalid_arg_class_entry;
-PHP_HTTP_API zend_class_entry *php_http_exception_bad_header_class_entry;
-PHP_HTTP_API zend_class_entry *php_http_exception_bad_url_class_entry;
-PHP_HTTP_API zend_class_entry *php_http_exception_bad_message_class_entry;
-PHP_HTTP_API zend_class_entry *php_http_exception_bad_conversion_class_entry;
-PHP_HTTP_API zend_class_entry *php_http_exception_bad_querystring_class_entry;
+PHP_HTTP_API zend_class_entry *php_http_get_exception_interface_class_entry(void);
+PHP_HTTP_API zend_class_entry *php_http_get_exception_runtime_class_entry(void);
+PHP_HTTP_API zend_class_entry *php_http_get_exception_unexpected_val_class_entry(void);
+PHP_HTTP_API zend_class_entry *php_http_get_exception_bad_method_call_class_entry(void);
+PHP_HTTP_API zend_class_entry *php_http_get_exception_invalid_arg_class_entry(void);
+PHP_HTTP_API zend_class_entry *php_http_get_exception_bad_header_class_entry(void);
+PHP_HTTP_API zend_class_entry *php_http_get_exception_bad_url_class_entry(void);
+PHP_HTTP_API zend_class_entry *php_http_get_exception_bad_message_class_entry(void);
+PHP_HTTP_API zend_class_entry *php_http_get_exception_bad_conversion_class_entry(void);
+PHP_HTTP_API zend_class_entry *php_http_get_exception_bad_querystring_class_entry(void);
PHP_MINIT_FUNCTION(http_exception);
}
}
+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;
+}
+
ZEND_BEGIN_ARG_INFO_EX(ai_HttpHeader___construct, 0, 0, 0)
ZEND_ARG_INFO(0, name)
ZEND_ARG_INFO(0, value)
ZVAL_STRINGL(&zctor, "__construct", lenof("__construct"));
- object_init_ex(&zparams_obj, php_http_params_class_entry);
+ object_init_ex(&zparams_obj, php_http_params_get_class_entry());
zargs = (zval *) ecalloc(ZEND_NUM_ARGS()+1, sizeof(zval));
ZVAL_COPY_VALUE(&zargs[0], zend_read_property(php_http_header_class_entry, getThis(), ZEND_STRL("value"), 0, &value_tmp));
EMPTY_FUNCTION_ENTRY
};
-zend_class_entry *php_http_header_class_entry;
-
PHP_MINIT_FUNCTION(http_header)
{
zend_class_entry ce = {0};
PHP_HTTP_API zend_string *php_http_header_value_to_string(zval *header);
PHP_HTTP_API zend_string *php_http_header_value_array_to_string(zval *header);
-PHP_HTTP_API zend_class_entry *php_http_header_class_entry;
+PHP_HTTP_API zend_class_entry *php_http_header_get_class_entry(void);
PHP_MINIT_FUNCTION(http_header);
#endif
return PHP_HTTP_HEADER_PARSER_STATE_DONE;
}
-zend_class_entry *php_http_header_parser_class_entry;
+static zend_class_entry *php_http_header_parser_class_entry;
+zend_class_entry *php_http_get_header_parser_class_entry(void)
+{
+ return php_http_header_parser_class_entry;
+}
static zend_object_handlers php_http_header_parser_object_handlers;
zend_object *php_http_header_parser_object_new(zend_class_entry *ce)
php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "rlz", &zstream, &flags, &zmsg), invalid_arg, return);
- zend_replace_error_handling(EH_THROW, php_http_exception_unexpected_val_class_entry, &zeh);
+ zend_replace_error_handling(EH_THROW, php_http_get_exception_unexpected_val_class_entry(), &zeh);
php_stream_from_zval(s, zstream);
zend_restore_error_handling(&zeh);
zend_object zo;
} php_http_header_parser_object_t;
-PHP_HTTP_API zend_class_entry *php_http_header_parser_class_entry;
+PHP_HTTP_API zend_class_entry *php_http_get_header_parser_class_entry(void);
PHP_MINIT_FUNCTION(http_header_parser);
}
}
+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 zval *php_http_message_object_read_prop(zval *object, zval *member, int type, void **cache_slot, zval *rv);
static void php_http_message_object_write_prop(zval *object, zval *member, zval *value, void **cache_slot);
is_resource:
body = php_http_message_body_init(NULL, s);
- if (!(body_obj = php_http_message_body_object_new_ex(php_http_message_body_class_entry, body))) {
+ if (!(body_obj = php_http_message_body_object_new_ex(php_http_get_message_body_class_entry(), body))) {
php_http_message_body_free(&body);
return FAILURE;
}
break;
case IS_OBJECT:
- if (instanceof_function(Z_OBJCE_P(zbody), php_http_message_body_class_entry)) {
+ if (instanceof_function(Z_OBJCE_P(zbody), php_http_get_message_body_class_entry())) {
Z_ADDREF_P(zbody);
body_obj = PHP_HTTP_OBJ(NULL, zbody);
break;
ZEND_RESULT_CODE php_http_message_object_init_body_object(php_http_message_object_t *obj)
{
php_http_message_body_addref(obj->message->body);
- return php_http_new((void *) &obj->body, php_http_message_body_class_entry, (php_http_new_t) php_http_message_body_object_new_ex, NULL, obj->message->body);
+ return php_http_new((void *) &obj->body, php_http_get_message_body_class_entry(), (php_http_new_t) php_http_message_body_object_new_ex, NULL, obj->message->body);
}
zend_object *php_http_message_object_new(zend_class_entry *ce)
if (msg->parent) {
o->parent = php_http_message_object_new_ex(ce, msg->parent);
}
- o->body = php_http_message_body_object_new_ex(php_http_message_body_class_entry, php_http_message_body_init(&msg->body, NULL));
+ o->body = php_http_message_body_object_new_ex(php_http_get_message_body_class_entry(), php_http_message_body_init(&msg->body, NULL));
}
o->zo.handlers = &php_http_message_object_handlers;
php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|z!b", &zmessage, &greedy), invalid_arg, return);
- zend_replace_error_handling(EH_THROW, php_http_exception_bad_message_class_entry, &zeh);
+ zend_replace_error_handling(EH_THROW, php_http_get_exception_bad_message_class_entry(), &zeh);
if (zmessage && Z_TYPE_P(zmessage) == IS_RESOURCE) {
php_stream *s;
php_http_message_parser_t p;
zend_error_handling zeh;
- zend_replace_error_handling(EH_THROW, php_http_exception_unexpected_val_class_entry, &zeh);
+ zend_replace_error_handling(EH_THROW, php_http_get_exception_unexpected_val_class_entry(), &zeh);
php_stream_from_zval(s, zmessage);
zend_restore_error_handling(&zeh);
{
zval *zbody;
- if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "O", &zbody, php_http_message_body_class_entry)) {
+ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "O", &zbody, php_http_get_message_body_class_entry())) {
php_http_message_object_t *obj = PHP_HTTP_OBJ(NULL, getThis());
PHP_HTTP_MESSAGE_OBJECT_INIT(obj);
{
zval *new_body;
- if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "O", &new_body, php_http_message_body_class_entry)) {
+ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "O", &new_body, php_http_get_message_body_class_entry())) {
php_http_message_object_t *obj = PHP_HTTP_OBJ(NULL, getThis());
php_http_message_body_object_t *new_obj = PHP_HTTP_OBJ(NULL, new_body);
if ((header = php_http_message_header(obj->message, header_str, header_len))) {
if (!header_ce) {
RETURN_ZVAL(header, 1, 0);
- } else if (instanceof_function(header_ce, php_http_header_class_entry)) {
+ } else if (instanceof_function(header_ce, php_http_header_get_class_entry())) {
php_http_object_method_t cb;
zval argv[2];
return;
}
- zend_replace_error_handling(EH_THROW, php_http_exception_bad_url_class_entry, &zeh);
+ zend_replace_error_handling(EH_THROW, php_http_get_exception_bad_url_class_entry(), &zeh);
url = php_http_url_from_zval(zurl, ~0);
zend_restore_error_handling(&zeh);
EMPTY_FUNCTION_ENTRY
};
-zend_class_entry *php_http_message_class_entry;
-
PHP_MINIT_FUNCTION(http_message)
{
zend_class_entry ce = {0};
zend_object zo;
} php_http_message_object_t;
-PHP_HTTP_API zend_class_entry *php_http_message_class_entry;
+PHP_HTTP_API zend_class_entry *php_http_message_get_class_entry(void);
PHP_MINIT_FUNCTION(http_message);
PHP_MSHUTDOWN_FUNCTION(http_message);
return msg;
}
+static zend_class_entry *php_http_message_body_class_entry;
+zend_class_entry *php_http_get_message_body_class_entry(void)
+{
+ return php_http_message_body_class_entry;
+}
+
static zend_object_handlers php_http_message_body_object_handlers;
zend_object *php_http_message_body_object_new(zend_class_entry *ce)
php_http_message_object_t *mobj;
zend_error_handling zeh;
- php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "O", &zobj, php_http_message_class_entry), invalid_arg, return);
+ php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "O", &zobj, php_http_message_get_class_entry()), invalid_arg, return);
obj = PHP_HTTP_OBJ(NULL, getThis());
mobj = PHP_HTTP_OBJ(NULL, zobj);
PHP_HTTP_MESSAGE_BODY_OBJECT_INIT(obj);
- zend_replace_error_handling(EH_THROW, php_http_exception_runtime_class_entry, &zeh);
+ zend_replace_error_handling(EH_THROW, php_http_get_exception_runtime_class_entry(), &zeh);
php_http_message_body_add_part(obj->body, mobj->message);
zend_restore_error_handling(&zeh);
EMPTY_FUNCTION_ENTRY
};
-zend_class_entry *php_http_message_body_class_entry;
-
PHP_MINIT_FUNCTION(http_message_body)
{
zend_class_entry ce = {0};
zend_object zo;
} php_http_message_body_object_t;
-PHP_HTTP_API zend_class_entry *php_http_message_body_class_entry;
+PHP_HTTP_API zend_class_entry *php_http_get_message_body_class_entry(void);
PHP_MINIT_FUNCTION(http_message_body);
zend_object *php_http_message_body_object_new(zend_class_entry *ce);
return php_http_message_parser_state_is(parser);
}
-zend_class_entry *php_http_message_parser_class_entry;
+static zend_class_entry *php_http_message_parser_class_entry;
+zend_class_entry *php_http_get_message_parser_class_entry(void)
+{
+ return php_http_message_parser_class_entry;
+}
static zend_object_handlers php_http_message_parser_object_handlers;
zend_object *php_http_message_parser_object_new(zend_class_entry *ce)
ZVAL_NULL(zmsg);
if (parser_obj->parser->message) {
php_http_message_t *msg_cpy = php_http_message_copy(parser_obj->parser->message, NULL);
- php_http_message_object_t *msg_obj = php_http_message_object_new_ex(php_http_message_class_entry, msg_cpy);
+ php_http_message_object_t *msg_obj = php_http_message_object_new_ex(php_http_message_get_class_entry(), msg_cpy);
ZVAL_OBJ(zmsg, &msg_obj->zo);
}
}
php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "rlz", &zstream, &flags, &zmsg), invalid_arg, return);
- zend_replace_error_handling(EH_THROW, php_http_exception_unexpected_val_class_entry, &zeh);
+ zend_replace_error_handling(EH_THROW, php_http_get_exception_unexpected_val_class_entry(), &zeh);
php_stream_from_zval(s, zstream);
zend_restore_error_handling(&zeh);
ZVAL_NULL(zmsg);
if (parser_obj->parser->message) {
php_http_message_t *msg_cpy = php_http_message_copy(parser_obj->parser->message, NULL);
- php_http_message_object_t *msg_obj = php_http_message_object_new_ex(php_http_message_class_entry, msg_cpy);
+ php_http_message_object_t *msg_obj = php_http_message_object_new_ex(php_http_message_get_class_entry(), msg_cpy);
ZVAL_OBJ(zmsg, &msg_obj->zo);
}
}
zend_object zo;
} php_http_message_parser_object_t;
-PHP_HTTP_API zend_class_entry *php_http_message_parser_class_entry;
+PHP_HTTP_API zend_class_entry *php_http_get_message_parser_class_entry(void);
PHP_MINIT_FUNCTION(http_message_parser);
}
}
+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;
+}
+
ZEND_BEGIN_ARG_INFO_EX(ai_HttpParams___construct, 0, 0, 0)
ZEND_ARG_INFO(0, params)
ZEND_ARG_INFO(0, param_sep)
php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|z!/z/z/z/l", &zparams, ¶m_sep, &arg_sep, &val_sep, &flags), invalid_arg, return);
- zend_replace_error_handling(EH_THROW, php_http_exception_runtime_class_entry, &zeh);
+ zend_replace_error_handling(EH_THROW, php_http_get_exception_runtime_class_entry(), &zeh);
{
switch (ZEND_NUM_ARGS()) {
case 5:
EMPTY_FUNCTION_ENTRY
};
-zend_class_entry *php_http_params_class_entry;
-
PHP_MINIT_FUNCTION(http_params)
{
zend_class_entry ce = {0};
typedef php_http_object_t php_http_params_object_t;
-PHP_HTTP_API zend_class_entry *php_http_params_class_entry;
+PHP_HTTP_API zend_class_entry *php_http_params_get_class_entry(void);
PHP_MINIT_FUNCTION(http_params);
# include <ext/iconv/php_iconv.h>
#endif
+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;
+}
+
#define QS_MERGE 1
static inline void php_http_querystring_set(zval *instance, zval *params, int flags)
php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|z", ¶ms), invalid_arg, return);
- zend_replace_error_handling(EH_THROW, php_http_exception_bad_querystring_class_entry, &zeh);
+ zend_replace_error_handling(EH_THROW, php_http_get_exception_bad_querystring_class_entry(), &zeh);
php_http_querystring_set(getThis(), params, 0);
zend_restore_error_handling(&zeh);
}
php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "z", ¶ms), invalid_arg, return);
- zend_replace_error_handling(EH_THROW, php_http_exception_bad_querystring_class_entry, &zeh);
+ zend_replace_error_handling(EH_THROW, php_http_get_exception_bad_querystring_class_entry(), &zeh);
ZVAL_OBJ(return_value, Z_OBJ_HT_P(instance)->clone_obj(instance));
/* make sure we do not inherit the reference to _GET */
SEPARATE_ZVAL(zend_read_property(Z_OBJCE_P(return_value), return_value, ZEND_STRL("queryArray"), 0, &qa_tmp));
zval_ptr_dtor(¶m);
}
-zend_class_entry *php_http_querystring_class_entry;
-
static zend_function_entry php_http_querystring_methods[] = {
PHP_ME(HttpQueryString, __construct, ai_HttpQueryString___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR|ZEND_ACC_FINAL)
#define PHP_HTTP_QUERYSTRING_TYPE_ARRAY IS_ARRAY
#define PHP_HTTP_QUERYSTRING_TYPE_OBJECT IS_OBJECT
-PHP_HTTP_API zend_class_entry *php_http_querystring_class_entry;
+PHP_HTTP_API zend_class_entry *php_http_querystring_get_class_entry(void);
PHP_MINIT_FUNCTION(http_querystring);
return (php_http_url_t *) state;
}
+static zend_class_entry *php_http_url_class_entry;
+static zend_class_entry *php_http_env_url_class_entry;
+
+zend_class_entry *php_http_url_get_class_entry(void)
+{
+ return php_http_url_class_entry;
+}
+
+zend_class_entry *php_http_get_env_url_class_entry(void)
+{
+ return php_http_env_url_class_entry;
+}
+
ZEND_BEGIN_ARG_INFO_EX(ai_HttpUrl___construct, 0, 0, 0)
ZEND_ARG_INFO(0, old_url)
ZEND_ARG_INFO(0, new_url)
PHP_METHOD(HttpUrl, __construct)
{
zval *new_url = NULL, *old_url = NULL;
- zend_long flags = PHP_HTTP_URL_FROM_ENV;
+ zend_long flags = 0;
zend_error_handling zeh;
php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|z!z!l", &old_url, &new_url, &flags), invalid_arg, return);
- zend_replace_error_handling(EH_THROW, php_http_exception_bad_url_class_entry, &zeh);
+ /* always set http\Url::FROM_ENV for instances of http\Env\Url */
+ if (instanceof_function(Z_OBJCE_P(getThis()), php_http_env_url_class_entry)) {
+ flags |= PHP_HTTP_URL_FROM_ENV;
+ }
+
+ zend_replace_error_handling(EH_THROW, php_http_get_exception_bad_url_class_entry(), &zeh);
{
php_http_url_t *res_purl, *new_purl = NULL, *old_purl = NULL;
php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "z!|l", &new_url, &flags), invalid_arg, return);
- zend_replace_error_handling(EH_THROW, php_http_exception_bad_url_class_entry, &zeh);
+ zend_replace_error_handling(EH_THROW, php_http_get_exception_bad_url_class_entry(), &zeh);
{
php_http_url_t *new_purl = NULL, *old_purl = NULL;
EMPTY_FUNCTION_ENTRY
};
-zend_class_entry *php_http_url_class_entry;
-
PHP_MINIT_FUNCTION(http_url)
{
zend_class_entry ce = {0};
#endif
zend_declare_class_constant_long(php_http_url_class_entry, ZEND_STRL("PARSE_TOPCT"), PHP_HTTP_URL_PARSE_TOPCT);
+ INIT_NS_CLASS_ENTRY(ce, "http\\Env", "Url", php_http_url_methods);
+ php_http_env_url_class_entry = zend_register_internal_class_ex(&ce, php_http_url_class_entry);
+
return SUCCESS;
}
return !(url->scheme || url->pass || url->user || url->host || url->port || url->path || url->query || url->fragment);
}
-PHP_HTTP_API zend_class_entry *php_http_url_class_entry;
+PHP_HTTP_API zend_class_entry *php_http_url_get_class_entry(void);
+PHP_HTTP_API zend_class_entry *php_http_get_env_url_class_entry(void);
PHP_MINIT_FUNCTION(http_url);
#define php_http_url_object_new php_http_object_new
s=b&i=0&e=&a[]=1&a[]=2
--FILE--
<?php
-printf("%s\n", new http\Url);
-printf("%s\n", new http\Url("other", "index"));
-printf("%s\n", new http\Url(array("scheme" => "https", "port" => 443)));
-printf("%s\n", new http\Url(array("path" => "/./up/../down/../././//index.php/.", "query" => null), null, http\Url::SANITIZE_PATH|http\Url::FROM_ENV));
-printf("%s\n", new http\Url(null, null, 0));
+printf("%s\n", new http\Env\Url);
+printf("%s\n", new http\Env\Url("other", "index"));
+printf("%s\n", new http\Env\Url(array("scheme" => "https", "port" => 443)));
+printf("%s\n", new http\Env\Url(array("path" => "/./up/../down/../././//index.php/.", "query" => null), null, http\Url::SANITIZE_PATH|http\Url::FROM_ENV));
+printf("%s\n", new http\Env\Url(null, null, 0));
+printf("%s\n", new http\Url(null, null, http\Url::FROM_ENV));
?>
DONE
--EXPECTF--
http://example.com:55555/index?s=b&i=0&e=&a[]=1&a[]=2
https://example.com/?s=b&i=0&e=&a[]=1&a[]=2
http://example.com:55555/index.php/
-
+http://example.com:55555/?s=b&i=0&e=&a[]=1&a[]=2
+http://example.com:55555/?s=b&i=0&e=&a[]=1&a[]=2
DONE