Thinkphp is used to do this. the run () method must be used in aspect programming in thinkphp, but this method is strange because the function-defined parameters are not used in the function.
As shown in the following code, I checked the run () method in many behavior classes. almost this parameter is useless. for example, the & $ params parameter in the following code does not appear in the function code, now, you don't need thinkphp to waste this effort? The question is, is thinkphp's excessive behavior hidden !?
Public function run (& $ params) {if (C ('Upgrade _ NOTICE_ON ')&&(! S ('think _ upgrade_interval ') | C ('Upgrade _ NOTICE_DEBUG') {if (IS_SAE & C ('Upgrade _ NOTICE_QUEUE ')&&! Isset ($ _ POST ['think _ upgrade_queque ']) {$ queue = new SaeTaskQueue (C ('Upgrade _ NOTICE_QUEUE'); $ queue-> addTask ('http: //'. $ _ SERVER ['http _ host']. /index. php, 'think _ upgrade_queque = 1'); if (! $ Queue-> push () {trace ('Upgrade reminder queue failed, error cause :'. $ queue-> errmsg (), 'Upgrade notification error', 'notic', true);} return ;}$ akey = C ('Upgrade _ NOTICE_AKEY '); $ skey = C ('Upgrade _ NOTICE_SKEY '); $ this-> accesskey _ = $ akey? $ Akey: (defined ('sae _ ACCESSKEY ')? SAE_ACCESSKEY: ''); $ this-> secretkey _ = $ skey? $ Skey: (defined ('sae _ SECRETKEY ')? SAE_SECRETKEY: ''); $ current_version = C ('Upgrade _ CURRENT_VERSION '); // read interface $ info = $ this-> send (' http://sinaclouds.sinaapp.com/thinkapi/upgrade.php?v= '. $ Current_version); if ($ info ['version']! = $ Current_version) {if ($ this-> send_sms ($ info ['MSG ']) trace ($ info ['MSG'], 'Upgrade notification successful ', 'notic ', true); // send upgrade sms} S ('think _ upgrade_interval', true, C ('Upgrade _ NOTICE_CHECK_INTERVAL '));}}
Reply to discussion (solution)
How do you know you don't need it?
You are talking about tp behavior-driven.
Why is a parameter provided to run. In some cases, a parameter must be provided to the behavior to run properly.
I think it is useless only when I use less.