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
		
		


原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

目录
相关文章
|
PHP Windows
windows下 Call to undefined function posix_getpid() in ……\Workerman\Worker.php 的解决方法
windows下 Call to undefined function posix_getpid() in ……\Workerman\Worker.php 的解决方法
127 0
windows下 Call to undefined function posix_getpid() in ……\Workerman\Worker.php 的解决方法
|
9月前
|
PHP
PHP报错Call to undefined function utf8_decode()的解决方案
PHP报错Call to undefined function utf8_decode()的解决方案
|
9月前
|
PHP
漏刻有时环境部署:php安装提示Can‘t use function return value in write context
漏刻有时环境部署:php安装提示Can‘t use function return value in write context
38 0
|
消息中间件 PHP
laravel6 使用rabbitmq报错:Call to a member function make() on null at Queue\\Jobs\\Job.php:215
laravel6 使用rabbitmq报错:Call to a member function make() on null at Queue\\Jobs\\Job.php:215
132 0
|
PHP Windows
php使用register_tick_function来定位执行慢的代码
php使用register_tick_function来定位执行慢的代码
165 0
|
存储 PHP
PHP 零基础入门笔记(9):函数 function
PHP 零基础入门笔记(9):函数 function
|
PHP
【PHP报错集锦】 Maximum function nesting level of ‘256‘ reached, aborting!
【PHP报错集锦】 Maximum function nesting level of ‘256‘ reached, aborting!
415 0
【PHP报错集锦】 Maximum function nesting level of ‘256‘ reached, aborting!
|
PHP
PHP 7.2 abstract function override 的使用
PHP 7.2 abstract function override 的使用
1203 0