helly           Wed Jun  7 09:26:11 2006 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/reflection     php_reflection.c 
  Log:
  - MFH Add ReflectionClass::getInterfaceNames()
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/reflection/php_reflection.c?r1=1.164.2.33.2.4&r2=1.164.2.33.2.5&diff_format=u
Index: php-src/ext/reflection/php_reflection.c
diff -u php-src/ext/reflection/php_reflection.c:1.164.2.33.2.4 
php-src/ext/reflection/php_reflection.c:1.164.2.33.2.5
--- php-src/ext/reflection/php_reflection.c:1.164.2.33.2.4      Sun Jun  4 
10:26:55 2006
+++ php-src/ext/reflection/php_reflection.c     Wed Jun  7 09:26:11 2006
@@ -20,7 +20,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: php_reflection.c,v 1.164.2.33.2.4 2006/06/04 10:26:55 helly Exp $ */
+/* $Id: php_reflection.c,v 1.164.2.33.2.5 2006/06/07 09:26:11 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -3416,6 +3416,26 @@
 }
 /* }}} */
 
+/* {{{ proto public String[] ReflectionClass::getInterfaceNames()
+   Returns an array of names of interfaces this class implements */
+ZEND_METHOD(reflection_class, getInterfaceNames)
+{
+       reflection_object *intern;
+       zend_class_entry *ce;
+       zend_uint i;
+
+       METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0);
+       GET_REFLECTION_OBJECT_PTR(ce);
+
+       /* Return an empty array if this class implements no interfaces */
+       array_init(return_value);
+
+       for (i=0; i < ce->num_interfaces; i++) {
+               add_next_index_stringl(return_value, ce->interfaces[i]->name, 
ce->interfaces[i]->name_length, 1);
+       }
+}
+/* }}} */
+
 /* {{{ proto public ReflectionClass ReflectionClass::getParentClass()
    Returns the class' parent class, or, if none exists, FALSE */
 ZEND_METHOD(reflection_class, getParentClass)
@@ -4290,6 +4310,7 @@
        ZEND_ME(reflection_class, getConstants, NULL, 0)
        ZEND_ME(reflection_class, getConstant, NULL, 0)
        ZEND_ME(reflection_class, getInterfaces, NULL, 0)
+       ZEND_ME(reflection_class, getInterfaceNames, NULL, 0)
        ZEND_ME(reflection_class, isInterface, NULL, 0)
        ZEND_ME(reflection_class, isAbstract, NULL, 0)
        ZEND_ME(reflection_class, isFinal, NULL, 0)
@@ -4484,7 +4505,7 @@
        php_info_print_table_start();
        php_info_print_table_header(2, "Reflection", "enabled");
 
-       php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 
1.164.2.33.2.4 2006/06/04 10:26:55 helly Exp $");
+       php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 
1.164.2.33.2.5 2006/06/07 09:26:11 helly Exp $");
 
        php_info_print_table_end();
 } /* }}} */

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

Reply via email to