swoft-cloud / swoft

🚀 PHP Microservice Full Coroutine Framework
https://swoft.org
Apache License 2.0
5.58k stars 788 forks source link

Bean::SESSION Scope for definition is not undefined #1476

Open imzyf opened 2 years ago

imzyf commented 2 years ago
Q A
Bug report? yes
Feature request? no
Swoft version 2.0.11
Swoole version 4.8.6
PHP version 7.4
Runtime environment Mac

Describe the bug

in bean.php

    'myBean' => [
        'class' => MyBean::class,
        '__option' => [
            'scope' => Bean::SESSION,
        ],
    ],

InvalidArgumentException(code:0) Scope for definition is not undefined

image

看起来像这里缺少了 Bean::SESSION

同时想问 Bean::SESSION 与 Bean::REQUEST 有什么区别