[PHP-CVS-DAILY] cvs: php-src / ChangeLog

2004-04-29 Thread changelog
changelog   Thu Apr 29 20:35:27 2004 EDT

  Modified files:  
/php-srcChangeLog 
  Log:
  ChangeLog update
  
http://cvs.php.net/diff.php/php-src/ChangeLog?r1=1.1613r2=1.1614ty=u
Index: php-src/ChangeLog
diff -u php-src/ChangeLog:1.1613 php-src/ChangeLog:1.1614
--- php-src/ChangeLog:1.1613Wed Apr 28 20:36:02 2004
+++ php-src/ChangeLog   Thu Apr 29 20:35:26 2004
@@ -1,3 +1,35 @@
+2004-04-29  Marcus Boerger  [EMAIL PROTECTED]
+
+* ext/sqlite/CREDITS:
+  An oumlaut doesn't work here, need ASCII only
+
+2004-04-29  Ilia Alshanetsky  [EMAIL PROTECTED]
+
+* (PHP_4_3)
+  NEWS
+  ext/curl/curl.c:
+  MFH: Fixed bug #28196 (missing error constants in cURL extension).
+
+* ext/curl/interface.c:
+  Fixed bug #28196 (missing error constants in cURL extension).
+
+* ext/dom/documentfragment.c
+  ext/msession/reqclient.h
+  ext/oci8/php_oci8.h
+  ext/w32api/w32api.c
+  sapi/milter/php_milter.c:
+  C++ comments.
+
+2004-04-29  Wez Furlong  [EMAIL PROTECTED]
+
+* NEWS:
+  another down...
+
+2004-04-29  Stanislav Malyshev  [EMAIL PROTECTED]
+
+* ZendEngine2/zend_execute.c:
+  Fix bug #27876
+
 2004-04-28  Wez Furlong  [EMAIL PROTECTED]
 
 * ext/com_dotnet/com_extension.c:
@@ -2626,7 +2658,7 @@
 2004-03-18  Pierre-Alain Joye  [EMAIL PROTECTED]
 
 * ext/gd/tests/bug27582_2.phpt:
-  - Fix the test description and $Id: ChangeLog,v 1.1613 2004/04/29 00:36:02 
changelog Exp $
+  - Fix the test description and $Id: ChangeLog,v 1.1614 2004/04/30 00:35:26 
changelog Exp $
 
 2004-03-18  Derick Rethans  [EMAIL PROTECTED]
 


[PHP-CVS-DAILY] cvs: ZendEngine2 / ChangeLog

2004-04-29 Thread changelog
changelog   Thu Apr 29 20:35:30 2004 EDT

  Modified files:  
/ZendEngine2ChangeLog 
  Log:
  ChangeLog update
  
http://cvs.php.net/diff.php/ZendEngine2/ChangeLog?r1=1.460r2=1.461ty=u
Index: ZendEngine2/ChangeLog
diff -u ZendEngine2/ChangeLog:1.460 ZendEngine2/ChangeLog:1.461
--- ZendEngine2/ChangeLog:1.460 Wed Apr 28 20:36:06 2004
+++ ZendEngine2/ChangeLog   Thu Apr 29 20:35:30 2004
@@ -1,3 +1,8 @@
+2004-04-29  Stanislav Malyshev  [EMAIL PROTECTED]
+
+* zend_execute.c:
+  Fix bug #27876
+
 2004-04-28  Marcus Boerger  [EMAIL PROTECTED]
 
 * zend_exceptions.h:
@@ -4523,7 +4528,7 @@
 2003-06-10  Jani Taskinen  [EMAIL PROTECTED]
 
 * zend_multiply.h:
-  - Missing $Id: ChangeLog,v 1.460 2004/04/29 00:36:06 changelog Exp $ tag
+  - Missing $Id: ChangeLog,v 1.461 2004/04/30 00:35:30 changelog Exp $ tag
 
 2003-06-10  James Cox  [EMAIL PROTECTED]
 
@@ -6247,7 +6252,7 @@
   zend_types.h
   zend_variables.c
   zend_variables.h:
-  - Added some missing CVS $Id: ChangeLog,v 1.460 2004/04/29 00:36:06 changelog 
Exp $ tags, headers and footers.
+  - Added some missing CVS $Id: ChangeLog,v 1.461 2004/04/30 00:35:30 changelog 
Exp $ tags, headers and footers.
 
 2003-01-30  Ilia Alshanetsky  [EMAIL PROTECTED]
 


[PHP-CVS] cvs: php-src /ext/spl spl_array.c /ext/spl/tests array_012.phpt

2004-04-29 Thread Marcus Boerger
helly   Thu Apr 29 03:22:02 2004 EDT

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

  Modified files:  
/php-src/ext/splspl_array.c 
  Log:
  - Remove unused variable
  - Respect visibility in count() and add a test for that
  
  
http://cvs.php.net/diff.php/php-src/ext/spl/spl_array.c?r1=1.42r2=1.43ty=u
Index: php-src/ext/spl/spl_array.c
diff -u php-src/ext/spl/spl_array.c:1.42 php-src/ext/spl/spl_array.c:1.43
--- php-src/ext/spl/spl_array.c:1.42Wed Apr 28 17:45:41 2004
+++ php-src/ext/spl/spl_array.c Thu Apr 29 03:22:02 2004
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_array.c,v 1.42 2004/04/28 21:45:41 helly Exp $ */
+/* $Id: spl_array.c,v 1.43 2004/04/29 07:22:02 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -723,18 +723,31 @@
  Return the number of elements in the Iterator. */
 SPL_METHOD(Array, count)
 {
-   long position;
zval *object = getThis();
spl_array_object *intern = 
(spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
HashTable *aht = HASH_OF(intern-array);
HashPosition pos;
+   long cnt;
 
if (!aht) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, Array was modified outside 
object and is no longer an array);
RETURN_LONG(0);
}
 
-   RETURN_LONG(zend_hash_num_elements(aht));
+   if (Z_TYPE_P(intern-array) == IS_OBJECT) {
+   pos = intern-pos;
+   cnt = 0;
+   zend_hash_internal_pointer_reset_ex(aht, intern-pos);
+   while(intern-pos) {
+   cnt++;
+   spl_array_next(intern TSRMLS_CC);
+   }
+   intern-pos = pos;
+   RETURN_LONG(cnt);
+   } else {
+   RETURN_LONG(zend_hash_num_elements(aht));
+   }
+   
 } /* }}} */
 
 /* {{{ proto mixed|NULL ArrayIterator::current()

http://cvs.php.net/co.php/php-src/ext/spl/tests/array_012.phpt?r=1.1p=1
Index: php-src/ext/spl/tests/array_012.phpt
+++ php-src/ext/spl/tests/array_012.phpt
--TEST--
SPL: ArrayIterator::count
--SKIPIF--
?php if (!extension_loaded(spl)) print skip; ?
--FILE--
?php

echo ===Array===\n;

$a = array('zero' = 0, 'one' = 1, 'two' = 2);
$it = new ArrayIterator($a);

var_dump($it-count());
foreach($it as $key = $val)
{
echo $key=$val\n;
var_dump($it-count());
}
var_dump($it-count());

echo ===Object===\n;

class test
{
public $zero = 0;
protected $pro;
public $one = 1;
private $pri;
public $two = 2;
}

$o = new test;
$it = new ArrayIterator($o);

var_dump($it-count());
foreach($it as $key = $val)
{
echo $key=$val\n;
var_dump($it-count());
}
var_dump($it-count());

?
===DONE===
?php exit(0); ?
--EXPECT--
===Array===
int(3)
zero=0
int(3)
one=1
int(3)
two=2
int(3)
int(3)
===Object===
int(3)
zero=0
int(3)
one=1
int(3)
two=2
int(3)
int(3)
===DONE===

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



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

2004-04-29 Thread Marcus Boerger
Hello Jon,

Thursday, April 29, 2004, 12:19:50 AM, you wrote:

 On Wed, Apr 28, 2004 at 09:45:41PM -, Marcus Boerger wrote:

 +/* {{{ proto bool ArrayObject::count()
 + Return the number of elements in the Iterator. */
 +SPL_METHOD(Array, count)
 +{
 +long position;
 +zval *object = getThis();
 +spl_array_object *intern =
 (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
 +HashTable *aht = HASH_OF(intern-array);
 +HashPosition pos;
 +
 +if (!aht) {
 +php_error_docref(NULL TSRMLS_CC, E_NOTICE, Array was modified
 outside object and is no longer an array);
 +RETURN_LONG(0);
 +}
 +
 +RETURN_LONG(zend_hash_num_elements(aht));
 +} /* }}} */
 +
  /* {{{ proto mixed|NULL ArrayIterator::current()
 Return current array entry */
  SPL_METHOD(Array, current)
 
 It looks like both 'long position' and 'HashPosition pos' are unused
 in this function.


Thanks,

that also showed me i have to respect visibility there.

marcus

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



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

2004-04-29 Thread Wez Furlong
wez Thu Apr 29 06:19:16 2004 EDT

  Modified files:  
/php-srcNEWS 
  Log:
  another down...
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1701r2=1.1702ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1701 php-src/NEWS:1.1702
--- php-src/NEWS:1.1701 Sun Apr 25 07:19:57 2004
+++ php-src/NEWSThu Apr 29 06:19:16 2004
@@ -1,6 +1,7 @@
 PHPNEWS
 |||
 ?? ??? 2004, PHP 5 Release Candidate 3
+- Fixed bug #28161 (COM: Array style properties could not be accessed). (Wez)
 - Fixed bug #28125 (ArrayObject leaks when accessing elements). (Marcus)
 - Fixed bug #28099 (ArrayObject doesn't implement ArrayAccess). (Marcus)
 - Fixed bug #27929 (SPL: change visibility of ArrayIterator::__construct).

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



[PHP-CVS] cvs: php-src /ext/dom documentfragment.c /ext/msession reqclient.h /ext/oci8 php_oci8.h /ext/w32api w32api.c /sapi/milter php_milter.c

2004-04-29 Thread Ilia Alshanetsky
iliaa   Thu Apr 29 08:59:23 2004 EDT

  Modified files:  
/php-src/ext/domdocumentfragment.c 
/php-src/ext/oci8   php_oci8.h 
/php-src/ext/w32api w32api.c 
/php-src/ext/msession   reqclient.h 
/php-src/sapi/milterphp_milter.c 
  Log:
  C++ comments.
  
  
http://cvs.php.net/diff.php/php-src/ext/dom/documentfragment.c?r1=1.8r2=1.9ty=u
Index: php-src/ext/dom/documentfragment.c
diff -u php-src/ext/dom/documentfragment.c:1.8 php-src/ext/dom/documentfragment.c:1.9
--- php-src/ext/dom/documentfragment.c:1.8  Wed Mar 31 12:18:59 2004
+++ php-src/ext/dom/documentfragment.c  Thu Apr 29 08:59:22 2004
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: documentfragment.c,v 1.8 2004/03/31 17:18:59 rrichards Exp $ */
+/* $Id: documentfragment.c,v 1.9 2004/04/29 12:59:22 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -63,7 +63,7 @@
if (oldnode != NULL) {
php_libxml_node_free_resource(oldnode  TSRMLS_CC);
}
-   //php_dom_set_object(intern, nodep TSRMLS_CC);
+   /* php_dom_set_object(intern, nodep TSRMLS_CC); */
php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, 
(void *)intern TSRMLS_CC);
}
 }
http://cvs.php.net/diff.php/php-src/ext/oci8/php_oci8.h?r1=1.34r2=1.35ty=u
Index: php-src/ext/oci8/php_oci8.h
diff -u php-src/ext/oci8/php_oci8.h:1.34 php-src/ext/oci8/php_oci8.h:1.35
--- php-src/ext/oci8/php_oci8.h:1.34Thu Jan  8 12:32:33 2004
+++ php-src/ext/oci8/php_oci8.h Thu Apr 29 08:59:22 2004
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: php_oci8.h,v 1.34 2004/01/08 17:32:33 sniper Exp $ */
+/* $Id: php_oci8.h,v 1.35 2004/04/29 12:59:22 iliaa Exp $ */
 
 #if HAVE_OCI8
 # ifndef PHP_OCI8_H
@@ -100,8 +100,8 @@
dvoid *ocidescr;
ub4 type;
int lob_current_position; 
-   int lob_size;  // -1 = Lob wasn't initialized yet
-   int buffering; // 0 - off, 1 - on, 2 - on and buffer was used
+   int lob_size;  /* -1 = Lob wasn't initialized yet */
+   int buffering; /* 0 - off, 1 - on, 2 - on and buffer was used */
 } oci_descriptor;
 
 typedef struct {
http://cvs.php.net/diff.php/php-src/ext/w32api/w32api.c?r1=1.14r2=1.15ty=u
Index: php-src/ext/w32api/w32api.c
diff -u php-src/ext/w32api/w32api.c:1.14 php-src/ext/w32api/w32api.c:1.15
--- php-src/ext/w32api/w32api.c:1.14Wed Feb 25 15:16:27 2004
+++ php-src/ext/w32api/w32api.c Thu Apr 29 08:59:22 2004
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: w32api.c,v 1.14 2004/02/25 20:16:27 abies Exp $ */
+/* $Id: w32api.c,v 1.15 2004/04/29 12:59:22 iliaa Exp $ */
 
 /*
  * Win32 API Extension for PHP
@@ -819,7 +819,7 @@
   FORMAT_MESSAGE_IGNORE_INSERTS,
   NULL,
   GetLastError(),
-  MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), 
// Default language
+  MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), 
/* Default language */
   (LPTSTR)message_buffer,
   0,
   NULL);
@@ -1162,8 +1162,8 @@
int size = 0, i = 0;
FARPROC fp = fh-handle;
 
