<?php
/**
* phpCodeBeautifier automatic shell script
*
* @author 朦胧中的罪恶
* @email colt.hawkins@qq.com
* @version 1.2
*/
// define root path
define('DIR_ROOT', dirname(__FILE__));
// php code in C style
define('PARAM','--space-after-if --optimize-eol --space-after-switch --space-after-while --space-before-start-angle-bracket --extra-padding-for-case-statement --glue-amperscore --change-shell-comment-to-double-slashes-comment --indent-with-tab --force-large-php-code-tag --force-true-false-null-contant-lowercase --comment-rendering-style PEAR --equal-align-position 50 --padding-char-count 1 --glue-arrow ');
// php code in C++ style
//define('PARAM', '--space-after-if --optimize-eol --space-after-switch --space-after-while --space-before-start-angle-bracket --one-true-brace-function-declaration --one-true-brace --extra-padding-for-case-statement --glue-amperscore --change-shell-comment-to-double-slashes-comment --indent-with-tab --force-large-php-code-tag --force-true-false-null-contant-lowercase --comment-rendering-style PEAR --equal-align-position 50 --padding-char-count 1 --glue-arrow ');
// define phpCodeBeautifier command line
define('PHPCB', DIR_ROOT . '/phpcb.exe '. PARAM);
beautiful_all_files(DIR_ROOT);
function beautiful_all_files( $path ) {
foreach ( glob( $path . '/*') as $item ) {
if (is_dir($item)) {
beautiful_all_files($item);
} else {
if (!preg_match('/phpcb\.php$/i', $item) && preg_match('/\.php$/i', $item)) {
echo $item . chr(10);
ob_start();
system(PHPCB . $item);
$content = ob_get_contents();
ob_end_clean();
file_put_contents($item, $content);
}
}
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
sublime text 2 PhpBeautifier插件及命令行工具,实例
共2个文件
exe:1个
php:1个
5星 · 超过95%的资源 需积分: 10 374 下载量 191 浏览量
2012-10-16
13:49:51
上传
评论 1
收藏 402KB RAR 举报
温馨提示
实现方案:http://blog.csdn.net/zm2714/article/details/8076077
资源推荐
资源详情
资源评论
收起资源包目录
PhpBeautifier_scheme.rar (2个子文件)
phpcodebeautiful
phpCB.exe 157KB
phpcb.php 2KB
共 2 条
- 1
zm2714
- 粉丝: 303
- 资源: 43
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
- 6
前往页