页面导航: 首页网络编程PHP编程php文摘 → 正文内容 php格式化Beautify PHP

php格式化工具Beautify PHP小小BUG

发布:dxy 字体:[增加 减小] 类型:转载
Beautify PHP is written entirely in PHP. The program was tested with Linux and Windows, PHP 4.1.0 and PHP 4.3.1, but it should work on most systems running PHP.

Beautify PHP,很好用的php格式化工具
http://www.bierkandt.org/beautify/
http://pear.php.net/package/PHP_Beautifier/download
最近组内来新人,他们代码不太规范的时候看得实在不舒服
这个工具实在很好用,再乱的代码瞬间就格式化好了
丢到linux下还可以快速批量处理@.@
好了,以下是本帖主题:
Beautify PHP格式化符号时,遗漏了^=和&=判断,
在beautify_php.class.inc第426行,增加这两个符号
                       // add space before chars = < >
                        if ($i > 0 AND !$this->_comment) {
                            if (($a[$i] == "=" OR $a[$i] == "<" OR $a[$i] == ">" OR $a[$i] == "*")
                                AND preg_match("/([ |!|=|.|<|>|-|+|*|/|^|&]+)/", $a[$i-1]) == 0) {
                                $this->_outstr  = rtrim($this->_outstr)." ";
                            }
                        }

百度中搜索更多的关于php格式化工具Beautify PHP小小BUG内容,或者用Google搜索相关更多
浏览次数:载入中... 打印本文关闭本文返回首页

文章评论

共有 位脚本之家网友发表了评论我来说两句

同 类 文 章
最 近 更 新
热 点 排 行