cvs: pecl /dbdo dbdo.c dbdo_object.c php_dbdo.h /dbdo/tests 01_get.phpt 03_factory.phpt
| From: | Alan Knowles | Date: | Tue, 05 Apr 2005 04:20:00 +0000 |
| Subject: | cvs: pecl /dbdo dbdo.c dbdo_object.c php_dbdo.h /dbdo/tests 01_get.phpt 03_factory.phpt | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-2920@lists.php.net to get a copy of this message | ||
alan_k Tue Apr 5 00:20:00 2005 EDT
Modified files:
/pecl/dbdo dbdo.c dbdo_object.c php_dbdo.h
/pecl/dbdo/tests 01_get.phpt 03_factory.phpt
Log:
warm kuddly feeling when you kill a few memory leaks.., 03 factory test now working nicely again.
http://cvs.php.net/diff.php/pecl/dbdo/dbdo.c?r1=1.80&r2=1.81&ty=u Index: pecl/dbdo/dbdo.c diff -u pecl/dbdo/dbdo.c:1.80 pecl/dbdo/dbdo.c:1.81 --- pecl/dbdo/dbdo.c:1.80 Mon Apr 4 22:53:41 2005 +++ pecl/dbdo/dbdo.c Tue Apr 5 00:19:59 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dbdo.c,v 1.80 2005/04/05 02:53:41 alan_k Exp $ */ +/* $Id: dbdo.c,v 1.81 2005/04/05 04:19:59 alan_k Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -246,7 +246,6 @@ PHP_ME(dbdo, quoted, NULL,0) - PHP_ME(dbdo, fetchbug, NULL,0) /* PHP_ME(dbdo, __sleep, NULL, 0) */ @@ -432,7 +431,7 @@ /* make sure we are connected on each request */ - plen = spprintf(&hashkey,0,"DBDO::client"); + plen = spprintf(&hashkey,0,"DBDO::client"); if (SUCCESS == zend_hash_find(&EG(persistent_list), hashkey, plen+1, (void*)&le)) { if (Z_TYPE_P(le) == php_dbdo_list_entry()) { DBDO_G(client) = (GdaClient *) (le->ptr); @@ -454,7 +453,7 @@ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Failed to register persistent entry"); } } - + efree(hashkey); return SUCCESS; } /* }}} */ @@ -476,7 +475,7 @@ //} */ /* free config */ - /* + if (DBDO_G(config_len)) { for (i=0;i<DBDO_G(config_len);i++) { @@ -500,6 +499,16 @@ efree(con->links); con->links = NULL; } + + if (con->provider) { + efree(con->provider); + con->provider = NULL; + } + + if (con->cnc_string) { + efree(con->cnc_string); + con->cnc_string = NULL; + } efree(con); DBDO_G(config)[i] = NULL; @@ -508,7 +517,7 @@ efree(DBDO_G(config)); } - */ + DBDO_G(config) = NULL; DBDO_G(config_len) = 0; // lets clear up the tables.. @@ -575,7 +584,7 @@ GdaProviderInfo *info; php_info_print_table_start(); php_info_print_table_header(2, "DBDO support", "enabled"); - php_info_print_table_row(2, "CVS id", "$Id: dbdo.c,v 1.80 2005/04/05 02:53:41 alan_k Exp $"); + php_info_print_table_row(2, "CVS id", "$Id: dbdo.c,v 1.81 2005/04/05 04:19:59 alan_k Exp $"); prov_list = gda_config_get_provider_list (); @@ -596,7 +605,7 @@ -#define DBDO_INFO_LEN 24 +#define DBDO_INFO_LEN 23 static char *dbdo_info_values[] = { /* 0 */ "table", "dsn", @@ -621,7 +630,6 @@ /* 20*/ "limit_from", "limit_qty", "select" - }; /* get the id for a specified column */ int dbdo_info_get_id(char * col) @@ -647,11 +655,10 @@ /* get the data for a specified id */ -zval * dbdo_info_get(dbdo_object *obj, zval *object, int id TSRMLS_DC) +zval * dbdo_info_get(zval *object, zval *ret, int id TSRMLS_DC) { - - zval *ret; - ALLOC_ZVAL(ret); + dbdo_object *obj = zend_object_store_get_object(object TSRMLS_CC); + switch (id) { case 0: /* tablename; */ @@ -661,6 +668,7 @@ ZVAL_STRING(ret,obj->table->dsn, 1); return ret; case 2: /* database */ + DBDO_DEBUG(16,"returning DATABASE = %s", (char*) gda_connection_get_database(obj->con)); ZVAL_STRING(ret, (char*) gda_connection_get_database(obj->con), 1); return ret; case 3: /* cnc string */ @@ -730,24 +738,24 @@ array_init(ret); config = dbdo_config_get(obj->table->dsn TSRMLS_CC); - ALLOC_ZVAL(zconfig[0]); + MAKE_STD_ZVAL(zconfig[0]); ZVAL_STRING(zconfig[0], config->require_path ? config->require_path : "", 1); DBDO_ARRAY_ADD(ret,"return_path",zconfig[0]); - ALLOC_ZVAL(zconfig[1]); + MAKE_STD_ZVAL(zconfig[1]); ZVAL_STRING(zconfig[1], config->class_name ? config->class_name : "", 1); DBDO_ARRAY_ADD(ret,"class_name",zconfig[1]); - ALLOC_ZVAL(zconfig[2]); + MAKE_STD_ZVAL(zconfig[2]); ZVAL_STRING(zconfig[2], config->links ? config->links : "", 1); DBDO_ARRAY_ADD(ret,"links",zconfig[2]); - ALLOC_ZVAL(zconfig[3]); + MAKE_STD_ZVAL(zconfig[3]); ZVAL_BOOL(zconfig[3], (int) config->lowercase_columns); DBDO_ARRAY_ADD(ret,"lowercase_columns",zconfig[3]); - ALLOC_ZVAL(zconfig[4]); + MAKE_STD_ZVAL(zconfig[4]); ZVAL_BOOL(zconfig[4], (int) config->quote_identifiers); DBDO_ARRAY_ADD(ret,"quote_identifiers",zconfig[4]); @@ -946,6 +954,7 @@ /* a does the class exist */ spprintf(&classname, 0, con->class_name, table); + DBDO_DEBUG(16, "looking for class name: %s", classname); /* now does the class exist!! (lowercase for searching?) */ lc_name = emalloc(strlen(classname) + 1); zend_str_tolower_copy(lc_name, classname, strlen(classname)); @@ -1004,7 +1013,7 @@ efree(classname); /* now instantate it!! */ object_init_ex(return_value, *ce); - + zend_objects_store_add_ref(return_value); /* call the constructor with dsn & tablename */ if (zend_hash_exists(&Z_OBJCE_P(return_value)->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME))) @@ -1608,22 +1617,17 @@ void dbdo_fetch_into_property(zval *object, GdaRow *row, int column_id TSRMLS_DC) { - zval *znew_value = NULL, - *ztitle = NULL, - *ztitlet = NULL; + zval *znew_value = NULL; GdaValue *value; - - gchar *gtitle; - + gchar *gtitle; char *title; dbdo_object *obj = zend_object_store_get_object(object TSRMLS_CC); gtitle = (gchar *) gda_data_model_get_column_title (obj->result, column_id); - - ALLOC_ZVAL(ztitle); - ZVAL_STRING(ztitle, gtitle, 1); + title = estrdup(gtitle); + efree(gtitle); @@ -1636,13 +1640,11 @@ // zval_add_ref(&znew_value); - std_object_handlers.write_property(object, ztitle, znew_value TSRMLS_CC); - //zval_dtor(ztitle); - //FREE_ZVAL(ztitle); - //FREE_ZVAL(*znew_value); - // znew_value = NULL; - //ZVAL_FREE(znew_value); - //zval_dtor(ztitle); + zend_update_property(Z_OBJCE_P(object), object, + title, strlen(title), znew_value TSRMLS_CC); + + efree(title); + zval_dtor(znew_value); } void @@ -1711,66 +1713,13 @@ } dbdo_fetch_into_properties(object TSRMLS_CC); - zend_objects_store_add_ref(object); + zend_objects_store_add_ref(object); RETURN_TRUE; } -PHP_METHOD(dbdo,fetchbug) -{ - zval *object = getThis(); - int i; - for(i=0;i<10;i++) { - switch(i) { - case 0: - case 2: - case 4: - case 6: - case 8: - { - char *title = NULL; - zval *ztitle,*avalue; - spprintf(&(title), 0, "a_%d",i); - ALLOC_ZVAL(ztitle); - ZVAL_STRING(ztitle, title, 0); - ALLOC_ZVAL(avalue); - ZVAL_LONG(avalue,i); - std_object_handlers.write_property(object, ztitle, avalue TSRMLS_CC); - - break; - } - case 1: - case 3: - case 5: - case 7: - case 9: - { - - char *title = NULL; - zval *ztitle,*avalue; - spprintf(&(title), 0, "b_%d",i); - ALLOC_ZVAL(ztitle); - ZVAL_STRING(ztitle, title, 0); - ALLOC_ZVAL(avalue); - ZVAL_STRING(avalue,"hello world",1); - std_object_handlers.write_property(object, ztitle, avalue TSRMLS_CC); - - - - break; - } - } - } - - RETURN_TRUE; - - - - -} - /* {{{ proto mixed $dbdo->count ( what ) fetch the number of results that would be returned @@ -3159,24 +3108,31 @@ } if (key) { - zval *ret; + i = dbdo_info_get_id(key); if (i == -1) { php_error(E_ERROR, "DBDO::info() no information for unknown key %s", key); RETURN_FALSE; } - ret = dbdo_info_get(obj, object, i TSRMLS_CC); - RETURN_ZVAL(ret ,0,1); + MAKE_STD_ZVAL(return_value); + dbdo_info_get(object, return_value, i TSRMLS_CC); + //RETURN_ZVAL(ret ,0,1); + return; } array_init(return_value); for (i=0;i<DBDO_INFO_LEN;i++) { - rv[i] = dbdo_info_get(obj, object, i TSRMLS_CC); - if (rv[i]) { - DBDO_INFO_RETURN(dbdo_info_values[i], rv[i]); + zval *tmp; + MAKE_STD_ZVAL(tmp); + dbdo_info_get(object, tmp, i TSRMLS_CC); + /*zval_add_ref(&tmp); */ + if (tmp) { + DBDO_INFO_RETURN(dbdo_info_values[i], tmp); + } + } } @@ -3260,18 +3216,33 @@ con = dbdo_config_get(dsn TSRMLS_CC); if (strcmp(key,"require_path") ==0) { - con->require_path =estrdup( value); + if (con->require_path) { + efree(con->require_path); + } + con->require_path =estrdup(value); } if (strcmp(key,"class_name") ==0) { - con->class_name = estrdup( value); + if (con->class_name) { + efree(con->class_name); + } + con->class_name = estrdup(value); } if (strcmp(key,"links") ==0) { + if (con->links) { + efree(con->links); + } con->links =estrdup(value); } if (strcmp(key,"provider") ==0) { + if (con->provider) { + efree(con->provider); + } con->provider =estrdup(value); } if (strcmp(key,"cnc") ==0) { + if (con->cnc_string) { + efree(con->cnc_string); + } con->cnc_string =estrdup(value); } http://cvs.php.net/diff.php/pecl/dbdo/dbdo_object.c?r1=1.20&r2=1.21&ty=u Index: pecl/dbdo/dbdo_object.c diff -u pecl/dbdo/dbdo_object.c:1.20 pecl/dbdo/dbdo_object.c:1.21 --- pecl/dbdo/dbdo_object.c:1.20 Mon Apr 4 22:53:41 2005 +++ pecl/dbdo/dbdo_object.c Tue Apr 5 00:19:59 2005 @@ -557,7 +557,7 @@ DBDO_DEBUG2(16,"ADDING STRING (%d) %s\n", strlen(str),str); ZVAL_STRINGL(value, str , strlen(str), 1); - //g_free(str); + g_free(str); return; } /* doubles.. */ http://cvs.php.net/diff.php/pecl/dbdo/php_dbdo.h?r1=1.34&r2=1.35&ty=u Index: pecl/dbdo/php_dbdo.h diff -u pecl/dbdo/php_dbdo.h:1.34 pecl/dbdo/php_dbdo.h:1.35 --- pecl/dbdo/php_dbdo.h:1.34 Mon Apr 4 22:53:41 2005 +++ pecl/dbdo/php_dbdo.h Tue Apr 5 00:19:59 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_dbdo.h,v 1.34 2005/04/05 02:53:41 alan_k Exp $ */ +/* $Id: php_dbdo.h,v 1.35 2005/04/05 04:19:59 alan_k Exp $ */ #ifndef PHP_DBDO_H #define PHP_DBDO_H @@ -193,9 +193,6 @@ /* PHP_METHOD(dbdo, __sleep); */ -PHP_METHOD(dbdo,fetchbug); - - http://cvs.php.net/diff.php/pecl/dbdo/tests/01_get.phpt?r1=1.4&r2=1.5&ty=u Index: pecl/dbdo/tests/01_get.phpt diff -u pecl/dbdo/tests/01_get.phpt:1.4 pecl/dbdo/tests/01_get.phpt:1.5 --- pecl/dbdo/tests/01_get.phpt:1.4 Mon Apr 4 22:53:42 2005 +++ pecl/dbdo/tests/01_get.phpt Tue Apr 5 00:20:00 2005 @@ -43,4 +43,5 @@ [username] => testusername [password] => testpwd [firstname] => testfname - [lastname] => te \ No newline at end of file + [lastname] => testlname +) http://cvs.php.net/diff.php/pecl/dbdo/tests/03_factory.phpt?r1=1.2&r2=1.3&ty=u Index: pecl/dbdo/tests/03_factory.phpt diff -u pecl/dbdo/tests/03_factory.phpt:1.2 pecl/dbdo/tests/03_factory.phpt:1.3 --- pecl/dbdo/tests/03_factory.phpt:1.2 Thu Mar 24 08:59:28 2005 +++ pecl/dbdo/tests/03_factory.phpt Tue Apr 5 00:20:00 2005 @@ -54,10 +54,6 @@ [password] => [row] => -1 [rows] => 0 - [assigned] => Array - ( - ) - [fetched] => Array ( ) @@ -102,10 +98,6 @@ [password] => [row] => -1 [rows] => 0 - [assigned] => Array - ( - ) - [fetched] => Array ( ) @@ -150,17 +142,13 @@ [password] => [row] => -1 [rows] => 0 - [assigned] => Array - ( - ) - [fetched] => Array ( ) [config] => Array ( - [return_path] => %s + [return_path] => /mnt/webdav/dbdo/tests/class%s.inc.php [class_name] => DBDO_%s [links] => [lowercase_columns] => @@ -182,4 +170,4 @@ [limit_from] => [limit_qty] => [select] => -) \ No newline at end of file +)
http://cvs.php.net/diff.php/pecl/dbdo/dbdo.c?r1=1.80&r2=1.81&ty=u Index: pecl/dbdo/dbdo.c diff -u pecl/dbdo/dbdo.c:1.80 pecl/dbdo/dbdo.c:1.81 --- pecl/dbdo/dbdo.c:1.80 Mon Apr 4 22:53:41 2005 +++ pecl/dbdo/dbdo.c Tue Apr 5 00:19:59 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dbdo.c,v 1.80 2005/04/05 02:53:41 alan_k Exp $ */ +/* $Id: dbdo.c,v 1.81 2005/04/05 04:19:59 alan_k Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -246,7 +246,6 @@ PHP_ME(dbdo, quoted, NULL,0) - PHP_ME(dbdo, fetchbug, NULL,0) /* PHP_ME(dbdo, __sleep, NULL, 0) */ @@ -432,7 +431,7 @@ /* make sure we are connected on each request */ - plen = spprintf(&hashkey,0,"DBDO::client"); + plen = spprintf(&hashkey,0,"DBDO::client"); if (SUCCESS == zend_hash_find(&EG(persistent_list), hashkey, plen+1, (void*)&le)) { if (Z_TYPE_P(le) == php_dbdo_list_entry()) { DBDO_G(client) = (GdaClient *) (le->ptr); @@ -454,7 +453,7 @@ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Failed to register persistent entry"); } } - + efree(hashkey); return SUCCESS; } /* }}} */ @@ -476,7 +475,7 @@ //} */ /* free config */ - /* + if (DBDO_G(config_len)) { for (i=0;i<DBDO_G(config_len);i++) { @@ -500,6 +499,16 @@ efree(con->links); con->links = NULL; } + + if (con->provider) { + efree(con->provider); + con->provider = NULL; + } + + if (con->cnc_string) { + efree(con->cnc_string); + con->cnc_string = NULL; + } efree(con); DBDO_G(config)[i] = NULL; @@ -508,7 +517,7 @@ efree(DBDO_G(config)); } - */ + DBDO_G(config) = NULL; DBDO_G(config_len) = 0; // lets clear up the tables.. @@ -575,7 +584,7 @@ GdaProviderInfo *info; php_info_print_table_start(); php_info_print_table_header(2, "DBDO support", "enabled"); - php_info_print_table_row(2, "CVS id", "$Id: dbdo.c,v 1.80 2005/04/05 02:53:41 alan_k Exp $"); + php_info_print_table_row(2, "CVS id", "$Id: dbdo.c,v 1.81 2005/04/05 04:19:59 alan_k Exp $"); prov_list = gda_config_get_provider_list (); @@ -596,7 +605,7 @@ -#define DBDO_INFO_LEN 24 +#define DBDO_INFO_LEN 23 static char *dbdo_info_values[] = { /* 0 */ "table", "dsn", @@ -621,7 +630,6 @@ /* 20*/ "limit_from", "limit_qty", "select" - }; /* get the id for a specified column */ int dbdo_info_get_id(char * col) @@ -647,11 +655,10 @@ /* get the data for a specified id */ -zval * dbdo_info_get(dbdo_object *obj, zval *object, int id TSRMLS_DC) +zval * dbdo_info_get(zval *object, zval *ret, int id TSRMLS_DC) { - - zval *ret; - ALLOC_ZVAL(ret); + dbdo_object *obj = zend_object_store_get_object(object TSRMLS_CC); + switch (id) { case 0: /* tablename; */ @@ -661,6 +668,7 @@ ZVAL_STRING(ret,obj->table->dsn, 1); return ret; case 2: /* database */ + DBDO_DEBUG(16,"returning DATABASE = %s", (char*) gda_connection_get_database(obj->con)); ZVAL_STRING(ret, (char*) gda_connection_get_database(obj->con), 1); return ret; case 3: /* cnc string */ @@ -730,24 +738,24 @@ array_init(ret); config = dbdo_config_get(obj->table->dsn TSRMLS_CC); - ALLOC_ZVAL(zconfig[0]); + MAKE_STD_ZVAL(zconfig[0]); ZVAL_STRING(zconfig[0], config->require_path ? config->require_path : "", 1); DBDO_ARRAY_ADD(ret,"return_path",zconfig[0]); - ALLOC_ZVAL(zconfig[1]); + MAKE_STD_ZVAL(zconfig[1]); ZVAL_STRING(zconfig[1], config->class_name ? config->class_name : "", 1); DBDO_ARRAY_ADD(ret,"class_name",zconfig[1]); - ALLOC_ZVAL(zconfig[2]); + MAKE_STD_ZVAL(zconfig[2]); ZVAL_STRING(zconfig[2], config->links ? config->links : "", 1); DBDO_ARRAY_ADD(ret,"links",zconfig[2]); - ALLOC_ZVAL(zconfig[3]); + MAKE_STD_ZVAL(zconfig[3]); ZVAL_BOOL(zconfig[3], (int) config->lowercase_columns); DBDO_ARRAY_ADD(ret,"lowercase_columns",zconfig[3]); - ALLOC_ZVAL(zconfig[4]); + MAKE_STD_ZVAL(zconfig[4]); ZVAL_BOOL(zconfig[4], (int) config->quote_identifiers); DBDO_ARRAY_ADD(ret,"quote_identifiers",zconfig[4]); @@ -946,6 +954,7 @@ /* a does the class exist */ spprintf(&classname, 0, con->class_name, table); + DBDO_DEBUG(16, "looking for class name: %s", classname); /* now does the class exist!! (lowercase for searching?) */ lc_name = emalloc(strlen(classname) + 1); zend_str_tolower_copy(lc_name, classname, strlen(classname)); @@ -1004,7 +1013,7 @@ efree(classname); /* now instantate it!! */ object_init_ex(return_value, *ce); - + zend_objects_store_add_ref(return_value); /* call the constructor with dsn & tablename */ if (zend_hash_exists(&Z_OBJCE_P(return_value)->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME))) @@ -1608,22 +1617,17 @@ void dbdo_fetch_into_property(zval *object, GdaRow *row, int column_id TSRMLS_DC) { - zval *znew_value = NULL, - *ztitle = NULL, - *ztitlet = NULL; + zval *znew_value = NULL; GdaValue *value; - - gchar *gtitle; - + gchar *gtitle; char *title; dbdo_object *obj = zend_object_store_get_object(object TSRMLS_CC); gtitle = (gchar *) gda_data_model_get_column_title (obj->result, column_id); - - ALLOC_ZVAL(ztitle); - ZVAL_STRING(ztitle, gtitle, 1); + title = estrdup(gtitle); + efree(gtitle); @@ -1636,13 +1640,11 @@ // zval_add_ref(&znew_value); - std_object_handlers.write_property(object, ztitle, znew_value TSRMLS_CC); - //zval_dtor(ztitle); - //FREE_ZVAL(ztitle); - //FREE_ZVAL(*znew_value); - // znew_value = NULL; - //ZVAL_FREE(znew_value); - //zval_dtor(ztitle); + zend_update_property(Z_OBJCE_P(object), object, + title, strlen(title), znew_value TSRMLS_CC); + + efree(title); + zval_dtor(znew_value); } void @@ -1711,66 +1713,13 @@ } dbdo_fetch_into_properties(object TSRMLS_CC); - zend_objects_store_add_ref(object); + zend_objects_store_add_ref(object); RETURN_TRUE; } -PHP_METHOD(dbdo,fetchbug) -{ - zval *object = getThis(); - int i; - for(i=0;i<10;i++) { - switch(i) { - case 0: - case 2: - case 4: - case 6: - case 8: - { - char *title = NULL; - zval *ztitle,*avalue; - spprintf(&(title), 0, "a_%d",i); - ALLOC_ZVAL(ztitle); - ZVAL_STRING(ztitle, title, 0); - ALLOC_ZVAL(avalue); - ZVAL_LONG(avalue,i); - std_object_handlers.write_property(object, ztitle, avalue TSRMLS_CC); - - break; - } - case 1: - case 3: - case 5: - case 7: - case 9: - { - - char *title = NULL; - zval *ztitle,*avalue; - spprintf(&(title), 0, "b_%d",i); - ALLOC_ZVAL(ztitle); - ZVAL_STRING(ztitle, title, 0); - ALLOC_ZVAL(avalue); - ZVAL_STRING(avalue,"hello world",1); - std_object_handlers.write_property(object, ztitle, avalue TSRMLS_CC); - - - - break; - } - } - } - - RETURN_TRUE; - - - - -} - /* {{{ proto mixed $dbdo->count ( what ) fetch the number of results that would be returned @@ -3159,24 +3108,31 @@ } if (key) { - zval *ret; + i = dbdo_info_get_id(key); if (i == -1) { php_error(E_ERROR, "DBDO::info() no information for unknown key %s", key); RETURN_FALSE; } - ret = dbdo_info_get(obj, object, i TSRMLS_CC); - RETURN_ZVAL(ret ,0,1); + MAKE_STD_ZVAL(return_value); + dbdo_info_get(object, return_value, i TSRMLS_CC); + //RETURN_ZVAL(ret ,0,1); + return; } array_init(return_value); for (i=0;i<DBDO_INFO_LEN;i++) { - rv[i] = dbdo_info_get(obj, object, i TSRMLS_CC); - if (rv[i]) { - DBDO_INFO_RETURN(dbdo_info_values[i], rv[i]); + zval *tmp; + MAKE_STD_ZVAL(tmp); + dbdo_info_get(object, tmp, i TSRMLS_CC); + /*zval_add_ref(&tmp); */ + if (tmp) { + DBDO_INFO_RETURN(dbdo_info_values[i], tmp); + } + } } @@ -3260,18 +3216,33 @@ con = dbdo_config_get(dsn TSRMLS_CC); if (strcmp(key,"require_path") ==0) { - con->require_path =estrdup( value); + if (con->require_path) { + efree(con->require_path); + } + con->require_path =estrdup(value); } if (strcmp(key,"class_name") ==0) { - con->class_name = estrdup( value); + if (con->class_name) { + efree(con->class_name); + } + con->class_name = estrdup(value); } if (strcmp(key,"links") ==0) { + if (con->links) { + efree(con->links); + } con->links =estrdup(value); } if (strcmp(key,"provider") ==0) { + if (con->provider) { + efree(con->provider); + } con->provider =estrdup(value); } if (strcmp(key,"cnc") ==0) { + if (con->cnc_string) { + efree(con->cnc_string); + } con->cnc_string =estrdup(value); } http://cvs.php.net/diff.php/pecl/dbdo/dbdo_object.c?r1=1.20&r2=1.21&ty=u Index: pecl/dbdo/dbdo_object.c diff -u pecl/dbdo/dbdo_object.c:1.20 pecl/dbdo/dbdo_object.c:1.21 --- pecl/dbdo/dbdo_object.c:1.20 Mon Apr 4 22:53:41 2005 +++ pecl/dbdo/dbdo_object.c Tue Apr 5 00:19:59 2005 @@ -557,7 +557,7 @@ DBDO_DEBUG2(16,"ADDING STRING (%d) %s\n", strlen(str),str); ZVAL_STRINGL(value, str , strlen(str), 1); - //g_free(str); + g_free(str); return; } /* doubles.. */ http://cvs.php.net/diff.php/pecl/dbdo/php_dbdo.h?r1=1.34&r2=1.35&ty=u Index: pecl/dbdo/php_dbdo.h diff -u pecl/dbdo/php_dbdo.h:1.34 pecl/dbdo/php_dbdo.h:1.35 --- pecl/dbdo/php_dbdo.h:1.34 Mon Apr 4 22:53:41 2005 +++ pecl/dbdo/php_dbdo.h Tue Apr 5 00:19:59 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_dbdo.h,v 1.34 2005/04/05 02:53:41 alan_k Exp $ */ +/* $Id: php_dbdo.h,v 1.35 2005/04/05 04:19:59 alan_k Exp $ */ #ifndef PHP_DBDO_H #define PHP_DBDO_H @@ -193,9 +193,6 @@ /* PHP_METHOD(dbdo, __sleep); */ -PHP_METHOD(dbdo,fetchbug); - - http://cvs.php.net/diff.php/pecl/dbdo/tests/01_get.phpt?r1=1.4&r2=1.5&ty=u Index: pecl/dbdo/tests/01_get.phpt diff -u pecl/dbdo/tests/01_get.phpt:1.4 pecl/dbdo/tests/01_get.phpt:1.5 --- pecl/dbdo/tests/01_get.phpt:1.4 Mon Apr 4 22:53:42 2005 +++ pecl/dbdo/tests/01_get.phpt Tue Apr 5 00:20:00 2005 @@ -43,4 +43,5 @@ [username] => testusername [password] => testpwd [firstname] => testfname - [lastname] => te \ No newline at end of file + [lastname] => testlname +) http://cvs.php.net/diff.php/pecl/dbdo/tests/03_factory.phpt?r1=1.2&r2=1.3&ty=u Index: pecl/dbdo/tests/03_factory.phpt diff -u pecl/dbdo/tests/03_factory.phpt:1.2 pecl/dbdo/tests/03_factory.phpt:1.3 --- pecl/dbdo/tests/03_factory.phpt:1.2 Thu Mar 24 08:59:28 2005 +++ pecl/dbdo/tests/03_factory.phpt Tue Apr 5 00:20:00 2005 @@ -54,10 +54,6 @@ [password] => [row] => -1 [rows] => 0 - [assigned] => Array - ( - ) - [fetched] => Array ( ) @@ -102,10 +98,6 @@ [password] => [row] => -1 [rows] => 0 - [assigned] => Array - ( - ) - [fetched] => Array ( ) @@ -150,17 +142,13 @@ [password] => [row] => -1 [rows] => 0 - [assigned] => Array - ( - ) - [fetched] => Array ( ) [config] => Array ( - [return_path] => %s + [return_path] => /mnt/webdav/dbdo/tests/class%s.inc.php [class_name] => DBDO_%s [links] => [lowercase_columns] => @@ -182,4 +170,4 @@ [limit_from] => [limit_qty] => [select] => -) \ No newline at end of file +)