fixes for windows and 5.3 compatibility
[m6w6/ext-http] / php_http_client_pool.c
index a3fbf5e5ca3f57e3000fbd9743d7a960db92e1c3..cb98d43f96b9f308123ac2fb7d8771024aa0a6b6 100644 (file)
@@ -321,7 +321,11 @@ zend_object_value php_http_client_pool_object_new_ex(zend_class_entry *ce, php_h
 
        o = ecalloc(1, sizeof(php_http_client_pool_object_t));
        zend_object_std_init((zend_object *) o, ce TSRMLS_CC);
+#if PHP_VERSION_ID < 50339
+       zend_hash_copy(((zend_object *) o)->properties, &(ce->default_properties), (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval*));
+#else
        object_properties_init((zend_object *) o, ce);
+#endif
 
        if (!(o->pool = p)) {
                o->pool = php_http_client_pool_init(NULL, &php_http_client_pool_user_ops, NULL, NULL TSRMLS_CC);
@@ -376,11 +380,11 @@ PHP_METHOD(HttpClientPool, reset)
 
 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)) {
@@ -399,11 +403,11 @@ PHP_METHOD(HttpClientPool, detach)
 {
        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;
@@ -419,9 +423,9 @@ PHP_METHOD(HttpClientPool, send)
 {
        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);
@@ -582,7 +586,7 @@ PHP_METHOD(HttpClientPool, enableEvents)
 
 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;