Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php7.4下行为层bug #1069

Open
kingArthurPu opened this issue Nov 30, 2020 · 0 comments
Open

php7.4下行为层bug #1069

kingArthurPu opened this issue Nov 30, 2020 · 0 comments

Comments

@kingArthurPu
Copy link

kingArthurPu commented Nov 30, 2020

tp5.1 在 php7.4下行为层bug:

模块的 tags.php文件如下:

return [

    // 操作开始执行
    'action_begin' => [
        \app\common\behavior\CheckLogin::class
    ],

];

CheckLogin.php 示例代码:


class CheckLogin extends Controller
{
    /**
     * 行为登录验证
     */
    public function run(){
        $link  = strtolower(Request::module()."/".Request::controller());
        dump($link);
    }
}

现在的问题是:
在PHP7.3下,访问页面可以进入到该方法中;但在PHP7.4下无法进入到run()方法中,需要将该方法绑定到app_begin上:

    // 应用开始
    'app_begin'    => [
        \app\common\behavior\CheckLogin::class
    ],

才可以监听到run()方法。
分别测试了php7.4.3和php7.4.10两个版本。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant