helly           Mon Nov 17 00:32:44 2003 EDT

  Modified files:              
    /spl        php_spl.c spl_array.c spl_array.h 
    /spl/tests  array.phpt array_access_001.phpt 
  Log:
  Rename ArrayClass to ArrayObject
  
  
Index: spl/php_spl.c
diff -u spl/php_spl.c:1.17 spl/php_spl.c:1.18
--- spl/php_spl.c:1.17  Sun Nov  9 09:05:34 2003
+++ spl/php_spl.c       Mon Nov 17 00:32:42 2003
@@ -211,7 +211,7 @@
        array_init(return_value);
 
        SPL_ADD_CLASS(ArrayAccess);
-       SPL_ADD_CLASS(ArrayClass);
+       SPL_ADD_CLASS(ArrayObject);
        SPL_ADD_CLASS(ArrayIterator);
        SPL_ADD_CLASS(ArrayRead);
        SPL_ADD_CLASS(DirectoryIterator);
Index: spl/spl_array.c
diff -u spl/spl_array.c:1.23 spl/spl_array.c:1.24
--- spl/spl_array.c:1.23        Mon Nov 17 00:25:47 2003
+++ spl/spl_array.c     Mon Nov 17 00:32:43 2003
@@ -67,7 +67,7 @@
        ZEND_ARG_INFO(0, array)
 ZEND_END_ARG_INFO();
 
-static zend_function_entry spl_funcs_ArrayClass[] = {
+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)
        {NULL, NULL, NULL}
@@ -86,8 +86,8 @@
 zend_class_entry *   spl_ce_ArrayRead;
 zend_class_entry *   spl_ce_ArrayAccess;
 
-zend_object_handlers spl_handler_ArrayClass;
-zend_class_entry *   spl_ce_ArrayClass;
+zend_object_handlers spl_handler_ArrayObject;
+zend_class_entry *   spl_ce_ArrayObject;
 
 zend_object_handlers spl_handler_ArrayIterator;
 zend_class_entry *   spl_ce_ArrayIterator;
@@ -141,7 +141,7 @@
        if (class_type == spl_ce_ArrayIterator) {
                retval.handlers = &spl_handler_ArrayIterator;
        } else {
-               retval.handlers = &spl_handler_ArrayClass;
+               retval.handlers = &spl_handler_ArrayObject;
        }
        return retval;
 }
@@ -315,19 +315,19 @@
        REGISTER_SPL_INTERFACE(ArrayAccess);
        zend_class_implements(spl_ce_ArrayAccess TSRMLS_CC, 1, spl_ce_ArrayRead);
 
-       REGISTER_SPL_STD_CLASS_EX(ArrayClass, spl_array_object_new, 
spl_funcs_ArrayClass);
-       zend_class_implements(spl_ce_ArrayClass TSRMLS_CC, 1, zend_ce_aggregate);
-       memcpy(&spl_handler_ArrayClass, zend_get_std_object_handlers(), 
sizeof(zend_object_handlers));
-       spl_handler_ArrayClass.clone_obj = spl_array_object_clone;
-       spl_handler_ArrayClass.read_dimension = spl_array_read_dimension;
-       spl_handler_ArrayClass.write_dimension = spl_array_write_dimension;
-       spl_handler_ArrayClass.unset_dimension = spl_array_unset_dimension;
-       spl_handler_ArrayClass.has_dimension = spl_array_has_dimension;
-       spl_handler_ArrayClass.get_properties = spl_array_get_properties;
+       REGISTER_SPL_STD_CLASS_EX(ArrayObject, spl_array_object_new, 
spl_funcs_ArrayObject);
+       zend_class_implements(spl_ce_ArrayObject TSRMLS_CC, 1, zend_ce_aggregate);
+       memcpy(&spl_handler_ArrayObject, zend_get_std_object_handlers(), 
sizeof(zend_object_handlers));
+       spl_handler_ArrayObject.clone_obj = spl_array_object_clone;
+       spl_handler_ArrayObject.read_dimension = spl_array_read_dimension;
+       spl_handler_ArrayObject.write_dimension = spl_array_write_dimension;
+       spl_handler_ArrayObject.unset_dimension = spl_array_unset_dimension;
+       spl_handler_ArrayObject.has_dimension = spl_array_has_dimension;
+       spl_handler_ArrayObject.get_properties = spl_array_get_properties;
 
        REGISTER_SPL_STD_CLASS_EX(ArrayIterator, spl_array_object_new, 
spl_funcs_ArrayIterator);
        zend_class_implements(spl_ce_ArrayIterator TSRMLS_CC, 1, zend_ce_iterator);
-       memcpy(&spl_handler_ArrayIterator, &spl_handler_ArrayClass, 
sizeof(zend_object_handlers));
+       memcpy(&spl_handler_ArrayIterator, &spl_handler_ArrayObject, 
sizeof(zend_object_handlers));
 
        return SUCCESS;
 }
