STR_FREE(body);
return FAILURE;
}
-
- if (!php_ob_handler_used("zlib output compression" TSRMLS_CC) && !php_ob_handler_used("ob_gzhandler" TSRMLS_CC) && !OG(ob_lock)) {
+
+ if (
+#if defined(PHP_VERSION_ID) && (PHP_VERSION_ID >= 50399)
+ OG(active) && (OG(active)->flags & PHP_OUTPUT_HANDLER_FLUSHABLE) &&
+#else
+ !OG(ob_lock) &&
+#endif
+ !php_ob_handler_used("zlib output compression" TSRMLS_CC) && !php_ob_handler_used("ob_gzhandler" TSRMLS_CC)) {
php_end_ob_buffers(0 TSRMLS_CC);
}
+
if ((SUCCESS == sapi_send_headers(TSRMLS_C)) && body) {
PHPWRITE(body, strlen(body));
}
o->stream = s;
}
+#ifdef ZEND_ENGINE_2_4
+ zend_object_std_init(OBJ_PROP(o), ce TSRMLS_CC);
+ object_properties_init(OBJ_PROP(o), ce);
+#else
ALLOC_HASHTABLE(OBJ_PROP(o));
zend_hash_init(OBJ_PROP(o), zend_hash_num_elements(&ce->default_properties), NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy(OBJ_PROP(o), &ce->default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *));
+#endif
ov.handle = putObject(http_deflatestream_object, o);
ov.handlers = &http_deflatestream_object_handlers;
o->stream = s;
}
+#ifdef ZEND_ENGINE_2_4
+ zend_object_std_init(OBJ_PROP(o), ce TSRMLS_CC);
+ object_properties_init(OBJ_PROP(o), ce);
+#else
ALLOC_HASHTABLE(OBJ_PROP(o));
zend_hash_init(OBJ_PROP(o), zend_hash_num_elements(&ce->default_properties), NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy(OBJ_PROP(o), &ce->default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *));
+#endif
ov.handle = putObject(http_inflatestream_object, o);
ov.handlers = &http_inflatestream_object_handlers;
}
}
+
+#ifdef ZEND_ENGINE_2_4
+ zend_object_std_init(OBJ_PROP(o), ce TSRMLS_CC);
+ object_properties_init(OBJ_PROP(o), ce);
+#else
ALLOC_HASHTABLE(OBJ_PROP(o));
zend_hash_init(OBJ_PROP(o), zend_hash_num_elements(&ce->default_properties), NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy(OBJ_PROP(o), &ce->default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *));
+#endif
ov.handle = putObject(http_message_object, o);
ov.handlers = &http_message_object_handlers;
*ptr = o;
}
+#ifdef ZEND_ENGINE_2_4
+ zend_object_std_init(OBJ_PROP(o), ce TSRMLS_CC);
+ object_properties_init(OBJ_PROP(o), ce);
+#else
ALLOC_HASHTABLE(OBJ_PROP(o));
zend_hash_init(OBJ_PROP(o), zend_hash_num_elements(&ce->default_properties), NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy(OBJ_PROP(o), &ce->default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *));
+#endif
ov.handle = putObject(http_querystring_object, o);
ov.handlers = &http_querystring_object_handlers;
*ptr = o;
}
+#ifdef ZEND_ENGINE_2_4
+ zend_object_std_init(OBJ_PROP(o), ce TSRMLS_CC);
+ object_properties_init(OBJ_PROP(o), ce);
+#else
ALLOC_HASHTABLE(OBJ_PROP(o));
zend_hash_init(OBJ_PROP(o), zend_hash_num_elements(&ce->default_properties), NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy(OBJ_PROP(o), &ce->default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *));
+#endif
ov.handle = putObject(http_request_object, o);
ov.handlers = &http_request_object_handlers;
*ptr = o;
}
+#ifdef ZEND_ENGINE_2_4
+ zend_object_std_init(OBJ_PROP(o), ce TSRMLS_CC);
+ object_properties_init(OBJ_PROP(o), ce);
+#else
ALLOC_HASHTABLE(OBJ_PROP(o));
zend_hash_init(OBJ_PROP(o), zend_hash_num_elements(&ce->default_properties), NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy(OBJ_PROP(o), &ce->default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *));
+#endif
ov.handle = putObject(http_requestdatashare_object, o);
ov.handlers = &http_requestdatashare_object_handlers;
static zval *_http_requestdatashare_object_read_prop(zval *object, zval *member, int type ZEND_LITERAL_KEY_DC TSRMLS_DC)
{
- if (type == BP_VAR_W && zend_hash_exists(&THIS_CE->default_properties, Z_STRVAL_P(member), Z_STRLEN_P(member)+1)) {
+ if (type == BP_VAR_W &&
+#ifdef ZEND_ENGINE_2_4
+ zend_hash_exists(&THIS_CE->properties_info, Z_STRVAL_P(member), Z_STRLEN_P(member)+1)
+#else
+ zend_hash_exists(&THIS_CE->default_properties, Z_STRVAL_P(member), Z_STRLEN_P(member)+1)
+#endif
+ ) {
zend_error(E_ERROR, "Cannot access HttpRequestDataShare default properties by reference or array key/index");
return NULL;
}
static void _http_requestdatashare_object_write_prop(zval *object, zval *member, zval *value ZEND_LITERAL_KEY_DC TSRMLS_DC)
{
- if (zend_hash_exists(&THIS_CE->default_properties, Z_STRVAL_P(member), Z_STRLEN_P(member)+1)) {
+ if (
+#ifdef ZEND_ENGINE_2_4
+ zend_hash_exists(&THIS_CE->properties_info, Z_STRVAL_P(member), Z_STRLEN_P(member)+1)
+#else
+ zend_hash_exists(&THIS_CE->default_properties, Z_STRVAL_P(member), Z_STRLEN_P(member)+1)
+#endif
+ ) {
int status;
getObjectEx(http_requestdatashare_object, obj, object);
http_request_pool_init(&o->pool);
+#ifdef ZEND_ENGINE_2_4
+ zend_object_std_init(OBJ_PROP(o), ce TSRMLS_CC);
+ object_properties_init(OBJ_PROP(o), ce);
+#else
ALLOC_HASHTABLE(OBJ_PROP(o));
zend_hash_init(OBJ_PROP(o), zend_hash_num_elements(&ce->default_properties), NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy(OBJ_PROP(o), &ce->default_properties, (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *));
+#endif
ov.handle = putObject(http_requestpool_object, o);
ov.handlers = &http_requestpool_object_handlers;
/* we really only need to flush when throttling is enabled,
because we push the data as fast as possible anyway if not */
if (HTTP_G->send.throttle_delay >= HTTP_DIFFSEC) {
+#if defined(PHP_VERSION_ID) && (PHP_VERSION_ID >= 50399)
+ php_output_end_all(TSRMLS_C);
+#else
if (OG(ob_nesting_level)) {
php_end_ob_buffer(1, 1 TSRMLS_CC);
}
if (!OG(implicit_flush)) {
sapi_flush(TSRMLS_C);
}
+#endif
http_sleep(HTTP_G->send.throttle_delay);
}
}
#include "php_version.h"
+#if ZEND_MODULE_API_NO >= 20100409
+#define ZEND_ENGINE_2_4
+#endif
+
#if defined(PHP_VERSION_ID) && (PHP_VERSION_ID >= 50399)
# define ZEND_LITERAL_KEY_DC , const zend_literal *_zend_literal_key
# define ZEND_LITERAL_KEY_CC , _zend_literal_key