Home | 簡體中文 | 繁體中文 | 雜文 | 打賞(Donations) | ITEYE 博客 | OSChina 博客 | Facebook | Linkedin | 知乎專欄 | Search | Email

第 23 章 Miscellaneous

目錄

23.1. php function check
23.2. whois 域名查詢
23.3. 身份證校驗
23.4. PHP PDF 處理庫
23.5. Kint - a modern and powerful PHP debugging helper
23.6. snoopy 模擬瀏覽器操作
23.7. PHP Nightrain

23.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