-   _asm mov stack_pointer, esp // Store stack pointer (esp) in 
stack_pointer
-   _asm sub esp, 0x100 // Give ourselves 256 bytes on 
the stack
+   _asm mov stack_pointer, esp /* Store stack pointer (esp) in 
stack_pointer */
+   _asm sub esp, 0x100 /* Give ourselves 256 bytes on 
the stack */
 
 
for(i = (argc - 1); i = 0; i--)
http://cvs.php.net/diff.php/php-src/ext/msession/reqclient.h?r1=1.13r2=1.14ty=u
Index: php-src/ext/msession/reqclient.h
diff -u php-src/ext/msession/reqclient.h:1.13 php-src/ext/msession/reqclient.h:1.14
--- php-src/ext/msession/reqclient.h:1.13   Tue Jun 10 16:03:32 2003
+++ php-src/ext/msession/reqclient.hThu Apr 29 08:59:23 2004
@@ -107,11 +107,11 @@
 
 typedef struct _requestBuf
 {
-   unsigned int type;  // Type of packet, dynamic/static
-   unsigned int size;  // size of memory block
+   unsigned int type;  /* Type of packet, dynamic/static */
+   unsigned int size;  /* size of memory block */
 #if (REQCLIENT_VER = 030113)
-   unsigned int fmt;   // format, binary/ascii
-   unsigned int reserved;  // Just in case
+   unsigned int fmt;   /* format, binary/ascii */
+   unsigned int reserved;  /* Just in case */
 #else
 #warning You are using an old Phoenix definition, this will have problems with a 
newer version
 #endif

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

2004-04-29 Thread Ilia Alshanetsky
iliaa   Thu Apr 29 12:25:42 2004 EDT

  Modified files:  
/php-src/ext/curl   interface.c 
  Log:
  Fixed bug #28196 (missing error constants in cURL extension).
  
  
http://cvs.php.net/diff.php/php-src/ext/curl/interface.c?r1=1.44r2=1.45ty=u
Index: php-src/ext/curl/interface.c
diff -u php-src/ext/curl/interface.c:1.44 php-src/ext/curl/interface.c:1.45
--- php-src/ext/curl/interface.c:1.44   Mon Mar 22 13:42:03 2004
+++ php-src/ext/curl/interface.cThu Apr 29 12:25:42 2004
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: interface.c,v 1.44 2004/03/22 18:42:03 iliaa Exp $ */
+/* $Id: interface.c,v 1.45 2004/04/29 16:25:42 iliaa Exp $ */
 
 #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
 
@@ -323,6 +323,25 @@
REGISTER_CURL_CONSTANT(CURLE_TELNET_OPTION_SYNTAX);
REGISTER_CURL_CONSTANT(CURLE_OBSOLETE);
REGISTER_CURL_CONSTANT(CURLE_SSL_PEER_CERTIFICATE);
+   REGISTER_CURL_CONSTANT(CURLE_GOT_NOTHING);
+   REGISTER_CURL_CONSTANT(CURLE_SSL_ENGINE_NOTFOUND);
+   REGISTER_CURL_CONSTANT(CURLE_SSL_ENGINE_SETFAILED);
+   REGISTER_CURL_CONSTANT(CURLE_SEND_ERROR);
+   REGISTER_CURL_CONSTANT(CURLE_RECV_ERROR);
+   REGISTER_CURL_CONSTANT(CURLE_SHARE_IN_USE);
+   REGISTER_CURL_CONSTANT(CURLE_SSL_CERTPROBLEM);
+   REGISTER_CURL_CONSTANT(CURLE_SSL_CIPHER);
+   REGISTER_CURL_CONSTANT(CURLE_SSL_CACERT);
+   REGISTER_CURL_CONSTANT(CURLE_BAD_CONTENT_ENCODING);
+#ifdef CURLE_LDAP_INVALID_URL
+   REGISTER_CURL_CONSTANT(CURLE_LDAP_INVALID_URL);
+#endif 
+#ifdef CURLE_FILESIZE_EXCEEDED
+   REGISTER_CURL_CONSTANT(CURLE_FILESIZE_EXCEEDED);
+#endif
+#ifdef CURLE_FTP_SSL_FAILED
+   REGISTER_CURL_CONSTANT(CURLE_FTP_SSL_FAILED);
+#endif
 
REGISTER_CURL_CONSTANT(CURLPROXY_HTTP);
REGISTER_CURL_CONSTANT(CURLPROXY_SOCKS5);

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



[PHP-CVS] cvs: php-src(PHP_4_3) / NEWS /ext/curl curl.c

2004-04-29 Thread Ilia Alshanetsky
iliaa   Thu Apr 29 12:25:55 2004 EDT

  Modified files:  (Branch: PHP_4_3)
/php-srcNEWS 
/php-src/ext/curl   curl.c 
  Log:
  MFH: Fixed bug #28196 (missing error constants in cURL extension).
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1247.2.650r2=1.1247.2.651ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.650 php-src/NEWS:1.1247.2.651
--- php-src/NEWS:1.1247.2.650   Tue Apr 27 15:21:36 2004
+++ php-src/NEWSThu Apr 29 12:25:54 2004
@@ -5,6 +5,7 @@
   then 1 character long. (Ilia)
 - Fixed handling of return values from storred procedures in mssql_execute()
   with multiple result sets returned. (Frank)
+- Fixed bug #28196 (missing error constants in cURL extension). (Ilia)
 - Fixed bug #28187 (parse_url() not handling embedded IPv6 in URLs). (Sara)
 - Fixed bug #28147 (Crash with drawing anti-aliased lines). (Derick)
 - Fixed bug #28112 (sqlite_query() crashing apache on malformed query). (Ilia,
http://cvs.php.net/diff.php/php-src/ext/curl/curl.c?r1=1.124.2.19r2=1.124.2.20ty=u
Index: php-src/ext/curl/curl.c
diff -u php-src/ext/curl/curl.c:1.124.2.19 php-src/ext/curl/curl.c:1.124.2.20
--- php-src/ext/curl/curl.c:1.124.2.19  Fri Mar 26 14:04:17 2004
+++ php-src/ext/curl/curl.c Thu Apr 29 12:25:54 2004
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: curl.c,v 1.124.2.19 2004/03/26 19:04:17 iliaa Exp $ */
+/* $Id: curl.c,v 1.124.2.20 2004/04/29 16:25:54 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -284,6 +284,35 @@
REGISTER_CURL_CONSTANT(CURLE_TELNET_OPTION_SYNTAX);
REGISTER_CURL_CONSTANT(CURLE_OBSOLETE);
REGISTER_CURL_CONSTANT(CURLE_SSL_PEER_CERTIFICATE);
+   REGISTER_CURL_CONSTANT(CURLE_GOT_NOTHING);
+   REGISTER_CURL_CONSTANT(CURLE_SSL_ENGINE_NOTFOUND);
+   REGISTER_CURL_CONSTANT(CURLE_SSL_ENGINE_SETFAILED);
+   REGISTER_CURL_CONSTANT(CURLE_SEND_ERROR);
+   REGISTER_CURL_CONSTANT(CURLE_RECV_ERROR);
+#ifdef CURLE_SHARE_IN_USE
+   REGISTER_CURL_CONSTANT(CURLE_SHARE_IN_USE);
+#endif
+#ifdef CURLE_SSL_CERTPROBLEM
+   REGISTER_CURL_CONSTANT(CURLE_SSL_CERTPROBLEM);
+#endif
+#ifdef CURLE_SSL_CIPHER
+   REGISTER_CURL_CONSTANT(CURLE_SSL_CIPHER);
+#endif
+#ifdef CURLE_SSL_CACERT
+   REGISTER_CURL_CONSTANT(CURLE_SSL_CACERT);
+#endif
+#ifdef CURLE_BAD_CONTENT_ENCODING
+   REGISTER_CURL_CONSTANT(CURLE_BAD_CONTENT_ENCODING);
+#endif 
+#ifdef CURLE_LDAP_INVALID_URL
+   REGISTER_CURL_CONSTANT(CURLE_LDAP_INVALID_URL);
+#endif 
+#ifdef CURLE_FILESIZE_EXCEEDED
+   REGISTER_CURL_CONSTANT(CURLE_FILESIZE_EXCEEDED);
+#endif
+#ifdef CURLE_FTP_SSL_FAILED
+   REGISTER_CURL_CONSTANT(CURLE_FTP_SSL_FAILED);
+#endif
 
REGISTER_CURL_CONSTANT(CURL_NETRC_OPTIONAL);
REGISTER_CURL_CONSTANT(CURL_NETRC_IGNORED);

-- 
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_array.c /ext/spl/examples appenditerator.inc /ext/spl/tests array_013.phpt

2004-04-29 Thread Marcus Boerger
helly   Thu Apr 29 18:25:45 2004 EDT

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

  Modified files:  
/php-src/ext/splspl_array.c 
/php-src/ext/spl/examples   appenditerator.inc 
  Log:
  - ArrayObject::append() must not be called when it refers to an object
  
  
http://cvs.php.net/diff.php/php-src/ext/spl/spl_array.c?r1=1.43r2=1.44ty=u
Index: php-src/ext/spl/spl_array.c
diff -u php-src/ext/spl/spl_array.c:1.43 php-src/ext/spl/spl_array.c:1.44
--- php-src/ext/spl/spl_array.c:1.43Thu Apr 29 03:22:02 2004
+++ php-src/ext/spl/spl_array.c Thu Apr 29 18:25:44 2004
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_array.c,v 1.43 2004/04/29 07:22:02 helly Exp $ */
+/* $Id: spl_array.c,v 1.44 2004/04/29 22:25:44 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -361,14 +361,31 @@
 } /* }}} */
 
 /* {{{ proto bool ArrayObject::append(mixed $newval)
- Appends the value. */
+ Appends the value (cannot be called for objects). */
 SPL_METHOD(Array, append)
 {
+   zval *object = getThis();
+   spl_array_object *intern = 
(spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
+   HashTable *aht = HASH_OF(intern-array);
+
zval *value;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z, value) == FAILURE) {
return;
}
-   spl_array_write_dimension(getThis(), NULL, value TSRMLS_CC);
+
+   if (!aht) {
+   php_error_docref(NULL TSRMLS_CC, E_NOTICE, Array was modified outside 
object and is no longer an array);
+   return;
+   }
+   
+   if (Z_TYPE_P(intern-array) == IS_OBJECT) {
+   php_error_docref(NULL TSRMLS_CC, E_ERROR, Cannot append properties to 
objects, use %s::offsetSet() instead, Z_OBJCE_P(object)-name);
+   }
+
+   spl_array_write_dimension(object, NULL, value TSRMLS_CC);
+   if (!intern-pos) {
+   intern-pos = aht-pListTail;
+   }
 } /* }}} */
 
 /* {{{ proto bool ArrayObject::offsetUnset(mixed $index)
http://cvs.php.net/diff.php/php-src/ext/spl/examples/appenditerator.inc?r1=1.4r2=1.5ty=u
Index: php-src/ext/spl/examples/appenditerator.inc
diff -u php-src/ext/spl/examples/appenditerator.inc:1.4 
php-src/ext/spl/examples/appenditerator.inc:1.5
--- php-src/ext/spl/examples/appenditerator.inc:1.4 Wed Apr 28 17:52:51 2004
+++ php-src/ext/spl/examples/appenditerator.inc Thu Apr 29 18:25:44 2004
@@ -18,11 +18,6 @@
function append(Iterator $it)
{
$this-iterators-append($it);
-   if (!$this-valid())
-   {
-   $this-iterators-seek($this-iterators-count() - 1);
-   $this-iterators-current()-rewind();
-   }
}
 
function getInnerIterator()

http://cvs.php.net/co.php/php-src/ext/spl/tests/array_013.phpt?r=1.1p=1
Index: php-src/ext/spl/tests/array_013.phpt
+++ php-src/ext/spl/tests/array_013.phpt
--TEST--
SPL: ArrayIterator::append
--SKIPIF--
?php if (!extension_loaded(spl)) print skip; ?
--FILE--
?php

if (!class_exists('NoRewindIterator', false))
{
require_once(dirname(__FILE__) . '/../examples/norewinditerator.inc');
}   

echo ===Array===\n;

$a = array(0 = 'zero', 1 = 'one', 2 = 'two');
$it = new ArrayIterator($a);

foreach($it as $key = $val)
{
echo $key=$val\n;
}

echo ===Append===\n;

$it-append('three');
$it-append('four');

foreach(new NoRewindIterator($it) as $key = $val)
{
echo $key=$val\n;
}

echo ===Object===\n;

class test
{
public $zero = 0;
protected $pro;
public $one = 1;
private $pri;
public $two = 2;
}

$o = new test;
$it = new ArrayIterator($o);

foreach($it as $key = $val)
{
echo $key=$val\n;
}

echo ===Append===\n;

$it-append('three');
$it-append('four');

foreach(new NoRewindIterator($it) as $key = $val)
{
echo $key=$val\n;
}

var_dump($o-{0}); /* doesn't wotk anyway */

