On Monday 25 April 2005 8:29 pm, Marcus Boerger wrote:

> Of course, send them over as a .txt attachment (diff -u) or pot them
> online somewhere.
>
> best regards
> marcus

Diffs attached.

Duncan
[EMAIL PROTECTED] Zend]# diff -u zend_reflection_api.c zend_reflection_api.c.new
--- zend_reflection_api.c       2005-04-26 10:43:25.045909096 +0100
+++ zend_reflection_api.c.new   2005-04-26 10:43:13.243703304 +0100
@@ -19,7 +19,7 @@
    +----------------------------------------------------------------------+
 */

-/* $Id: zend_reflection_api.c,v 1.152 2005/04/25 05:13:36 sebastian Exp $ */
+/* $Id: zend_reflection_api.c,v 1.151 2005/04/19 22:04:59 helly Exp $ */
 #include "zend.h"
 #include "zend_API.h"
 #include "zend_exceptions.h"
@@ -141,6 +141,8 @@
 typedef struct _property_reference {
        zend_class_entry *ce;
        zend_property_info *prop;
+       char *doc_comment;
+       int doc_comment_len;
 } property_reference;

 /* Struct for parameters */
@@ -2576,7 +2578,7 @@
 /* }}} */

 /* {{{ proto public ReflectionMethod ReflectionClass::getMethod(string name) 
throws ReflectionException
-   Returns the class' method specified by its name */
+   Returns the class' method specified by it's name */
 ZEND_METHOD(reflection_class, getMethod)
 {
        reflection_object *intern;
@@ -2672,7 +2674,7 @@
 /* }}} */

 /* {{{ proto public ReflectionProperty ReflectionClass::getProperty(string 
name) throws ReflectionException
-   Returns the class' property specified by its name */
+   Returns the class' property specified by it's name */
 ZEND_METHOD(reflection_class, getProperty)
 {
        reflection_object *intern;
@@ -3216,12 +3218,18 @@
                        "Property %s::$%s does not exist", ce->name, name_str);
                return;
        }
+       reference = (property_reference*) emalloc(sizeof(property_reference));
+       /**
+        * We want the docComment from the original property, so set it here
+        **/
+       reference->doc_comment = property_info->doc_comment;
+       reference->doc_comment_len = property_info->doc_comment_len;

        if (!(property_info->flags & ZEND_ACC_PRIVATE)) {
-               /* we have to seach the class hierarchy for this (implicit) 
public or protected property */
-               zend_class_entry *tmp_ce = ce->parent;
-               zend_property_info *tmp_info;
-
+                /* we have to seach the class hierarchy for this (implicit) 
public or protected property */
+                zend_class_entry *tmp_ce = ce->parent;
+                zend_property_info *tmp_info;
+
                while (tmp_ce && zend_hash_find(&tmp_ce->properties_info, 
name_str, name_len + 1, (void **) &tmp_info) == SUCCESS) {
                        if (tmp_info->flags & ZEND_ACC_PRIVATE) {
                                /* private in super class => NOT the same 
property */
@@ -3230,7 +3238,7 @@
                        ce = tmp_ce;
                        property_info = tmp_info;
                        tmp_ce = tmp_ce->parent;
-               }
+                }
        }

        MAKE_STD_ZVAL(classname);
@@ -3242,7 +3250,6 @@
        ZVAL_STRING(propname, prop_name, 1);
        zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) 
&propname, sizeof(zval *), NULL);

-       reference = (property_reference*) emalloc(sizeof(property_reference));
        reference->ce = ce;
        reference->prop = property_info;
        intern->ptr = reference;
@@ -3464,8 +3471,8 @@

        METHOD_NOTSTATIC_NUMPARAMS(0);
        GET_REFLECTION_OBJECT_PTR(ref);
-       if (ref->prop->doc_comment) {
-               RETURN_STRINGL(ref->prop->doc_comment, 
ref->prop->doc_comment_len, 1);
+       if (ref->doc_comment) {
+               RETURN_STRINGL(ref->doc_comment, ref->doc_comment_len, 1);
        }
        RETURN_FALSE;
 }

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to