read())
{
if (!preg_match("/\.(inc.php)$/i",$file))
{
continue;
}
$plug_count++;
$data = join('',file($sdir.$file));
$comment = array('file'=>htmlsc($file),'rev'=>'','date'=>'');
//mypluglist用 URL:https://pukiwiki.osdn.jp/?%E8%87%AA%E4%BD%9C%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3/mypluglist.inc.php
if (preg_match('/\/\*\*/', $data, $matches)) {
$docc_start = TRUE;
}
if ($docc_start){
if (preg_match('/\@author(.+)/u', $data, $matches)) {
$comment['author'] = htmlsc(trim($matches[1]));
}
if (preg_match('/\@tutorial(.+)/u', $data, $matches)) {
$comment['tutorial'] = htmlsc(trim($matches[1]));
}
if (preg_match('/\@link(.+)/u', $data, $matches)) {
$comment['tutorial'] = htmlsc(trim($matches[1]));
}
}
//--------
if ((preg_match('/\$'.'Id: (.+),v (\d+\.\d+) (\d{4}-\d{1,2}-\d{1,2} \d{1,2}:\d{1,2}:\d{1,2})Z (.+) \$/u',$data,$matches))||(preg_match('/\$'.'Id: (.+),v (\d+\.\d+) (\d{4}\/\d{1,2}\/\d{1,2} \d{1,2}:\d{1,2}:\d{1,2}) (.+) Exp \$/u',$data,$matches))||(preg_match('/\$'.'Id: (.+),v (\d+\.\d+) (\d{4}\/\d{1,2}\/\d{1,2} \d{1,2}:\d{1,2}:\d{1,2}) (.+) \$/u',$data,$matches))||(preg_match('/\$'.'Id: (.+),v (\d+\.\d+) (\d{4}\/\d{1,2}\/\d{1,2} \d{1,2}:\d{1,2}:\d{1,2})Z (.+) \$/u',$data,$matches))||(preg_match('/\$'.'Id: (.+),v (\d+\.\d+) (\d{4}-\d{1,2}-\d{1,2} \d{1,2}:\d{1,2}:\d{1,2}) (.+) \$/u',$data,$matches)))
{
$comment['rev'] = htmlsc($matches[2]);
$comment['date'] = preg_replace("/-/","/",htmlsc($matches[3]));
$comment['author'] = htmlsc($matches[4]);
}
$comments[$sdir.$file] = $comment;
}
$dir->close();
}
if (count($comments) == 0)
{
return '';
}
ksort($comments, SORT_STRING);
$retval = '';
foreach ($comments as $comment)
{
if (isset($comment['tutorial'])){
$comment_file = ''.$comment['file'].'';
}else{
$comment_file = $comment['file'];
}
$retval .= <<
| {$comment_file} |
{$comment['rev']} |
{$comment['date']} |
{$comment['author']} |
EOD;
}
$retval = <<
| ファイル名 |
リビジョン |
更新日時 |
作者 |
{$retval}
| 合計 |
{$plug_count}個 |
EOD;
return $retval;
}
?>