?
===DONE===
?php exit(0); ?
--EXPECTF--
===Array===
0=zero
1=one
2=two
===Append===
3=three
4=four
===Object===
zero=0
one=1
two=2
===Append===

Fatal error: ArrayIterator::append(): Cannot append properties to objects, use 
ArrayIterator::offsetSet() instead in %sarray_013.php 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 spl.php spl_array.c

2004-04-29 Thread Marcus Boerger
helly   Thu Apr 29 18:52:49 2004 EDT

  Modified files:  
/php-src/ext/splspl.php spl_array.c 
  Log:
  - Fix protos and add notes to the docs
  - Reorder func prototypes to show what is common and what is specific
  
  
http://cvs.php.net/diff.php/php-src/ext/spl/spl.php?r1=1.19r2=1.20ty=u
Index: php-src/ext/spl/spl.php
diff -u php-src/ext/spl/spl.php:1.19 php-src/ext/spl/spl.php:1.20
--- php-src/ext/spl/spl.php:1.19Wed Apr 28 15:58:47 2004
+++ php-src/ext/spl/spl.php Thu Apr 29 18:52:49 2004
@@ -143,10 +143,14 @@
function offsetUnset($index);
 
/** \param $value is appended as last element
+* \warning this method cannot be called when the ArrayObject refers to 
+*  an object.
 */ 
