[Patch] tidy node and getParent

php.internals

Markus Fischer

21 years ago
Hi, attached is a patch to add the getParent() method for the tidyNode against HEAD. It's just a quick patch for me. I don't know if all tidy version support the getTidyParent function and if it's memory leak free so someone should review it first. cheers, - Markus

John Coggeshall

21 years ago
I'll take a look at it and commit if it looks good. John On Fri, 2005-07-15 at 12:09 +0200, Markus Fischer wrote:

Andi Gutmans

21 years ago
We're in a feature freeze so please hold it to after 5.1.0 is out the door. You'll be able to commit to head when RC1 is branched off. Thanks, Andi At 01:31 PM 7/15/2005 -0400, John Coggeshall wrote:

Markus Fischer

21 years ago
I've created a bug report ( http://bugs.php.net/34023 ) so it doesn't get forgotten. - Markus Andi Gutmans wrote:

Markus Fischer

21 years ago
Hi, can this be taken into consideration for HEAD now that RC1 is out of the door? thanks, - Markus Andi Gutmans wrote:

Andi Gutmans

21 years ago
Hey Markus, As we're waiting for Wez to commit fixes, and this patch is just adding a new function (and not messing with existing functionality), I think it's OK to include... We'll have to roll RC2. Rasmus, Wez - Any idea about timing for PDO? Are all these bugs crucial to fix for 5.1? Andi At 12:20 PM 8/31/2005, Markus Fischer wrote:

John Coggeshall

21 years ago
I seem to have lost the patch, can someone send it to me again and I'll apply it? Andi it's okay I include this in 5.1? John On Thu, 2005-09-01 at 21:52 -0700, Andi Gutmans wrote:

Rasmus Lerdorf

21 years ago
Andi Gutmans wrote:
> Hey Markus, > > As we're waiting for Wez to commit fixes, and this patch is just adding > a new function (and not messing with existing functionality), I think > it's OK to include... > We'll have to roll RC2. > Rasmus, Wez - Any idea about timing for PDO? Are all these bugs crucial > to fix for 5.1?
I still think #34199 needs to be fixed. We have already analyzed it and the fix seems straightforward. I was hoping Stas would fix it since it is in his code. As for the PDO ones. I went through them today. I really don't have anybody to look at the Windows-related problems. But of the non-Windows ones I see: #33533 - Informix (we have no Informix experience) #33707 - Oracle #33876 - PostgreSQL (not sure this one is fixable in PHP) #33970 - MySQL #34185 - SQLite (can someone reproduce this one?) #34203 - PostgreSQL #34233 - PostgreSQL (reproduce?) #34235 - (Markus?) #34270 - Which DB? (reproduce?) So I can try to get someone to look at #33707, #33970, and #34203. The others either don't have enough info or I plain don't understand them well enough to get someone up to speed on how to fix them. -Rasmus

Wez Furlong

21 years ago
On 9/2/05, Andi Gutmans <andi@zend.com> wrote:
> Rasmus, Wez - Any idea about timing for PDO? Are all these bugs > crucial to fix for 5.1?
Yeah. I don't anticipate each bug as taking a long time to fix, it's just finding the time to do it. Although we have a long weekend this weekend, we have family visiting us and decorating to do (not my idea, but...) I'll see if I can squeeze some bug fixes in this weekend (and next), but I think I'm going to be really limited on time until php|works. --Wez.

Markus Fischer

20 years ago
Hi, any chance for http://bugs.php.net/bug.php?id=34023 this time? thanks, - Markus Markus Fischer wrote:

Jani Taskinen

20 years ago
If the patch was downloadable somewhere, I bet someone had already committed it. :) --Jani On Wed, 14 Dec 2005, Markus Fischer wrote:
> > Hi, > > any chance for http://bugs.php.net/bug.php?id=34023 this time? > > thanks, > - Markus > > Markus Fischer wrote: >> Hi, >> >> can this be taken into consideration for HEAD now that RC1 is out of the >> door? >> >> thanks, >> - Markus >> >> Andi Gutmans wrote: >> >>> We're in a feature freeze so please hold it to after 5.1.0 is out the door. >>> You'll be able to commit to head when RC1 is branched off. >>> >>> Thanks, >>> Andi >>> >>> At 01:31 PM 7/15/2005 -0400, John Coggeshall wrote: >>> >>>> I'll take a look at it and commit if it looks good. >>>> >>>> John >>>> >>>> On Fri, 2005-07-15 at 12:09 +0200, Markus Fischer wrote: >>>> > Hi, >>>> > >>>> > attached is a patch to add the getParent() method for the tidyNode >>>> > against HEAD. >>>> > >>>> > It's just a quick patch for me. I don't know if all tidy version support >>>> > the getTidyParent function and if it's memory leak free so someone >>>> > should review it first. >>>> > >>>> > cheers, >>>> > - Markus >>>> > plain text document attachment (tidy_getParent.diff.txt) >>>> > ? tidy_getParent.diff.txt >>>> > Index: php_tidy.h >>>> > =================================================================== >>>> > RCS file: /repository/php-src/ext/tidy/php_tidy.h,v >>>> > retrieving revision 1.25 >>>> > diff -u -r1.25 php_tidy.h >>>> > --- php_tidy.h 25 Apr 2005 20:46:16 -0000 1.25 >>>> > +++ php_tidy.h 15 Jul 2005 09:59:44 -0000 >>>> > @@ -89,6 +89,7 @@ >>>> > TIDY_NODE_METHOD(isJste); >>>> > TIDY_NODE_METHOD(isAsp); >>>> > TIDY_NODE_METHOD(isPhp); >>>> > +TIDY_NODE_METHOD(getParent); >>>> > >>>> > ZEND_BEGIN_MODULE_GLOBALS(tidy) >>>> > char *default_config; >>>> > Index: tidy.c >>>> > =================================================================== >>>> > RCS file: /repository/php-src/ext/tidy/tidy.c,v >>>> > retrieving revision 1.65 >>>> > diff -u -r1.65 tidy.c >>>> > --- tidy.c 25 Apr 2005 20:46:16 -0000 1.65 >>>> > +++ tidy.c 15 Jul 2005 09:59:45 -0000 >>>> > @@ -291,6 +291,7 @@ >>>> > TIDY_NODE_ME(isJste, NULL) >>>> > TIDY_NODE_ME(isAsp, NULL) >>>> > TIDY_NODE_ME(isPhp, NULL) >>>> > + TIDY_NODE_ME(getParent, NULL) >>>> > {NULL, NULL, NULL} >>>> > }; >>>> > >>>> > @@ -1668,6 +1669,30 @@ >>>> > } >>>> > /* }}} */ >>>> > >>>> > +/* {{{ proto boolean tidyNode::getParent() >>>> > + Returns the parent node if available or NULL */ >>>> > +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); >>>> > >>>> > -- >>>> > PHP Internals - PHP Runtime Development Mailing List >>>> > To unsubscribe, visit: http://www.php.net/unsub.php >>>> >>>> -- >>>> PHP Internals - PHP Runtime Development Mailing List >>>> To unsubscribe, visit: http://www.php.net/unsub.php >>> >>> >>> >>> >> > >
-- Give me your money at @ <http://pecl.php.net/wishlist.php/sniper> Donating money may make me happier and friendlier for a limited period! Death to all 4 letter abbreviations starting with P!

Steph

20 years ago
It is. Try PAT. ----- Original Message ----- From: "Jani Taskinen" <sniper@iki.fi> To: "Markus Fischer" <markus@fischer.name> Cc: "John Coggeshall" <john@coggeshall.org>; "Andi Gutmans" <andi@zend.com>; <internals@lists.php.net>; <iliaa@php.net> Sent: Wednesday, December 14, 2005 2:11 PM Subject: Re: [PHP-DEV] [Patch] tidy node and getParent

Markus Fischer

