tiny patch for Tidy

php.internals

Steph

20 years ago
This allows static builds under win32 despite the fact that tidyOptGetDoc() doesn't exist in the libtidy.lib we're linking against. It needs applying to php_tidy.def everywhere libtidy v 2 is used - that is, ext/tidy in CVS HEAD and PHP_5_1, and CVS HEAD pecl/tidy. In all three cases there is the same #ifdef clause for the matching tidy_get_opt_doc() function in the header file. - Steph

Steph

20 years ago
Oops, forget it. The problem with having both PECL and src on board is I assumed I was building against the one with this change in it. I wasn't - I was building against the one that didn't have tidyOptGetDoc in the export list AT ALL. Just ran a test and found this is illegal syntax :( so back to the drawing board. (Edin: is there some way you know of to do an #ifdef equivalent in these export lists?) - Steph ----- Original Message ----- From: "Steph Fox" <steph@zend.com> To: "internals" <internals@lists.php.net> Sent: Wednesday, April 19, 2006 12:34 PM Subject: [PHP-DEV] tiny patch for Tidy
> This allows static builds under win32 despite the fact that > tidyOptGetDoc() > doesn't exist in the libtidy.lib we're linking against. > > It needs applying to php_tidy.def everywhere libtidy v 2 is used - that > is, > ext/tidy in CVS HEAD and PHP_5_1, and CVS HEAD pecl/tidy. > > In all three cases there is the same #ifdef clause for the matching > tidy_get_opt_doc() function in the header file. > > - Steph > > > __________ NOD32 1.1380 (20060125) Information __________ > > This message was checked by NOD32 antivirus system. > http://www.eset.com > >
--------------------------------------------------------------------------------

Nuno Lopes

20 years ago
BTW, the libtidy could be updated :) It had a major optimization a few time ago (it decreased my bechmark running time by ~30%). Nuno ----- Original Message ----- From: "Steph Fox" <steph@zend.com> To: "internals" <internals@lists.php.net> Cc: "Edin" <edink@emini.dk> Sent: Wednesday, April 19, 2006 12:00 PM Subject: Re: [PHP-DEV] tiny patch for Tidy

Steph

20 years ago
I updated my copy from Edin's collection last week. It's newer than last year's, but I'm struggling to find any form of 'version' in there to know exactly what I have in front of me. So what are you talking about? Update from what, to what, and for which PHP build?

Nuno Lopes

20 years ago
>I updated my copy from Edin's collection last week. It's newer than last >year's, but I'm struggling to find any form of 'version' in there to know >exactly what I have in front of me. So what are you talking about? Update >from what, to what, and for which PHP build?
I'm talking about the libtidy version: php -r "echo tidy_get_release();" or php -i | grep libTidy the official php build's libtidy version is '1st July 2004', which is almost two years old, and thus doesn't have the tidyOptGetDoc() function. Nuno

Steph

20 years ago
> >I updated my copy from Edin's collection last week. It's newer than last > >year's, but I'm struggling to find any form of 'version' in there to know > >exactly what I have in front of me. So what are you talking about? Update > >from what, to what, and for which PHP build? > > I'm talking about the libtidy version: > php -r "echo tidy_get_release();" > or > php -i | grep libTidy > > the official php build's libtidy version is '1st July 2004', which is > almost two years old, and thus doesn't have the tidyOptGetDoc() function.
Heh, I never thought of that - I was looking through the source for an actual version number, y'know, some API no or whatever. Something normal... Really this is down to John Coggeshall (as maintainer) - unless someone else feels like going and finding a newer version of libtidy and testing it with the existing extension(s) - e.g. would a newer version also bring other new functions that aren't wrapped in the extension(s) currently? In the meantime, we're building against this July 1st 2004 version - and as I wrote earlier, that export file is _only_ used with the static win32 build. Surely we can allow that build to work with the lib used in the official distro while we're waiting for whatever needs to be done for the upgrade? - Steph

Nuno Lopes

20 years ago
>> >I updated my copy from Edin's collection last week. It's newer than last >> >year's, but I'm struggling to find any form of 'version' in there to >> >know exactly what I have in front of me. So what are you talking about? >> >Update from what, to what, and for which PHP build? >> >> I'm talking about the libtidy version: >> php -r "echo tidy_get_release();" >> or >> php -i | grep libTidy >> >> the official php build's libtidy version is '1st July 2004', which is >> almost two years old, and thus doesn't have the tidyOptGetDoc() function. > > Heh, I never thought of that - I was looking through the source for an > actual version number, y'know, some API no or whatever. Something > normal... > > Really this is down to John Coggeshall (as maintainer) - unless someone > else feels like going and finding a newer version of libtidy and testing > it with the existing extension(s) - e.g. would a newer version also bring > other new functions that aren't wrapped in the extension(s) currently?
I do really follow the libtidy development closely. I have the latest cvs version installed on my pc and it runs correctly. All libtidy's tests run fine and my own tests/benchmarks also run correctly. And I don't remember any other function beeing added to libtidy lately. The last one was that tidyOptGetDoc(), which is already exported.
> In the meantime, we're building against this July 1st 2004 version - and > as I wrote earlier, that export file is _only_ used with the static win32 > build. Surely we can allow that build to work with the lib used in the > official distro while we're waiting for whatever needs to be done for the > upgrade? > > - Steph
Upgrading libtidy is five minutes (including download time..). Edin? :) Nuno

