[PHP-CVS] cvs: php-src /ext/spl spl_directory.c /ext/spl/internal fileobject.inc /ext/spl/tests fileobject_002.phpt

2005-05-04 Thread Marcus Boerger
helly   Tue May  3 18:18:19 2005 EDT

  Added files: 
/php-src/ext/spl/tests  fileobject_002.phpt 

  Modified files:  
/php-src/ext/splspl_directory.c 
/php-src/ext/spl/internal   fileobject.inc 
  Log:
  - Make line counting work with FileObject::fgetc()
  - Add a test for FileObject::fgetc()
  - Update docs
  
  http://cvs.php.net/diff.php/php-src/ext/spl/spl_directory.c?r1=1.43&r2=1.44&ty=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.43 
php-src/ext/spl/spl_directory.c:1.44
--- php-src/ext/spl/spl_directory.c:1.43Tue May  3 17:11:24 2005
+++ php-src/ext/spl/spl_directory.c Tue May  3 18:18:19 2005
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_directory.c,v 1.43 2005/05/03 21:11:24 helly Exp $ */
+/* $Id: spl_directory.c,v 1.44 2005/05/03 22:18:19 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
@@ -872,19 +872,14 @@
 
 static void spl_file_object_free_line(spl_file_object *intern TSRMLS_DC) /* 
{{{ */
 {
-   long line_add = 0;
-
if (intern->current_line) {
efree(intern->current_line);
intern->current_line = NULL;
-   line_add = 1;
}
if (intern->current_zval) {
zval_ptr_dtor(&intern->current_zval);
intern->current_zval = NULL;
-   line_add = 1;
}
-   intern->current_line_num += line_add;
 } /* }}} */
 
 static void spl_file_object_free_storage(void *object TSRMLS_DC) /* {{{ */
@@ -944,7 +939,10 @@
char *buf;
size_t line_len;
int len;
+   long line_add = (intern->current_line || intern->current_zval) ? 1 : 0;
 
