build and file maintenance
[m6w6/ext-http] / php_http_property_proxy.c
index 196cccea223e23c7de161c70113c3b9135ed3793..908ae9f071214b860c9aeca11b9338d3ed12c0bb 100644 (file)
@@ -1,7 +1,17 @@
+/*
+    +--------------------------------------------------------------------+
+    | 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>            |
+    +--------------------------------------------------------------------+
+*/
 
 #include "php_http.h"
 
-
 php_http_property_proxy_t *php_http_property_proxy_init(php_http_property_proxy_t *proxy, zval *object, zval *member TSRMLS_DC)
 {
        if (!proxy) {
@@ -13,7 +23,7 @@ php_http_property_proxy_t *php_http_property_proxy_init(php_http_property_proxy_
        ZVAL_OBJVAL(proxy->myself, php_http_property_proxy_object_new_ex(php_http_property_proxy_class_entry, proxy, NULL TSRMLS_CC), 0);
        Z_ADDREF_P(object);
        proxy->object = object;
-       proxy->member = php_http_zsep(IS_STRING, member);
+       proxy->member = php_http_ztyp(IS_STRING, member);
 
        return proxy;
 }
@@ -103,7 +113,7 @@ static STATUS php_http_property_proxy_object_cast(zval *object, zval *return_val
        zval *old_value, *new_value;
 
        old_value = php_http_property_proxy_object_get(object TSRMLS_CC);
-       new_value = php_http_zsep(type, old_value);
+       new_value = php_http_ztyp(type, old_value);
 
        if (old_value != new_value) {
                zval_ptr_dtor(&old_value);
@@ -126,8 +136,8 @@ static zval *php_http_property_proxy_object_read_dimension(zval *object, zval *o
                                retval = *data;
                        }
                } else {
-                       offset = php_http_zsep(IS_STRING, offset);
-                       if (SUCCESS == zend_hash_find(Z_ARRVAL_P(property), Z_STRVAL_P(offset), Z_STRLEN_P(offset), (void *) &data)) {
+                       offset = php_http_ztyp(IS_STRING, offset);
+                       if (SUCCESS == zend_symtable_find(Z_ARRVAL_P(property), Z_STRVAL_P(offset), Z_STRLEN_P(offset), (void *) &data)) {
                                retval = *data;
                        }
                        zval_ptr_dtor(&offset);
@@ -149,6 +159,7 @@ static void php_http_property_proxy_object_write_dimension(zval *object, zval *o
        switch (Z_TYPE_P(property)) {
                case IS_NULL:
                        array_init(property);
+                       /* fallthrough */
                case IS_ARRAY:
                        Z_ADDREF_P(value);
                        if (!offset) {
@@ -156,7 +167,7 @@ static void php_http_property_proxy_object_write_dimension(zval *object, zval *o
                        } else if (Z_TYPE_P(offset) == IS_LONG) {
                                add_index_zval(property, Z_LVAL_P(offset), value);
                        } else {
-                               offset = php_http_zsep(IS_STRING, offset);
+                               offset = php_http_ztyp(IS_STRING, offset);
                                add_assoc_zval_ex(property, Z_STRVAL_P(offset), Z_STRLEN_P(offset) + 1, value);
                                zval_ptr_dtor(&offset);
                        }
@@ -175,7 +186,7 @@ PHP_METHOD(HttpPropertyProxy, __construct)
 
 PHP_MINIT_FUNCTION(http_property_proxy)
 {
-       PHP_HTTP_REGISTER_CLASS(http\\object, PropertyProxy, http_property_proxy, NULL, ZEND_ACC_FINAL);
+       PHP_HTTP_REGISTER_CLASS(http\\Object, PropertyProxy, http_property_proxy, NULL, ZEND_ACC_FINAL);
        php_http_property_proxy_class_entry->create_object = php_http_property_proxy_object_new;
        memcpy(&php_http_property_proxy_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
        php_http_property_proxy_object_handlers.set = php_http_property_proxy_object_set;
@@ -187,3 +198,13 @@ PHP_MINIT_FUNCTION(http_property_proxy)
        return SUCCESS;
 }
 
+
+/*
+ * 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
+ */
+