Edin Kadribasic

20 years ago
Nuno, which version of libtidy do you think we should use for bundiling with the windows distribution? Edin

Nuno Lopes

20 years ago
answering both e-mails:
> Nuno, which version of libtidy do you think we should use for bundiling > with the windows distribution?
latest CVS. It is stable ATM (but checkout with a developer account, because sourceforge's anonymous cvs servers are currently broken).
> Nuno, will this also work for 4_3 branch?
Yep, the libtidy API hasn't changed. Nuno

Edin Kadribasic

20 years ago
Latest CVS (SF anon CVS worked for me) doesn't compile with error: ext\tidy\tidy.c(586) : error C2152: 'function' : pointers to functions with different attributes Edin Nuno Lopes wrote:

Steph

20 years ago
>> Nuno, will this also work for 4_3 branch? > > Yep, the libtidy API hasn't changed.
Something's odd in the manual then: Note: Tidy 1.0 is just for PHP 4.3.x, while Tidy 2.0 is just for PHP 5.

Steph

20 years ago
Nuno, will this also work for 4_3 branch?

John Coggeshall

20 years ago
On Wed, 2006-04-19 at 14:27 +0200, Steph Fox wrote:
> Really this is down to John Coggeshall (as maintainer) - unless someone else > feels like going and finding a newer version of libtidy and testing it with > the existing extension(s) - e.g. would a newer version also bring other new > functions that aren't wrapped in the extension(s) currently?
I can try to find some time and take a look at what is in the most up to date libtidy and add the functionality to the extension if it makes sense. However, even then I never was the one to get it working in Windows :) John

Steph

20 years ago
Hi John, Being older and wiser than I was this morning: tidySetInCharEncoding tidySetOutCharEncoding tidyOptGetDoc tidyOptGetDocLinksList tidyOptGetNextDocLinks tidyAttrGetById are the only newly introduced functions between the two library versions. The _only_ problem with the current static doze build is it includes one of those new functions in its export list, and libtidy does not. As Nuno noted, the API change between versions consists of declaring every Tidy substitution as a 'TIDY_CALL' type, but that only affects the four memory settings. - Steph

Steph

20 years ago
OK. I've just found that that .defs file is _only_ used by the static win32 build. It doesn't affect anything else, on any other platform. That makes fixing it even easier :) one line instead of three, you just don't export the function that doesn't exist. If/when we ever get that function in libtidy.lib, the ext/tidy (or PECL/tidy) static build will complain that it's missing - but for now they throw a fatal error _anyway_. I do realize I'm the only person in the entire universe to build extensions statically under win32 in the first place, but since we apparently have this entire defs/exports system set up to allow precisely that - what about having it working too? :) - Steph