그누 함수들 편하게 보기 정보
PHP 그누 함수들 편하게 보기
본문
작업하다 보면 그누 함수를 참조해야 할 때가 종종 생기는데
그 때 사용하려고 급하게 만들어봤습니다.
아래 소스를 적당한 파일명(lib_func.php)으로 저장 후
그누 루트 폴더에 넣고 실행하면 됩니다.
<? include_once('./_common.php');
include_once(G5_PATH.'/head.sub.php'); ?>
<style>body { padding:8px; }</style>
<?
$a = glob(G5_PATH."/lib/*.php");
foreach ($a as $s)
echo "<a href='?file=$s'>$s</a><br>";
if ($_GET[file]) { ?>
<table width="100%" cellpadding="8" border="1" style="border-collapse:collapse; margin-top:16px;">
<?
$s = file_get_contents($_GET[file]);
$a = explode("\n", $s);
for ($n = count($a), $i = 0; $i < $n; $i++) {
$line = $a[$i];
if (substr($line, 0, 8) != "function") continue;
$name = trim(substr($line, 8));
$comm = $a[$i - 1];
if (substr($comm, 0, 2) == "//")
$comm = trim($comm);
$name = trim(str_replace("{", "", $name));
?>
<tr>
<td width="2%" nowrap><?=$i + 1?></td>
<th width="49%" align="left"><?=$name?></th>
<td width="49%"><?=$comm?></td>
</tr>
<? } ?>
</table>
<? } ?>
<? include_once(G5_PATH.'/tail.sub.php'); ?>
2
댓글 3개

그냥 훤히 보여서 너무 좋습니다. 감사합니다.
