[request] tidy added to the default php extension set?
As libtidy is already available in the default packages, would it be a good idea to include the
--with-tidy = shared option in the default php build? I am not sure about the popularity of the extension, but we used it extensively to validate and clean html entered in input forms. |
Quote:
By the way, you probably know you can build a PHP extension (like tidy) without rebuilding all of PHP, right? |
tidy gets installed as part of kdewebdev, I am not sure why it is bundled in with kdewebdev. Mauricio, with the way tidy is handled currently I don't think it would be a good idea to make php depend on kdewebdev.
|
PHP seems to bundle the tidy source, so perhaps --with-tidy is all it would take.
I'll look into that. |
Quote:
BTW, I tried to build only the tidy extension using PECL. But the latest version available there is 1.2, for PHP4. So it fails (understandably) as it can not find some PHP includes. After some research (http://devzone.zend.com/241/tidying-...ml-with-php-5/) I learned that, beginning in PHP5.03, Tidy is now bundled as an extension in the PHP5 source tree, so the usual method is to configure and build it with PHP, which is what I am doing now. I am actually building it in a separate work tree and just copying the tidy.so, but in order to do this I have to use the same php config settings used by the official build to make sure the extension will still load. |
Quote:
|
Tidy itself is not included (bundled) in PHP, neither 5.4.x nor 5.5.x. To build the Tidy extension to PHP, you need the PHP source for the extension (php-<version>/ext/tidy), plus the Tidy source - original source is only available via CVS from sourceforge.net (they do not package up source releases anymore).
You can build the PHP Tidy extension with libtidy compiled as static (libtidy.a, using build/gmake) or shared (libtidy.so). I did not know about kdewebdev (I don't use it) and that it contains tidy. Thanks for the correction. You do not need to rebuild PHP to add an extension. There are instructions in README.SELF-CONTAINED-EXTENSIONS within the PHP source distribution. It will be compatible if you follow the steps there. You can just copy the resulting *.so (tidy.so in this case) into the PHP extensions directory, and configure php.ini to load it. |
Quote:
I think explaining for a begineer like me would be beneficial for everyone.. If not, then I can start a separate thread. Thanks! |
Quote:
You will need the PHP source package, but you only need to extract the PHP Tidy extension, as shown below. Here are my steps to build the PHP Tidy extension. Don't just type these, since your paths etc may differ. "build" is a temporary, empty directory. This also assumes the "phpize" and "phpconfig" commands are on the PATH, as they are with the Slackware package. Code:
$ cd build Note this works with other PHP extensions too. |
Quote:
The procedure requires the php source tarball, as you mention, which is the only drawback imo. And you probably need to remember to repeat it when php is upgraded on the system, which would be easier if the extension was included in the default set. But this is a minor annoyance. |
Quote:
|
All times are GMT -5. The time now is 07:24 AM. |