PHP
·
发表于 5年以前
·
阅读量:8296
function is_code_file($path)
{
if($path == null){
return false;
}
$ext = pathinfo($path,PATHINFO_EXTENSION);
$basename = pathinfo($path,PATHINFO_BASENAME);
$codeFileExt = array( ".m",".pch",".strings",".plist",".xcworkspacedata",".java",".c",".cpp",".sh", ".py",".h",".cc",".mk",".xml",".rc",".txt",".conf",".js",".html",".shtml",".aidl",".css",".php",".gradle",".properties" );
$codeFileName = array( "Makefile");
if(in_array('.' . $ext,$codeFileExt)){
return true;
}
if(in_array($basename, $codeFileName)){
return true;
}
return false;
}