+   spl_file_object_free_line(intern TSRMLS_CC);
+   
if (php_stream_eof(intern->stream)) {
if (!silent) {
zend_throw_exception_ex(spl_ce_RuntimeException, 0 
TSRMLS_CC, "Cannot read from file %s", intern->file_name);
@@ -954,8 +952,6 @@
 
buf = php_stream_get_line(intern->stream, NULL, intern->max_line_len, 
&line_len);
 
-   spl_file_object_free_line(intern TSRMLS_CC);
-   
if (!buf) {
intern->current_line = estrdup("");
intern->current_line_len = 0;
@@ -973,18 +969,28 @@
intern->current_line = buf;
intern->current_line_len = line_len;
}
+   intern->current_line_num += line_add;
 
return SUCCESS;
 } /* }}} */
 
-static void spl_file_object_read_line(zval * this_ptr, spl_file_object 
*intern, int silent TSRMLS_DC) /* {{{ */
+static int spl_file_object_read_line(zval * this_ptr, spl_file_object *intern, 
int silent TSRMLS_DC) /* {{{ */
 {
zval *retval;
 
/* if overloaded call the function, otherwise do it directly */
if (intern->func_getCurr->common.scope != spl_ce_FileObject) {
+   if (php_stream_eof(intern->stream)) {
+   if (!silent) {
+   
zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Cannot read from 
file %s", intern->file_name);
+   }
+   return FAILURE;
+   }
zend_call_method_with_0_params(&getThis(), 
Z_OBJCE_P(getThis()), &intern->func_getCurr, "getCurrentLine", &retval);
if (retval) {
+   if (intern->current_line || intern->current_zval) {
+   intern->current_line_num++;
+   }
spl_file_object_free_line(intern TSRMLS_CC);
if (Z_TYPE_P(retval) == IS_STRING) {
intern->current_line = 
estrndup(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
@@ -994,9 +1000,12 @@
ZVAL_ZVAL(intern->current_zval, retval, 1, 0);
}
zval_ptr_dtor(&retval);
+   return SUCCESS;
+   } else {
+   return FAILURE;
}
} else {
-   spl_file_object_read(intern, silent TSRMLS_CC);
+   return spl_file_object_read(intern, silent TSRMLS_CC);
}
 } /* }}} */
 
@@ -1134,9 +1143,10 @@
 {
spl_file_object *intern = 
(spl_file_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
 
+/* Do not read the next line to support correct counting with fgetc()
if (!intern->current_line) {
spl_file_object_read_line(getThis(), intern, 1 TSRMLS_CC);
-   }
+   } */
RETURN_LONG(intern->current_line_num);
 } /* }}} */
 
@@ -1147,6 +1157,7 @@
spl_file_object *intern = 
(spl_file_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
 
spl_file_object_free_line(intern TSRMLS_CC);
+   intern->current_line_num++;
 } /* }}} */
 
 /* {{{ proto void FileObject::setFlags(int f

[PHP-CVS] cvs: php-src /ext/dom php_dom.c

2005-05-04 Thread Rob Richards
rrichards   Tue May  3 18:55:04 2005 EDT

  Modified files:  
/php-src/ext/domphp_dom.c 
  Log:
  Fix bug #32930 (class extending DOMDocument doesn't clone properly)
  
http://cvs.php.net/diff.php/php-src/ext/dom/php_dom.c?r1=1.69&r2=1.70&ty=u
Index: php-src/ext/dom/php_dom.c
diff -u php-src/ext/dom/php_dom.c:1.69 php-src/ext/dom/php_dom.c:1.70
--- php-src/ext/dom/php_dom.c:1.69  Thu Apr 21 17:11:23 2005
+++ php-src/ext/dom/php_dom.c   Tue May  3 18:55:03 2005
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: php_dom.c,v 1.69 2005/04/21 21:11:23 iliaa Exp $ */
+/* $Id: php_dom.c,v 1.70 2005/05/03 22:55:03 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -361,6 +361,7 @@
zend_object_value retval;
void *new_object;
dom_object *intern;
+   dom_object *old_object;
struct _store_object *obj;
zend_object_handle handle = Z_OBJ_HANDLE_P(zobject);
 
@@ -377,6 +378,9 @@
intern->handle = retval.handle;
retval.handlers = Z_OBJ_HT_P(zobject);

+   old_object = (dom_object *) obj->object;
+   zend_objects_clone_members(&intern->std, retval, &old_object->std, 
intern->handle TSRMLS_CC);
+
return retval;
 }
 
@@ -885,7 +889,7 @@
 
 }
 
-static dom_object* dom_objects_set_class(zend_class_entry *class_type 
TSRMLS_DC)
+static dom_object* dom_objects_set_class(zend_class_entry *class_type, 
zend_bool hash_copy TSRMLS_DC)
 {
zend_class_entry *base_class;
zval *tmp;
@@ -908,7 +912,9 @@
 
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 *));
+   if (hash_copy) {
+   zend_hash_copy(intern->std.properties, 
&class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) 
&tmp, sizeof(zval *));
+   }
 
return intern;
 }
@@ -921,7 +927,7 @@
xmlNodePtr node;
xmlNodePtr cloned_node;
 
-   clone = dom_objects_set_class(intern->std.ce TSRMLS_CC);
+   clone = dom_objects_set_class(intern->std.ce, 0 TSRMLS_CC);
 
if (instanceof_function(intern->std.ce, dom_node_class_entry 
TSRMLS_CC)) {
node = (xmlNodePtr)dom_object_get_node((dom_object *) object);
@@ -949,7 +955,7 @@
zend_object_value retval;
dom_object *intern;

-   intern = dom_objects_set_class(class_type TSRMLS_CC);
+   intern = dom_objects_set_class(class_type, 1 TSRMLS_CC);
 
retval.handle = zend_objects_store_put(intern, NULL, 
(zend_objects_free_object_storage_t)dom_objects_free_storage, dom_objects_clone 
TSRMLS_CC);
intern->handle = retval.handle;
@@ -966,7 +972,7 @@
zend_object_value retval;
dom_object *intern;

-   intern = dom_objects_set_class(class_type TSRMLS_CC);
+   intern = dom_objects_set_class(class_type, 1 TSRMLS_CC);
 
retval.handle = zend_objects_store_put(intern, NULL, 
(zend_objects_free_object_storage_t)dom_xpath_objects_free_storage, 
dom_objects_clone TSRMLS_CC);
intern->handle = retval.handle;
@@ -1022,7 +1028,7 @@
dom_object *intern;
dom_nnodemap_object *objmap;

-   intern = dom_objects_set_class(class_type TSRMLS_CC);
+   intern = dom_objects_set_class(class_type, 1 TSRMLS_CC);
intern->ptr = emalloc(sizeof(dom_nnodemap_object));
objmap = (dom_nnodemap_object *)intern->ptr;
objmap->baseobj = NULL;

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



[PHP-CVS] cvs: php-src(PHP_5_0) /ext/dom php_dom.c

2005-05-04 Thread Rob Richards
rrichards   Tue May  3 18:55:45 2005 EDT

  Modified files:  (Branch: PHP_5_0)
/php-src/ext/domphp_dom.c 
  Log:
  MFH: Fix bug #32930 (class extending DOMDocument doesn't clone properly)
  
http://cvs.php.net/diff.php/php-src/ext/dom/php_dom.c?r1=1.60.2.6&r2=1.60.2.7&ty=u
Index: php-src/ext/dom/php_dom.c
diff -u php-src/ext/dom/php_dom.c:1.60.2.6 php-src/ext/dom/php_dom.c:1.60.2.7
--- php-src/ext/dom/php_dom.c:1.60.2.6  Wed Feb  9 06:47:12 2005
+++ php-src/ext/dom/php_dom.c   Tue May  3 18:55:45 2005
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: php_dom.c,v 1.60.2.6 2005/02/09 11:47:12 rrichards Exp $ */
+/* $Id: php_dom.c,v 1.60.2.7 2005/05/03 22:55:45 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -360,6 +360,7 @@
zend_object_value retval;
void *new_object;
dom_object *intern;
+   dom_object *old_object;
struct _store_object *obj;
zend_object_handle handle = Z_OBJ_HANDLE_P(zobject);
 
@@ -376,6 +377,9 @@
intern->handle = retval.handle;
retval.handlers = Z_OBJ_HT_P(zobject);

+   old_object = (dom_object *) obj->object;
+   zend_objects_clone_members(&intern->std, retval, &old_object->std, 
intern->handle TSRMLS_CC);
+
return retval;
 }
 
@@ -882,7 +886,7 @@
 
 }
 
-static dom_object* dom_objects_set_class(zend_class_entry *class_type 
TSRMLS_DC)
+static dom_object* dom_objects_set_class(zend_class_entry *class_type, 
zend_bool hash_copy TSRMLS_DC)
 {
zend_class_entry *base_class;
zval *tmp;
@@ -905,7 +909,9 @@
 
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 *));
+   if (hash_copy) {
+   zend_hash_copy(intern->std.properties, 
&class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) 
&tmp, sizeof(zval *));
+   }
 
return intern;
 }
@@ -918,7 +924,7 @@
xmlNodePtr node;
xmlNodePtr cloned_node;
 
-   clone = dom_objects_set_class(intern->std.ce TSRMLS_CC);
+   clone = dom_objects_set_class(intern->std.ce, 0 TSRMLS_CC);
 
if (instanceof_function(intern->std.ce, dom_node_class_entry 
TSRMLS_CC)) {
node = (xmlNodePtr)dom_object_get_node((dom_object *) object);
@@ -946,7 +952,7 @@
zend_object_value retval;
dom_object *intern;

-   intern = dom_objects_set_class(class_type TSRMLS_CC);
+   intern = dom_objects_set_class(class_type, 1 TSRMLS_CC);
 
retval.handle = zend_objects_store_put(intern, NULL, 
(zend_objects_free_object_storage_t)dom_objects_free_storage, dom_objects_clone 
TSRMLS_CC);
intern->handle = retval.handle;
@@ -963,7 +969,7 @@
zend_object_value retval;
dom_object *intern;

-   intern = dom_objects_set_class(class_type TSRMLS_CC);
+   intern = dom_objects_set_class(class_type, 1 TSRMLS_CC);
 
retval.handle = zend_objects_store_put(intern, NULL, 
(zend_objects_free_object_storage_t)dom_xpath_objects_free_storage, 
dom_objects_clone TSRMLS_CC);
intern->handle = retval.handle;
@@ -1019,7 +1025,7 @@
dom_object *intern;
dom_nnodemap_object *objmap;

-   intern = dom_objects_set_class(class_type TSRMLS_CC);
+   intern = dom_objects_set_class(class_type, 1 TSRMLS_CC);
intern->ptr = emalloc(sizeof(dom_nnodemap_object));
objmap = (dom_nnodemap_object *)intern->ptr;
objmap->baseobj = NULL;

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



[PHP-CVS] cvs: php-src /ext/spl spl_directory.c /ext/spl/tests fileobject_001.phpt fileobject_001a.txt fileobject_001b.txt

2005-05-04 Thread Marcus Boerger
helly   Tue May  3 17:11:26 2005 EDT

  Added files: 
/php-src/ext/spl/tests  fileobject_001.phpt fileobject_001a.txt 
fileobject_001b.txt 

  Modified files:  
/php-src/ext/splspl_directory.c 
  Log:
  - Change FileObject's line counting to be zero based
  - Make FileObject implement SeekableIterator
  - Add tests
  
  http://cvs.php.net/diff.php/php-src/ext/spl/spl_directory.c?r1=1.42&r2=1.43&ty=u
Index: php-src/ext/spl/spl_directory.c
diff -u php-src/ext/spl/spl_directory.c:1.42 
php-src/ext/spl/spl_directory.c:1.43
--- php-src/ext/spl/spl_directory.c:1.42Thu Apr 14 17:02:08 2005
+++ php-src/ext/spl/spl_directory.c Tue May  3 17:11:24 2005
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_directory.c,v 1.42 2005/04/14 21:02:08 helly Exp $ */
+/* $Id: spl_directory.c,v 1.43 2005/05/03 21:11:24 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
@@ -872,14 +872,19 @@
 
 static void spl_file_object_free_line(spl_file_object *intern TSRMLS_DC) /* 
{{{ */
 {
+   long line_add = 0;
+
if (intern->current_line) {
efree(intern->current_line);
intern->current_line = NULL;
+   line_add = 1;
}
if (intern->current_zval) {
zval_ptr_dtor(&intern->current_zval);
intern->current_zval = NULL;
+   line_add = 1;
}
+   intern->current_line_num += line_add;
 } /* }}} */
 
 static void spl_file_object_free_storage(void *object TSRMLS_DC) /* {{{ */
@@ -940,31 +945,35 @@
size_t line_len;
int len;
 
-   buf = php_stream_get_line(intern->stream, NULL, intern->max_line_len, 
&line_len);
-
-   if (!buf) {
+   if (php_stream_eof(intern->stream)) {
if (!silent) {
zend_throw_exception_ex(spl_ce_RuntimeException, 0 
TSRMLS_CC, "Cannot read from file %s", intern->file_name);
}
return FAILURE;
}
 
+   buf = php_stream_get_line(intern->stream, NULL, intern->max_line_len, 
&line_len);
+
spl_file_object_free_line(intern TSRMLS_CC);

-   if (intern->flags & SPL_FILE_OBJECT_DROP_NEW_LINE) {
-   line_len = strcspn(buf, "\r\n");
-   buf[line_len] = '\0';
-   }
-
-   if (PG(magic_quotes_runtime)) {
-   buf = php_addslashes(buf, line_len, &len, 1 TSRMLS_CC);
-   line_len = len;
+   if (!buf) {
+   intern->current_line = estrdup("");
+   intern->current_line_len = 0;
+   } else {
+   if (intern->flags & SPL_FILE_OBJECT_DROP_NEW_LINE) {
+   line_len = strcspn(buf, "\r\n");
+   buf[line_len] = '\0';
+   }
+   
+   if (PG(magic_quotes_runtime)) {
+   buf = php_addslashes(buf, line_len, &len, 1 TSRMLS_CC);
+   line_len = len;
+   }
+   
+   intern->current_line = buf;
+   intern->current_line_len = line_len;
}
 
-   intern->current_line = buf;
-   intern->current_line_len = line_len;
-   intern->current_line_num++;
-
return SUCCESS;
 } /* }}} */
 
@@ -976,6 +985,7 @@
if (intern->func_getCurr->common.scope != spl_ce_FileObject) {
zend_call_method_with_0_params(&getThis(), 
Z_OBJCE_P(getThis()), &intern->func_getCurr, "getCurrentLine", &retval);
if (retval) {
+   spl_file_object_free_line(intern TSRMLS_CC);
if (Z_TYPE_P(retval) == IS_STRING) {
intern->current_line = 
estrndup(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
intern->current_line_len = Z_STRLEN_P(retval);
@@ -984,13 +994,22 @@
ZVAL_ZVAL(intern->current_zval, retval, 1, 0);
}
zval_ptr_dtor(&retval);
-   intern->current_line_num++;
}
} else {
spl_file_object_read(intern, silent TSRMLS_CC);
}
 } /* }}} */
 
+static void spl_file_object_rewind(spl_file_object *intern TSRMLS_DC) /* {{{ */
+{
+   if (-1 == php_stream_rewind(intern->stream)) {
+   zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, 
"Cannot rewind file %s", intern->file_name);
+   } else {
+   spl_file_object_free_line(intern TSRMLS_CC);
+   intern->current_line_num = 0;
+   }
+} /* }}} */
+
 static int spl_file_object_open(spl_file_object *intern, int use_include_path, 
int silent TSRMLS_DC) /* {{{ */
 {
intern->context = php_stream_context_from_zval(intern->zcontext, 0);
@@ -1050,12 +1069,7 @@
 {
spl_file_object *intern = 
(spl_file_object*)zend_object_store_get_object(getThis() 

[PHP-CVS] cvs: php-src /tests/classes interface_must_be_implemented.phpt

2005-05-04 Thread Dmitry Stogov
dmitry  Tue May  3 09:46:01 2005 EDT

  Modified files:  
/php-src/tests/classes  interface_must_be_implemented.phpt 
  Log:
  Fixed error message
  
  
http://cvs.php.net/diff.php/php-src/tests/classes/interface_must_be_implemented.phpt?r1=1.5&r2=1.6&ty=u
Index: php-src/tests/classes/interface_must_be_implemented.phpt
diff -u php-src/tests/classes/interface_must_be_implemented.phpt:1.5 
php-src/tests/classes/interface_must_be_implemented.phpt:1.6
--- php-src/tests/classes/interface_must_be_implemented.phpt:1.5Wed Oct 
20 18:36:32 2004
+++ php-src/tests/classes/interface_must_be_implemented.phptTue May  3 
09:46:00 2005
@@ -14,4 +14,4 @@
 
 ?>
 --EXPECTF--
-Fatal error: Class derived_a contains 1 abstract methods and must therefore be 
declared abstract (if_a::f_a) in %s on line %d
+Fatal error: Class derived_a contains 1 abstract method and must therefore be 
declared abstract or implement the remaining methods (if_a::f_a) in %s on line 
%d

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



[PHP-CVS] cvs: php-src /ext/spl/internal fileobject.inc

2005-05-04 Thread Marcus Boerger
helly   Tue May  3 18:28:44 2005 EDT

  Modified files:  
/php-src/ext/spl/internal   fileobject.inc 
  Log:
  - Add another note
  
http://cvs.php.net/diff.php/php-src/ext/spl/internal/fileobject.inc?r1=1.2&r2=1.3&ty=u
Index: php-src/ext/spl/internal/fileobject.inc
diff -u php-src/ext/spl/internal/fileobject.inc:1.2 
php-src/ext/spl/internal/fileobject.inc:1.3
--- php-src/ext/spl/internal/fileobject.inc:1.2 Tue May  3 18:18:19 2005
+++ php-src/ext/spl/internal/fileobject.inc Tue May  3 18:28:44 2005
@@ -265,6 +265,8 @@
 * @note fgetc() will increase the line number when reaing a new line 
char.
 *   This has the effect key() called on a read a new line will 
already
 *   return the increased line number.
+* @note Line counting works as long as you only read the file and do 
not
+*   use fseek().
 */ 
function key()
{

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



[PHP-CVS] cvs: php-src(PHP_5_0) / NEWS

2005-05-04 Thread Rob Richards
rrichards   Tue May  3 18:56:44 2005 EDT

  Modified files:  (Branch: PHP_5_0)
/php-srcNEWS 
  Log:
  BFN
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.365&r2=1.1760.2.366&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.365 php-src/NEWS:1.1760.2.366
--- php-src/NEWS:1.1760.2.365   Tue May  3 04:50:10 2005
+++ php-src/NEWSTue May  3 18:56:41 2005
@@ -10,6 +10,7 @@
 - Fixed ext/mysqli to allocate less memory when fetching bound params
   of type (MEDIUM|LONG)BLOB/(MEDIUM|LONG)TEXT. (Andrey)
 - Fixed memory corruption in ImageTTFText() with 64bit systems. (Andrey)
+- Fixed bug #32930 (class extending DOMDocument doesn't clone properly). (Rob)
 - Fixed bug #32852 (Crash with singleton and __destruct when
   zend.ze1_compatibility_mode = On). (Dmitry)
 - Fixed bug #32813 (parse_url() does not handle scheme-only urls properly). 
(Ilia)

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



[PHP-CVS] cvs: php-src /ext/pgsql pgsql.c

2005-05-04 Thread Ilia Alshanetsky
iliaa   Tue May  3 18:50:02 2005 EDT

  Modified files:  
/php-src/ext/pgsql  pgsql.c 
  Log:
  Prevent double free.
  
  
http://cvs.php.net/diff.php/php-src/ext/pgsql/pgsql.c?r1=1.324&r2=1.325&ty=u
Index: php-src/ext/pgsql/pgsql.c
diff -u php-src/ext/pgsql/pgsql.c:1.324 php-src/ext/pgsql/pgsql.c:1.325
--- php-src/ext/pgsql/pgsql.c:1.324 Wed Apr 13 18:11:35 2005
+++ php-src/ext/pgsql/pgsql.c   Tue May  3 18:50:00 2005
@@ -20,7 +20,7 @@
+--+
  */
  
-/* $Id: pgsql.c,v 1.324 2005/04/13 22:11:35 tony2001 Exp $ */
+/* $Id: pgsql.c,v 1.325 2005/05/03 22:50:00 iliaa Exp $ */
 
 #include 
 
@@ -356,8 +356,11 @@
 static void _php_pgsql_notice_ptr_dtor(void **ptr) 
 {
php_pgsql_notice *notice = (php_pgsql_notice *)*ptr;
-   efree(notice->message);
-   efree(notice);
+   if (notice) {
+   efree(notice->message);
+   efree(notice);
+   notice = NULL;
+   }
 }
 /* }}} */
 

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



[PHP-CVS] cvs: php-src /ext/spl spl.php

2005-05-04 Thread Marcus Boerger
helly   Tue May  3 08:09:26 2005 EDT

  Modified files:  
/php-src/ext/splspl.php 
  Log:
  - Fix speling
  - Add links
  
  
http://cvs.php.net/diff.php/php-src/ext/spl/spl.php?r1=1.47&r2=1.48&ty=u
Index: php-src/ext/spl/spl.php
diff -u php-src/ext/spl/spl.php:1.47 php-src/ext/spl/spl.php:1.48
--- php-src/ext/spl/spl.php:1.47Thu Apr 14 17:02:08 2005
+++ php-src/ext/spl/spl.php Tue May  3 08:09:26 2005
@@ -75,9 +75,9 @@
  *
  * - interface Countable allows to hook into the standard array function 
count().
  *
- * 6) Exceptions
+ * 6) Exception%s
  *
- * SPL provides a set of standard exception classes each meant to indicate a 
+ * SPL provides a set of standard Exception classes each meant to indicate a 
  * certain problem type.
  *
  * - class LogicException   extends Exception
@@ -102,10 +102,12 @@
  * 
  * Some articles about SPL:
  * - http://www.sitepoint.com/article/php5-standard-library/1";>Introducing PHP 
5's Standard Library
+ * - http://www.ramikayyali.com/archives/2005/02/25/iterators";>Iterators in 
PHP5
  * - http://www.phpriot.com/d/articles/php/oop/oop-with-spl-php-5-1/index.html";>Advanced
 OOP with SPL in PHP 5
  * - http://www.devshed.com/c/a/PHP/The-Standard-PHP-Library-Part-1/";>The 
Standard PHP Library, Part 1
+ * - http://www.devshed.com/c/a/PHP/The-Standard-PHP-Library-Part-2/";>The 
Standard PHP Library, Part 2
  *
- * Talks on PL:
+ * Talks on SPL:
  * - http://somabo.de/talks/200504_php_quebec_spl_for_the_masses.pps";>SPL for 
the masses [pps]
  * - http://somabo.de/talks/200504_php_quebec_spl_for_the_masses.pdf";>SPL for 
the masses [pdf]
  *

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



[PHP-CVS] cvs: php-src /ext/standard dl.c

2005-05-04 Thread Anantha Kesari H Y
hyanantha   Wed May  4 09:26:28 2005 EDT

  Modified files:  
/php-src/ext/standard   dl.c 
  Log:
  NetWare LibC dlsym works perfectly only thing that each of the extension need 
to export a symbol with FULL capital prefix.
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/dl.c?r1=1.98&r2=1.99&ty=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.98 php-src/ext/standard/dl.c:1.99
--- php-src/ext/standard/dl.c:1.98  Mon Sep 27 10:51:17 2004
+++ php-src/ext/standard/dl.c   Wed May  4 09:26:28 2005
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.98 2004/09/27 14:51:17 hyanantha Exp $ */
+/* $Id: dl.c,v 1.99 2005/05/04 13:26:28 hyanantha Exp $ */
 
 #include "php.h"
 #include "dl.h"
@@ -145,7 +145,6 @@
 
efree(libpath);
 
-#ifndef NETWARE
get_module = (zend_module_entry *(*)(void)) DL_FETCH_SYMBOL(handle, 
"get_module");
 
/*
@@ -156,23 +155,6 @@
 
if (!get_module)
get_module = (zend_module_entry *(*)(void)) 
DL_FETCH_SYMBOL(handle, "_get_module");
-#else
-   /* NetWare doesn't support two NLMs exporting same symbol */
-   {
-   char symbol_name[64] = "\0";
-   int module_name_length = Z_STRLEN_P(file) - 4;  /* '.nlm' is 4 
characters; knock it off */
-
-   /* Take the module name (e.g.: 'php_ldap') and append 
'@get_module' to it */
-   strncpy(symbol_name, Z_STRVAL_P(file), module_name_length);
-   symbol_name[module_name_length] = '\0';
-   strcat(symbol_name, "@");
-   strcat(symbol_name, "get_module");
-
-   get_module = (zend_module_entry *(*)(void)) 
DL_FETCH_SYMBOL(handle, symbol_name);
-   }
-   /* NetWare doesn't prepend '_' to symbol names; so the corresponding 
portion of code is also
-  not required for NetWare */
-#endif
 
if (!get_module) {
DL_UNLOAD(handle);

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



[PHP-CVS] cvs: php-src /scripts Makefile.frag

2005-05-04 Thread Jani Taskinen
sniper  Tue May  3 07:34:33 2005 EDT

  Modified files:  
/php-src/scriptsMakefile.frag 
  Log:
  - acconfig.h should not be installed. (it is only a template file..)
  
http://cvs.php.net/diff.php/php-src/scripts/Makefile.frag?r1=1.19&r2=1.20&ty=u
Index: php-src/scripts/Makefile.frag
diff -u php-src/scripts/Makefile.frag:1.19 php-src/scripts/Makefile.frag:1.20
--- php-src/scripts/Makefile.frag:1.19  Sat Apr 30 00:27:23 2005
+++ php-src/scripts/Makefile.frag   Tue May  3 07:34:32 2005
@@ -32,7 +32,6 @@
$(INSTALL_DATA) $(BUILD_FILES) $(INSTALL_ROOT)$(phpbuilddir))
 
 HEADER_DIRS = \
-   / \
Zend/ \
TSRM/ \
include/ \

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



[PHP-CVS] cvs: php-src(PHP_5_0) /ext/standard dl.c

2005-05-04 Thread Anantha Kesari H Y
hyanantha   Wed May  4 09:48:02 2005 EDT

  Modified files:  (Branch: PHP_5_0)
/php-src/ext/standard   dl.c 
  Log:
  NetWare LibC dlsym works perfectly only thing that each of the extension need 
to export a symbol with FULL capital prefix.
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/dl.c?r1=1.96.2.2&r2=1.96.2.3&ty=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.96.2.2 php-src/ext/standard/dl.c:1.96.2.3
--- php-src/ext/standard/dl.c:1.96.2.2  Mon Mar 21 03:34:37 2005
+++ php-src/ext/standard/dl.c   Wed May  4 09:48:01 2005
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: dl.c,v 1.96.2.2 2005/03/21 08:34:37 hyanantha Exp $ */
+/* $Id: dl.c,v 1.96.2.3 2005/05/04 13:48:01 hyanantha Exp $ */
 
 #include "php.h"
 #include "dl.h"
@@ -142,7 +142,6 @@
 
efree(libpath);
 
-#ifndef NETWARE
get_module = (zend_module_entry *(*)(void)) DL_FETCH_SYMBOL(handle, 
"get_module");
 
/*
@@ -153,23 +152,6 @@
 
if (!get_module)
get_module = (zend_module_entry *(*)(void)) 
DL_FETCH_SYMBOL(handle, "_get_module");
-#else
-   /* NetWare doesn't support two NLMs exporting same symbol */
-   {
-   char symbol_name[64] = "\0";
-   int module_name_length = Z_STRLEN_P(file) - 4;  /* '.nlm' is 4 
characters; knock it off */
-
-   /* Take the module name (e.g.: 'php_ldap') and append 
'@get_module' to it */
-   strncpy(symbol_name, Z_STRVAL_P(file), module_name_length);
-   symbol_name[module_name_length] = '\0';
-   strcat(symbol_name, "@");
-   strcat(symbol_name, "get_module");
-
-   get_module = (zend_module_entry *(*)(void)) 
DL_FETCH_SYMBOL(handle, symbol_name);
-   }
-   /* NetWare doesn't prepend '_' to symbol names; so the corresponding 
portion of code is also
-  not required for NetWare */
-#endif
 
if (!get_module) {
DL_UNLOAD(handle);

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



[PHP-CVS] cvs: php-src / NEWS

2005-05-04 Thread Stanislav Malyshev
stasWed May  4 12:20:05 2005 EDT

  Modified files:  
/php-srcNEWS 
  Log:
  #32924
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1888&r2=1.1889&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1888 php-src/NEWS:1.1889
--- php-src/NEWS:1.1888 Wed May  4 08:38:48 2005
+++ php-src/NEWSWed May  4 12:20:04 2005
@@ -139,6 +139,7 @@
 - Fixed bug #28969 (Wrong data encoding of special characters). (Dmitry)
 - Fixed bug #28568 (SAPI::known_post_content_types is not thread safe).
   (Moriyoshi)
+- Fixed bug #32924 prepend does not add file to included files (Stas)
 
 13 Jul 2004, PHP 5.0.0
 - Rewritten UNIX and Windows install help files. (Documentation Team)

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



[PHP-CVS] cvs: php-src /tests/lang bug32924.phpt inc.inc

2005-05-04 Thread Stanislav Malyshev
stasWed May  4 12:39:11 2005 EDT

  Added files: 
/php-src/tests/lang bug32924.phpt inc.inc 
  Log:
  add test
  
  

http://cvs.php.net/co.php/php-src/tests/lang/bug32924.phpt?r=1.1&p=1
Index: php-src/tests/lang/bug32924.phpt
+++ php-src/tests/lang/bug32924.phpt
--TEST--
Bug #32924 (prepend does not add file to included files)
--INI--
auto_prepend_file=tests/lang/inc.inc
--FILE--

END
--EXPECT--
Included!
END

http://cvs.php.net/co.php/php-src/tests/lang/inc.inc?r=1.1&p=1
Index: php-src/tests/lang/inc.inc
+++ php-src/tests/lang/inc.inc


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



[PHP-CVS] cvs: php-src /ext/spl spl.php

2005-05-04 Thread Marcus Boerger
helly   Wed May  4 15:14:08 2005 EDT

  Modified files:  
/php-src/ext/splspl.php 
  Log:
  - Update docu
  
http://cvs.php.net/diff.php/php-src/ext/spl/spl.php?r1=1.48&r2=1.49&ty=u
Index: php-src/ext/spl/spl.php
diff -u php-src/ext/spl/spl.php:1.48 php-src/ext/spl/spl.php:1.49
--- php-src/ext/spl/spl.php:1.48Tue May  3 08:09:26 2005
+++ php-src/ext/spl/spl.php Wed May  4 15:14:08 2005
@@ -53,7 +53,7 @@
  * 
  * - class DirectoryIterator implements Iterator
  * - class RecursiveDirectoryIterator extends DirectoryIterator implements 
RecursiveIterator
- * - class FileObject implements RecursiveIterator
+ * - class FileObject implements RecursiveIterator, SeekableIterator
  * 
  * 3) XML
  * 

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