资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

检查整个目录php语法错误脚本-创新互联

其实也可以检查其他语言的语法错误,把代码内的php -l 换了就行

成都创新互联-成都网站建设公司,专注成都网站设计、成都网站建设、网站营销推广,国际域名空间,网络空间,网站托管维护有关企业网站制作方案、改版、费用等问题,请联系成都创新互联。#! /bin/bash # # check_php_syntax.sh # Copyright (C) 2014  # # Distributed under terms of the MIT license. # #!/bin/bash # check php syntax  if [ $# -lt 1 ];then     echo 'Usage: ' $0  'directory';     exit fi if [ ! -d $1 ];then     echo $1  'not a directory,please check!';     exit fi directory=$1 echo $directory temp_file="/tmp/file$$" echo $temp_file ls -R $directory | awk  ' BEGIN{ FS="n"     folder="'$directory'" logname="'$temp_file'" temp="" } {     if($0~/.php$/){         system("php -l " folder "/" $0  "   >>  " logname  " 2>&1")       }     if($0~/:$/){         temp=substr($0,1,length($0)-1)         folder=temp     } } ' #folder=substr($1,1,length($1)-1) if [ -e $temp_file ];then     cat $temp_file | awk '     BEGIN{     error = 0 } {     if($0~/Parse/) {         error++          errorfile[$0] = $0     }    } END{ print "错误文件:" error "个" if(length(errorfile)>0) print "错误行数:"     for (i in errorfile)         print i     }     ' else     echo "php file not found."     exit; fi

另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


分享题目:检查整个目录php语法错误脚本-创新互联
转载来于:http://cdkjz.cn/article/ehepd.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220