Posted in PHP onDecember 06, 2006
<?php /** * ?算?目?下的程式?模,包含?n案?担??担???nbsp; * * @version 1.0 * @since 1.0 * @access public * @author Ryan <ryan@shinersoft.com> * @copyright Copyright (c) 2002-2004 by Shiner Technologies Co., Ltd. * @package AAPortal */ // ?修改???目?的位置 $dir = "aaportal"; // 以下不用更??nbsp; $counts = array("directory" => 0, "file" => 0, "line" => 0, "size" => 0); check($dir); echo "Total:\n"; echo "Directry : ".$counts["directory"]."\n"; echo "File : ".$counts["file"]."\n"; echo "Line : ".$counts["line"]."\n"; echo "Size : ".$counts["size"]."\n"; function check($dir) { global $counts; if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { if ($file == ".") continue; if ($file == "..") continue; if ($file == "CVS") continue; $path = $dir."/".$file; if (is_dir($path)) { $counts["directory"]++; //echo "dir ".$counts["directory"]." $path\n"; check($path); } else { $ext = array_pop(explode('.', basename($path))); if ($ext=="php" || $ext=="inc") { $counts["file"]++; //echo "file ".$counts["file"]." $path\n"; $lines = file($path); $counts["line"] += count($lines); $counts["size"] += filesize($path); } } } closedir($dh); } } ?>
?算你??的 PHP 程式大小
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@