那。。挂上.so再phpinfo就这样了
tidy
| Tidy support | enabled |
|---|---|
| libTidy Build Date | 25 March 2009 |
| Directive | Local Value | Master Value |
|---|---|---|
| tidy.default_config | no value | no value |
| Tidy Configuration Directive | Value |
|---|---|
| indent-spaces | 0 |
| wrap | 68 |
| tab-size | 8 |
| char-encoding | 1 |
| input-encoding | 3 |
| output-encoding | 1 |
| newline | 0 |
| doctype-mode | 1 |
| doctype | no value |
| repeated-attributes | 1 |
| alt-text | no value |
| slide-style | no value |
| error-file | no value |
| output-file | no value |
| write-back | FALSE |
| markup | TRUE |
| show-warnings | TRUE |
| quiet | FALSE |
| indent | 0 |
| hide-endtags | FALSE |
| input-xml | FALSE |
| output-xml | FALSE |
| output-xhtml | FALSE |
| output-html | FALSE |
| add-xml-decl | FALSE |
| uppercase-tags | FALSE |
| uppercase-attributes | FALSE |
| bare | FALSE |
| clean | FALSE |
| logical-emphasis | FALSE |
| drop-proprietary-attributes | FALSE |
| drop-font-tags | FALSE |
| drop-empty-paras | TRUE |
| fix-bad-comments | TRUE |
| break-before-br | FALSE |
| split | FALSE |
| numeric-entities | FALSE |
| quote-marks | FALSE |
| quote-nbsp | TRUE |
| quote-ampersand | TRUE |
| wrap-attributes | FALSE |
| wrap-script-literals | FALSE |
| wrap-sections | TRUE |
| wrap-asp | TRUE |
| wrap-jste | TRUE |
| wrap-php | TRUE |
| fix-backslash | TRUE |
| indent-attributes | FALSE |
| assume-xml-procins | FALSE |
| add-xml-space | FALSE |
| enclose-text | FALSE |
| enclose-block-text | FALSE |
| keep-time | FALSE |
| word-2000 | FALSE |
| tidy-mark | FALSE |
| gnu-emacs | FALSE |
| gnu-emacs-file | no value |
| literal-attributes | FALSE |
| show-body-only | 0 |
| fix-uri | TRUE |
| lower-literals | TRUE |
| hide-comments | FALSE |
| indent-cdata | FALSE |
| force-output | TRUE |
| show-errors | 6 |
| ascii-chars | FALSE |
| join-classes | FALSE |
| join-styles | TRUE |
| escape-cdata | FALSE |
| language | no value |
| ncr | TRUE |
| output-bom | 2 |
| replace-color | FALSE |
| css-prefix | no value |
| new-inline-tags | no value |
| new-blocklevel-tags | no value |
| new-empty-tags | no value |
| new-pre-tags | no value |
| accessibility-check | 0 |
| vertical-space | FALSE |
| punctuation-wrap | FALSE |
| merge-divs | 2 |
| decorate-inferred-ul | FALSE |
| preserve-entities | FALSE |
| sort-attributes | 0 |
| merge-spans | 2 |
| anchor-as-name | TRUE |
还真够多的
接下来写点东西试试~~
$tidy = new tidy();
居然报错~~
Class ‘tidy’ not found
查了一下。。看来。。可能是php版本不对,我现在是5.2.5升级一下试试
好。现在升级到了5.2.9
但是还是不行!!!还是没有找到tidy这个 class
只好使用大招了~~copy tidy-1.2到php安装目录的ext目录下,更名为tid
然后编译的时候加上–with-tidy
make && make install
apache restart一下
再来~~
终于OK~~ 说明tidy不能用.so挂载的方式加载??不懂,反正我搞定了,编译在php一起了,先这么用着吧!
如果你知道怎么用挂载.so的方法启用它,或者我的方法不对留言给我哦,多谢!
接下来就是学习使用他了!
第一个小程序
<?php
$config = array(
‘indent’ => true,
‘output-xhtml’ => true,
‘wrap’ => 200);
$tidy = new tidy;
$tidy->parseFile (‘http://www.fabrichina.net’, $config, ‘utf8′);
$tidy->cleanRepair();
echo $tidy;
?>
啊~~的确很惊人,一个小程序,就把我的网页变成符合W3C标准的~~~牛啊~
本来想写一个ob_start然后register一个shutdown函数ob_clearn出来正文可以吧全站的
输出都w3c一下,突然发现tidy支持一个函数~~‘ob_tidyhandler’
只要ob_start(‘ob_tidyhandler’) 只要这样,我刚才想的事情就解决了。。。牛啊-_-~~
真是想我之所想~~哈哈哈,不过这样肯定会阻碍效率,那就得做cache了。。。
$body->get_nodes(TIDY_TAG_IMG);
这get_nodes函数不存在??我靠
allows you to clean and manipluate HTML documents.
NOTE: This is the PHP4 version
这是他的注解,邪门了,居然不支持PHP5?
算了,既然get_nodes不work而且tidy1.2从2005年到今天都没更新了~~我准备放弃tidy试试别的
tidy的研究就到此为止了~~
Recent Comments