这是一个linux命令,它将注释php文件中某些目录中的所有require_once调用:
% cd path/to/ZendFramework/library
% find . -name '*.php' -not -wholename '*/Loader/Autoloader.php' \
-not -wholename '*/Application.php' -print0 | \
xargs -0 sed --regexp-extended --in-place 's/(require_once)/\/\/ \1/g'但是我怎么能在Windows中做到这一点呢?
这是为了加快Zend应用程序的速度。
编辑:
在一行上:
find . -name '*.php' -not -wholename '*/Loader/Autoloader.php' -not -wholename */Application.php' -print0 | xargs -0 sed --regexp-extended --in-place 's/(require_once)/\/\/ \1/g'发布于 2010-10-14 06:56:58
这和这。
发布于 2011-08-23 01:04:03
FYI,在Windows上,由于某些原因,我无法让xargs工作,但这是我在Git Bash shell中运行的命令:
find . -name '*.php' -print0 | xargs -0 sed --regexp-extended --in-place 's/(require_once)/\/\/ \1/g'然后,手动将Loader.php和Application.php文件重新记录在已记录的文件上。
https://serverfault.com/questions/190802
复制相似问题