20 years ago
Hi, the patch is in the bug report ( http://bugs.php.net/bug.php?id=34023 ) or do you meant something else? thanks, - Markus Jani Taskinen wrote:

Antony Dovgal

20 years ago
On 25.01.2006 16:17, Markus Fischer wrote:
> Hi, > > the patch is in the bug report ( http://bugs.php.net/bug.php?id=34023 ) > or do you meant something else?
Jani meant that it would be better to put this patch as a downloadable file (applying copy-pasted patches causes some problems with tabs/whitespaces). Also, some .phpt tests testing new method would be great.
-- Wbr, Antony Dovgal

Markus Fischer

20 years ago
Hi, Antony Dovgal wrote:
> On 25.01.2006 16:17, Markus Fischer wrote: >> the patch is in the bug report ( http://bugs.php.net/bug.php?id=34023 >> ) or do you meant something else? > > Jani meant that it would be better to put this patch as a downloadable > file (applying copy-pasted patches causes some problems with > tabs/whitespaces).
As written in the other email, the path is online at http://www.zend.com/zend/week/pat/pat52.txt .
> Also, some .phpt tests testing new method would be great.
Thanks, I've attached a simple test to this email. - Markus

John Coggeshall

20 years ago
Sorry this fell off my radar. Is getParent() a new function to tidy? I may have to include some lib checks in my config... John On Wed, 2006-01-25 at 15:22 +0100, Markus Fischer wrote:

Markus Fischer

20 years ago
John Coggeshall wrote:
> Sorry this fell off my radar. Is getParent() a new function to tidy? I > may have to include some lib checks in my config...
I can't tell, http://tidy.sourceforge.net/docs/api/group__Tree.html lists it and the page was generated in 2002 if that date is correct. Ob my systen (debian sarge) the library seems to be a snapshot from 20050415 and it includes it. From the SF CVS it seems to be there from the first hour on ( http://cvs.sourceforge.net/viewcvs.py/tidy/tidy/src/tidylib.c?rev=1.1.2.1&view=markup ). HTH

Markus Fischer

20 years ago
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, okay, so with whom I've to sleep to get this patch in? :) cheers, - - Markus Markus Fischer wrote:
> Hi, > > Antony Dovgal wrote: >> On 25.01.2006 16:17, Markus Fischer wrote: >>> the patch is in the bug report ( http://bugs.php.net/bug.php?id=34023 >>> ) or do you meant something else? >> >> Jani meant that it would be better to put this patch as a downloadable >> file (applying copy-pasted patches causes some problems with >> tabs/whitespaces). > > As written in the other email, the path is online at > http://www.zend.com/zend/week/pat/pat52.txt . > >> Also, some .phpt tests testing new method would be great. > > Thanks, I've attached a simple test to this email. > > - Markus > > > ------------------------------------------------------------------------ > > --TEST-- > Test getParent() > --SKIPIF-- > <?php if (!extension_loaded("tidy")) print "skip"; ?> > --FILE-- > <?php > $x = tidy_parse_string("<body><div>Content</div></body>"); > var_dump($x->body()->child[0]->getParent()->name); > ?> > --EXPECT-- > string(4) "body" > >
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEIoOg1nS0RcInK9ARAiQoAKCTDFX2S96rE9jj8dfplaaSWBbZDQCbBEwU xkG9JkMubeZN33BCrWh/Deg= =1niF -----END PGP SIGNATURE-----

John Coggeshall

20 years ago
Committed to HEAD.. I'll let the RM decide where this belongs for PHP 5.1+ before PHP 6 (5.2 probably) Sorry I misspelled your name in the commit ;) John On Thu, 2006-03-23 at 12:16 +0100, Markus Fischer wrote:

Andi Gutmans

20 years ago
Ilia, but don't worry, he's a good looking guy :) hehe At 03:16 AM 3/23/2006, Markus Fischer wrote:

Steph

20 years ago
It's been in PAT for ages, unless you made any changes to it Markus? http://www.zend.com/zend/week/pat/pat52.txt ----- Original Message ----- From: "Markus Fischer" <markus@fischer.name> To: "Jani Taskinen" <sniper@iki.fi> Cc: "John Coggeshall" <john@coggeshall.org>; "Andi Gutmans" <andi@zend.com>; <internals@lists.php.net>; <iliaa@php.net> Sent: Wednesday, January 25, 2006 3:17 PM Subject: Re: [PHP-DEV] [Patch] tidy node and getParent

Markus Fischer

20 years ago
Steph Fox wrote:
> It's been in PAT for ages, unless you made any changes to it Markus? > > http://www.zend.com/zend/week/pat/pat52.txt
No change was done. Wow, I didn't knew that this exists. And now it makes sense because you were mentioned PAT in your email back then which didn't mean anything to me :) thanks, - Markus