Home | 簡體中文 | 繁體中文 | 雜文 | 打賞(Donations) | Github | OSChina 博客 | 雲社區 | 雲棲社區 | Facebook | Linkedin | 知乎專欄 | 視頻教程 | About

第 36 章 Miscellaneous

目錄

36.1. php function check
36.2. whois 域名查詢
36.3. 身份證校驗
36.4. PHP PDF 處理庫
36.5. Kint - a modern and powerful PHP debugging helper
36.6. snoopy 模擬瀏覽器操作
36.7. PHP Nightrain

36.1. php function check

		
#!/bin/bash
LOGFILE=/tmp/my.log
echo > $LOGFILE
for helper in `ls -1 class/helper/`
do
    echo ========================== $helper ============================ >> $LOGFILE
    class=`grep '^class' class/helper/$helper | awk -F ' ' '{print $2}'`
    for fun in `grep 'public function [a-zA-Z]' class/helper/$helper | awk -F ' ' '{print $3}' | awk -F '(' '{print $1}'`
    do
        count=`grep -r "$class->$fun(" *|wc -w`
        if [ $count == 0 ]; then
               echo "[ unused ] $class->$fun" >> $LOGFILE
        else

               echo "[  used  ] $class->$fun" >> $LOGFILE
        fi
        echo "[`date`] [$helper] $class->$fun (checked: $count)"
    done
done