function append($value);
 
/** \return a \b copy of the array
+* \note when the ArrayObject refers to an object then this method 
+*   returns an array of the public properties.
 */ 
function getArrayCopy();
 }
@@ -190,10 +194,14 @@
function offsetUnset($index);
 
/** \param $value is appended as last element
+* \warning this method cannot be called when the ArrayIterator refers to 
+*  an object.
 */ 
function append($value);
 
/** \return a \b copy of the array
+* \note when the ArrayIterator refers to an object then this method 
+*   returns an array of the public properties.
 */ 
function getArrayCopy();
 
http://cvs.php.net/diff.php/php-src/ext/spl/spl_array.c?r1=1.44r2=1.45ty=u
Index: php-src/ext/spl/spl_array.c
diff -u php-src/ext/spl/spl_array.c:1.44 php-src/ext/spl/spl_array.c:1.45
--- php-src/ext/spl/spl_array.c:1.44Thu Apr 29 18:25:44 2004
+++ php-src/ext/spl/spl_array.c Thu Apr 29 18:52:49 2004
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_array.c,v 1.44 2004/04/29 22:25:44 helly Exp $ */
+/* $Id: spl_array.c,v 1.45 2004/04/29 22:52:49 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -77,7 +77,6 @@
 
 static zend_function_entry spl_funcs_ArrayObject[] = {
SPL_ME(Array, __construct,   arginfo_array___construct, ZEND_ACC_PUBLIC)
-   SPL_ME(Array, getIterator,   NULL, ZEND_ACC_PUBLIC)
SPL_ME(Array, offsetExists,  arginfo_array_offsetGet, ZEND_ACC_PUBLIC)
SPL_ME(Array, offsetGet, arginfo_array_offsetGet, ZEND_ACC_PUBLIC)
SPL_ME(Array, offsetSet, arginfo_array_offsetSet, ZEND_ACC_PUBLIC)
@@ -85,24 +84,27 @@
SPL_ME(Array, append,arginfo_array_append,ZEND_ACC_PUBLIC)
SPL_ME(Array, getArrayCopy,  NULL, ZEND_ACC_PUBLIC)
SPL_ME(Array, count, NULL, ZEND_ACC_PUBLIC)
+   /* ArrayObject specific */
+   SPL_ME(Array, getIterator,   NULL, ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
 };
 
 static zend_function_entry spl_funcs_ArrayIterator[] = {
SPL_ME(Array, __construct,   arginfo_array___construct, ZEND_ACC_PUBLIC)
-   SPL_ME(Array, rewind,NULL, ZEND_ACC_PUBLIC)
-   SPL_ME(Array, current,   NULL, ZEND_ACC_PUBLIC)
-   SPL_ME(Array, key,   NULL, ZEND_ACC_PUBLIC)
-   SPL_ME(Array, next,  NULL, ZEND_ACC_PUBLIC)
-   SPL_ME(Array, valid, NULL, ZEND_ACC_PUBLIC)
SPL_ME(Array, offsetExists,  arginfo_array_offsetGet, ZEND_ACC_PUBLIC)
SPL_ME(Array, offsetGet, arginfo_array_offsetGet, ZEND_ACC_PUBLIC)
SPL_ME(Array, offsetSet, arginfo_array_offsetSet, ZEND_ACC_PUBLIC)
SPL_ME(Array, offsetUnset,   arginfo_array_offsetGet, ZEND_ACC_PUBLIC)
SPL_ME(Array, append,arginfo_array_append,ZEND_ACC_PUBLIC)
SPL_ME(Array, getArrayCopy,  NULL, ZEND_ACC_PUBLIC)
-   SPL_ME(Array, seek,  arginfo_array_seek,ZEND_ACC_PUBLIC)
SPL_ME(Array, count, NULL, ZEND_ACC_PUBLIC)
+   /* ArrayIterator specific */
+   SPL_ME(Array, rewind,NULL, ZEND_ACC_PUBLIC)
+   SPL_ME(Array, current,   NULL, ZEND_ACC_PUBLIC)
+   SPL_ME(Array, key,   NULL, ZEND_ACC_PUBLIC)
+   SPL_ME(Array, next,  NULL, ZEND_ACC_PUBLIC)
+   SPL_ME(Array, valid, NULL, ZEND_ACC_PUBLIC)
+   SPL_ME(Array, seek,  arginfo_array_seek,ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
 };
 
@@ -327,6 +329,7 @@
 /* }}} */
 
 /* {{{ proto bool ArrayObject::offsetExists(mixed $index)
+   proto bool ArrayIterator::offsetExists(mixed $index)
  Returns whether the requested $index exists. */
 SPL_METHOD(Array, offsetExists)
 {
@@ -338,6 +341,7 @@
 } /* }}} */
 
 /* {{{ proto bool ArrayObject::offsetGet(mixed $index)
+   proto bool ArrayIterator::offsetGet(mixed $index)
  Returns the value at the specified $index. */
 SPL_METHOD(Array, offsetGet)
 {
@@ -349,7 +353,8 @@
RETURN_ZVAL(value, 0, 1);
 } /* }}} */
 
-/* {{{ proto bool 

[PHP-CVS] cvs: php-src /ext/sqlite CREDITS

2004-04-29 Thread Marcus Boerger
helly   Thu Apr 29 18:57:23 2004 EDT

  Modified files:  
/php-src/ext/sqlite CREDITS 
  Log:
  An oumlaut doesn't work here, need ASCII only
  
http://cvs.php.net/diff.php/php-src/ext/sqlite/CREDITS?r1=1.6r2=1.7ty=u
Index: php-src/ext/sqlite/CREDITS
diff -u php-src/ext/sqlite/CREDITS:1.6 php-src/ext/sqlite/CREDITS:1.7
--- php-src/ext/sqlite/CREDITS:1.6  Sun Mar 28 15:27:18 2004
+++ php-src/ext/sqlite/CREDITS  Thu Apr 29 18:57:23 2004
@@ -1,2 +1,2 @@
 SQLite
-Wez Furlong, Tal Peer, Marcus Börger, Ilia Alshanetsky
+Wez Furlong, Tal Peer, Marcus Boerger, Ilia Alshanetsky

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



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

2004-04-29 Thread Marcus Boerger
helly   Thu Apr 29 19:02:11 2004 EDT

  Modified files:  
/php-src/ext/splphp_spl.c 
  Log:
  SPL is meant to be in uppercase letters, do it now it works
  
http://cvs.php.net/diff.php/php-src/ext/spl/php_spl.c?r1=1.27r2=1.28ty=u
Index: php-src/ext/spl/php_spl.c
diff -u php-src/ext/spl/php_spl.c:1.27 php-src/ext/spl/php_spl.c:1.28
--- php-src/ext/spl/php_spl.c:1.27  Sun Jan 25 12:30:19 2004
+++ php-src/ext/spl/php_spl.c   Thu Apr 29 19:02:11 2004
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_spl.c,v 1.27 2004/01/25 17:30:19 helly Exp $ */
+/* $Id: php_spl.c,v 1.28 2004/04/29 23:02:11 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
#include config.h
@@ -53,7 +53,7 @@
  */
 zend_module_entry spl_module_entry = {
STANDARD_MODULE_HEADER,
-   spl,
+   SPL,
spl_functions,
PHP_MINIT(spl),
PHP_MSHUTDOWN(spl),

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



Re: [PHP-CVS] cvs: php-src /ext/sqlite CREDITS

2004-04-29 Thread Marcus Boerger
Hello internals,

  there are more cases where non ASCII chars are being used. Do we
need to update all credits files and the source file for the credits?

marcus

Friday, April 30, 2004, 12:57:23 AM, you wrote:

 helly Thu Apr 29 18:57:23 2004 EDT

   Modified files:  
 /php-src/ext/sqlite   CREDITS 
   Log:
   An oumlaut doesn't work here, need ASCII only
  
 http://cvs.php.net/diff.php/php-src/ext/sqlite/CREDITS?r1=1.6r2=1.7ty=u
 Index: php-src/ext/sqlite/CREDITS
 diff -u php-src/ext/sqlite/CREDITS:1.6 php-src/ext/sqlite/CREDITS:1.7
 --- php-src/ext/sqlite/CREDITS:1.6Sun Mar 28 15:27:18 2004
 +++ php-src/ext/sqlite/CREDITSThu Apr 29 18:57:23 2004
 @@ -1,2 +1,2 @@
  SQLite
 -Wez Furlong, Tal Peer, Marcus Börger, Ilia Alshanetsky
 +Wez Furlong, Tal Peer, Marcus Boerger, Ilia Alshanetsky




-- 
Best regards,
 Marcusmailto:[EMAIL PROTECTED]

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