tony2001                Sat Nov 26 07:37:20 2005 EDT

  Modified files:              
    /php-src/ext/date   php_date.c 
  Log:
  MF51: add properties hashtable to Timezone class
  
  
http://cvs.php.net/diff.php/php-src/ext/date/php_date.c?r1=1.69&r2=1.70&ty=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.69 php-src/ext/date/php_date.c:1.70
--- php-src/ext/date/php_date.c:1.69    Sat Nov 26 04:39:50 2005
+++ php-src/ext/date/php_date.c Sat Nov 26 07:37:20 2005
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_date.c,v 1.69 2005/11/26 09:39:50 tony2001 Exp $ */
+/* $Id: php_date.c,v 1.70 2005/11/26 12:37:20 tony2001 Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -1172,11 +1172,16 @@
 {
        php_timezone_obj *intern;
        zend_object_value retval;
+       zval *tmp;
 
        intern = emalloc(sizeof(php_timezone_obj));
        memset(intern, 0, sizeof(php_timezone_obj));
        intern->std.ce = class_type;
 
+       ALLOC_HASHTABLE(intern->std.properties);
+       zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+       zend_hash_copy(intern->std.properties, &class_type->default_properties, 
(copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
+       
        retval.handle = zend_objects_store_put(intern, 
(zend_objects_store_dtor_t)zend_objects_destroy_object, 
(zend_objects_free_object_storage_t) date_object_free_storage_timezone, NULL 
TSRMLS_CC);
        retval.handlers = &date_object_handlers_timezone;
        
@@ -1205,6 +1210,14 @@
 
 static void date_object_free_storage_timezone(void *object TSRMLS_DC)
 {
+       php_timezone_obj *intern = (php_timezone_obj *)object;
+
+       if (intern->std.properties) {
+               zend_hash_destroy(intern->std.properties);
+               efree(intern->std.properties);
+               intern->std.properties = NULL;
+       }
+
        efree(object);
 }
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to