dmitry          Thu Dec 27 13:10:20 2007 UTC

  Added files:                 (Branch: PHP_5_3)
    /php-src/ext/soap/tests     server030.phpt server030.wsdl 

  Modified files:              
    /php-src    NEWS 
    /php-src/ext/soap   php_encoding.c 
  Log:
  Added ability to use SplArrays instead of plain arrays in ext/soap. (Joshua 
Reese, Dmitry)
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.60&r2=1.2027.2.547.2.965.2.61&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.60 
php-src/NEWS:1.2027.2.547.2.965.2.61
--- php-src/NEWS:1.2027.2.547.2.965.2.60        Tue Dec 25 18:54:29 2007
+++ php-src/NEWS        Thu Dec 27 13:10:20 2007
@@ -1,6 +1,8 @@
 PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 20??, PHP 5.3.0
+- Added ability to use SplArrays instead of plain arrays in ext/soap.
+  (Joshua Reese, Dmitry)
 - Added "?:" operator. (Marcus)
 - Added stream_supports_lock() function. (Benjamin Schulz)
 - Added msg_queue_exists() function. (Benjamin Schulz)
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_encoding.c?r1=1.103.2.21.2.37.2.3&r2=1.103.2.21.2.37.2.4&diff_format=u
Index: php-src/ext/soap/php_encoding.c
diff -u php-src/ext/soap/php_encoding.c:1.103.2.21.2.37.2.3 
php-src/ext/soap/php_encoding.c:1.103.2.21.2.37.2.4
--- php-src/ext/soap/php_encoding.c:1.103.2.21.2.37.2.3 Wed Oct 17 12:09:02 2007
+++ php-src/ext/soap/php_encoding.c     Thu Dec 27 13:10:20 2007
@@ -17,7 +17,7 @@
   |          Dmitry Stogov <[EMAIL PROTECTED]>                             |
   +----------------------------------------------------------------------+
 */
-/* $Id: php_encoding.c,v 1.103.2.21.2.37.2.3 2007/10/17 12:09:02 dmitry Exp $ 
*/
+/* $Id: php_encoding.c,v 1.103.2.21.2.37.2.4 2007/12/27 13:10:20 dmitry Exp $ 
*/
 
 #include <time.h>
 
@@ -27,6 +27,10 @@
 #include <libxml/parserInternals.h>
 #include "zend_strtod.h"
 
+#ifdef HAVE_SPL
+# include "ext/spl/spl_array.h"
+#endif
+
 /* zval type decode */
 static zval *to_zval_double(encodeTypePtr type, xmlNodePtr data);
 static zval *to_zval_long(encodeTypePtr type, xmlNodePtr data);
@@ -2238,7 +2242,9 @@
        int dimension = 1;
        int* dims;
        int soap_version;
-
+#ifdef HAVE_SPL
+       zval *array_copy = NULL;
+#endif
        TSRMLS_FETCH();
 
        soap_version = SOAP_GLOBAL(soap_version);
@@ -2258,6 +2264,18 @@
                return xmlParam;
        }
 
+#ifdef HAVE_SPL
+       if (Z_TYPE_P(data) == IS_OBJECT && 
(instanceof_function(Z_OBJCE_P(data), spl_ce_ArrayObject TSRMLS_CC) || 
instanceof_function(Z_OBJCE_P(data), spl_ce_ArrayIterator TSRMLS_CC))) {
+               zval getArray;
+            
+               ZVAL_STRING(&getArray, "getArrayCopy", 0);
+               call_user_function_ex(NULL, &data, &getArray, &array_copy, 0, 
0, 0, NULL TSRMLS_CC);        
+               if (Z_TYPE_P(array_copy) == IS_ARRAY) {
+                       data = array_copy;
+               }
+       }
+#endif
+
        if (Z_TYPE_P(data) == IS_ARRAY) {
                sdlAttributePtr *arrayType;
                sdlExtraAttributePtr *ext;
@@ -2435,6 +2453,13 @@
                        set_ns_and_type(xmlParam, type);
                }
        }
+
+#ifdef HAVE_SPL
+       if (array_copy) {
+               zval_ptr_dtor(&array_copy);
+       }
+#endif
+
        return xmlParam;
 }
 

http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/server030.phpt?view=markup&rev=1.1
Index: php-src/ext/soap/tests/server030.phpt
+++ php-src/ext/soap/tests/server030.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/server030.wsdl?view=markup&rev=1.1
Index: php-src/ext/soap/tests/server030.wsdl
+++ php-src/ext/soap/tests/server030.wsdl

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

Reply via email to