nlopess         Sun Feb 11 16:07:31 2007 UTC

  Added files:                 (Branch: PHP_5_2)
    /php-src/ext/tidy/tests     028.phpt 

  Modified files:              
    /php-src    NEWS 
    /php-src/ext/tidy   tidy.c 
  Log:
  merge the tidyNode::getParent() patch from HEAD
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.530&r2=1.2027.2.547.2.531&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.530 php-src/NEWS:1.2027.2.547.2.531
--- php-src/NEWS:1.2027.2.547.2.530     Sun Feb 11 11:11:48 2007
+++ php-src/NEWS        Sun Feb 11 16:07:30 2007
@@ -4,6 +4,7 @@
 - Upgraded SQLite 3 to version 3.3.12 (Ilia)
 - Upgraded PCRE to version 7.0 (Nuno)
 - Add --ri switch to CLI which allows to check extension information. (Marcus)
+- Added tidyNode::getParent() method (John, Nuno)
 - Fixed bug #40431 (dynamic properties may cause crash in ReflectionProperty 
   methods). (Tony)
 - Fixed bug #40428, imagepstext() doesn't accept optional parameter (Pierre)
http://cvs.php.net/viewvc.cgi/php-src/ext/tidy/tidy.c?r1=1.66.2.8.2.21&r2=1.66.2.8.2.22&diff_format=u
Index: php-src/ext/tidy/tidy.c
diff -u php-src/ext/tidy/tidy.c:1.66.2.8.2.21 
php-src/ext/tidy/tidy.c:1.66.2.8.2.22
--- php-src/ext/tidy/tidy.c:1.66.2.8.2.21       Tue Jan 23 19:23:29 2007
+++ php-src/ext/tidy/tidy.c     Sun Feb 11 16:07:30 2007
@@ -16,7 +16,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: tidy.c,v 1.66.2.8.2.21 2007/01/23 19:23:29 nlopess Exp $ */
+/* $Id: tidy.c,v 1.66.2.8.2.22 2007/02/11 16:07:30 nlopess Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -267,6 +267,7 @@
 static TIDY_NODE_METHOD(isJste);
 static TIDY_NODE_METHOD(isAsp);
 static TIDY_NODE_METHOD(isPhp);
+static TIDY_NODE_METHOD(getParent);
 /* }}} */
 
 ZEND_DECLARE_MODULE_GLOBALS(tidy)
@@ -341,6 +342,7 @@
        TIDY_NODE_ME(isJste, NULL)
        TIDY_NODE_ME(isAsp, NULL)
        TIDY_NODE_ME(isPhp, NULL)
+       TIDY_NODE_ME(getParent, NULL)
        {NULL, NULL, NULL}
 };
 
@@ -990,7 +992,7 @@
        php_info_print_table_start();
        php_info_print_table_header(2, "Tidy support", "enabled");
        php_info_print_table_row(2, "libTidy Release", (char 
*)tidyReleaseDate());
-       php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.66.2.8.2.21 2007/01/23 19:23:29 
nlopess Exp $)");
+       php_info_print_table_row(2, "Extension Version", 
PHP_TIDY_MODULE_VERSION " ($Id: tidy.c,v 1.66.2.8.2.22 2007/02/11 16:07:30 
nlopess Exp $)");
        php_info_print_table_end();
 
        DISPLAY_INI_ENTRIES();
@@ -1659,6 +1661,29 @@
 }
 /* }}} */
 
+/* {{{ proto tidyNode tidyNode::getParent()
+   Returns the parent node if available or NULL */
+static TIDY_NODE_METHOD(getParent)
+{
+       TidyNode        parent_node;
+       PHPTidyObj *newobj;
+       TIDY_FETCH_ONLY_OBJECT;
+
+       parent_node = tidyGetParent(obj->node);
+       if(parent_node) {
+               tidy_instanciate(tidy_ce_node, return_value TSRMLS_CC);
+               newobj = (PHPTidyObj *) 
zend_object_store_get_object(return_value TSRMLS_CC);
+               newobj->node = parent_node;
+               newobj->type = is_node;
+               newobj->ptdoc = obj->ptdoc;
+               newobj->ptdoc->ref_count++;
+               tidy_add_default_properties(newobj, is_node TSRMLS_CC);
+       } else {
+               ZVAL_NULL(return_value);
+       }
+}
+/* }}} */
+
 static void _php_tidy_register_nodetypes(INIT_FUNC_ARGS)
 {
        TIDY_NODE_CONST(ROOT, Root);

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

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

Reply via email to