@@ -368,8 +368,8 @@
 }
 /* }}} */
 
-/* {{{ proto spl_array_it|NULL ArrayClass::getIterator()
-   Create a new iterator from a ArrayClass instance */
+/* {{{ proto spl_array_it|NULL ArrayObject::getIterator()
+   Create a new iterator from a ArrayObject instance */
 SPL_METHOD(Array, getIterator)
 {
        zval *object = getThis();
Index: spl/spl_array.h
diff -u spl/spl_array.h:1.5 spl/spl_array.h:1.6
--- spl/spl_array.h:1.5 Sun Nov  9 09:05:35 2003
+++ spl/spl_array.h     Mon Nov 17 00:32:43 2003
@@ -24,7 +24,7 @@
 
 extern zend_class_entry *spl_ce_ArrayRead;
 extern zend_class_entry *spl_ce_ArrayAccess;
-extern zend_class_entry *spl_ce_ArrayClass;
+extern zend_class_entry *spl_ce_ArrayObject;
 extern zend_class_entry *spl_ce_ArrayIterator;
 
 PHP_MINIT_FUNCTION(spl_array);
Index: spl/tests/array.phpt
diff -u spl/tests/array.phpt:1.3 spl/tests/array.phpt:1.4
--- spl/tests/array.phpt:1.3    Sat Sep 20 08:51:20 2003
+++ spl/tests/array.phpt        Mon Nov 17 00:32:43 2003
@@ -6,7 +6,7 @@
 <?php
 
 $ar = array(0=>0, 1=>1);
-$ar = new spl_array($ar);
+$ar = new ArrayObject($ar);
 
 var_dump($ar);
 
@@ -33,7 +33,7 @@
 echo "Done\n";
 ?>
 --EXPECTF--
-object(spl_array)#1 (2) {
+object(ArrayObject)#1 (2) {
   [0]=>
   int(0)
   [1]=>
@@ -56,7 +56,7 @@
   int(5)
 }
 string(1) "a"
-object(spl_array)#1 (5) {
+object(ArrayObject)#1 (5) {
   [0]=>
   int(0)
   [1]=>
@@ -79,7 +79,7 @@
 Notice: Undefined offset:  7 in %sarray.php on line %d
 
 Notice: Undefined index:  c in %sarray.php on line %d
-object(spl_array)#1 (2) {
+object(ArrayObject)#1 (2) {
   [0]=>
   int(0)
   [2]=>
Index: spl/tests/array_access_001.phpt
diff -u spl/tests/array_access_001.phpt:1.4 spl/tests/array_access_001.phpt:1.5
--- spl/tests/array_access_001.phpt:1.4 Mon Aug  4 17:56:05 2003
+++ spl/tests/array_access_001.phpt     Mon Nov 17 00:32:43 2003
@@ -3,11 +3,11 @@
 --SKIPIF--
 <?php
        if (!extension_loaded("spl")) die("skip");
-       if (!in_array("spl_array_access", spl_classes())) die("skip spl_array_access 
not present");
+       if (!in_array("ArrayAccess", spl_classes())) die("skip spl_array_access not 
present");
 ?>
 --FILE--
 <?php
-class c implements spl_array_access {
+class c implements ArrayAccess {
 
        public $a = array('1st', 1, 2=>'3rd', '4th'=>4);
        function exists($index) {
@@ -132,32 +132,32 @@
 string(9) "changed 6"
 string(9) "changed 6"
 ===unset===
-array(6) {
-  [0]=>
-  string(3) "1st"
-  [1]=>
-  string(9) "Changed 1"
-  [2]=>
-  string(3) "3rd"
-  ["4th"]=>
-  string(11) "Changed 4th"
-  ["5th"]=>
-  string(9) "Added 5th"
-  [6]=>
-  string(9) "changed 6"
-}
-c::del(2)
-c::del(4th)
-c::del(7)
-c::del(8th)
-array(4) {
-  [0]=>
-  string(3) "1st"
-  [1]=>
-  string(9) "Changed 1"
-  ["5th"]=>
-  string(9) "Added 5th"
-  [6]=>
-  string(9) "changed 6"
+array(6) {
+  [0]=>
+  string(3) "1st"
+  [1]=>
+  string(9) "Changed 1"
+  [2]=>
+  string(3) "3rd"
+  ["4th"]=>
+  string(11) "Changed 4th"
+  ["5th"]=>
+  string(9) "Added 5th"
+  [6]=>
+  string(9) "changed 6"
+}
+c::del(2)
+c::del(4th)
+c::del(7)
+c::del(8th)
+array(4) {
+  [0]=>
+  string(3) "1st"
+  [1]=>
+  string(9) "Changed 1"
+  ["5th"]=>
+  string(9) "Added 5th"
+  [6]=>
+  string(9) "changed 6"
 }
 Done


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

Reply via email to