nk($src)) return $this->error_occur(0x0006, $src); // 删除源文件
return TRUE;
}
}
/**
* @]Method Name[= no_comment()
* @]Purpose[=
* 清除文件中 C 规范的注释
* @]Parameter[=
* string $path 指定要执行操作的文件
* @]Return[= boolean 错误返回 FALSE,否则 TRUE
* @]Author[= SNakeVil <51JS,BU,PHPx> (snakevil@qq.com)
* @]See[=
*/
function no_comment($path="") {
if (!is_file($path)) return $this->error_occur(0x000B, __FUNCTION__);
if (!is_readable($path)) return $this->error_occur(0x0006, $path);
if (!is_writeable($path)) return $this->error_occur(0x0007, $path);
if (!$th=tmpfile()) return $this->error_occur(0x000C, $path); // 创建临时文件
$fh = fopen($path, "r+b");
if (!flock($fh,LOCK_EX)) { // 锁定文件
fclose($fh);
unset($fh);
return $this->error_occur(0x0009, $path);
}
$fbuffer = fread($fh, $this->buffer_size*2); // 文件读取缓冲区
$tbuffer = ""; // 临时文件缓冲区
$in_dq = $in_sq = $in_lc = $in_bc = FALSE;
while ($fblen=strlen($fbuffer)) { // 处理原始数据
&