The total number of files in the PHP statistics directory and the number of lines of code, perform the statistics of files in the directory
When skipping files: the matching rules only start with the file name, and the matching rules are limited to the beginning.
Skip comment lines in a file: The matching rules are only matched from the header of the comment paragraph, and if the//and * and #及/* and the line beginning with/* and the empty row are skipped. So, like/* This multi-sweat annotation, the beginning of each line must be preceded by an * number, otherwise it cannot match the comment.
Directory filtering: Matching rules are matched from the full name of the directory name
First download the total number of files and lines of code in the PHP statistics directory that we need to use for this lesson: http://www.php.cn/xiazai/leiku/542
After the download, find the PHP class files we need, unzip to our local directory, create a new PHP file!
Once this is done, we will invoke this class in the new PHP file, and instantiate the class:
<?phpinclude_once "wenjian.php";//Introduce class file $obj = new Caculatefiles ();//instantiation//If set to False, this will not display information for each file, otherwise the $obj-> Setshowflag (false);//Skips all file $obj->setfileskip (Array (' all ') at the beginning of all, $obj->run ("D:/PHPSTUDY/WWW/CV");//All Files , (the default format is. php) $obj->setfileskip (Array ()), $obj->run ("D:/PHPSTUDY/WWW/CV"), $obj->setshowflag (TRUE);// Skip all files beginning with I and a, (e.g. interface and abstract class beginning) $obj->setfileskip (Array (' I ', ' a ')), $obj->run ("D:/PHPSTUDY/WWW/CV"); >
The results of the operation are as follows: