hyperf / hyperf

🚀 A coroutine framework that focuses on hyperspeed and flexibility. Building microservice or middleware with ease.

Home Page:https://www.hyperf.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] 热更新watcher 枚举类注解未生效

HuangXi0820 opened this issue · comments

Darwin 172.16.0.150 22.6.0 Darwin Kernel Version 22.6.0: Tue Nov  7 21:48:06 PST 2023; root:xnu-8796.141.3.702.9~2/RELEASE_X86_64 x86_64
PHP 8.1.27 (cli) (built: Dec 19 2023 20:35:55) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.27, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.27, Copyright (c), by Zend Technologies
hyperf/cache                       v3.1.15 A cache component for hyperf.
hyperf/code-parser                 v3.1.15 A code parser component for Hyperf.
hyperf/codec                       v3.1.15 A codec component for Hyperf.
hyperf/collection                  v3.1.20 Hyperf Collection package which come fro...
hyperf/command                     v3.1.15 Command for hyperf
hyperf/conditionable               v3.1.15 Hyperf Macroable package which come from...
hyperf/config                      v3.1.15 An independent component that provides c...
hyperf/constants                   v3.1.16 A constants component for hyperf.
hyperf/context                     v3.1.15 A coroutine/application context library.
hyperf/contract                    v3.1.15 The contracts of Hyperf.
hyperf/coordinator                 v3.1.19 Hyperf Coordinator
hyperf/coroutine                   v3.1.15 Hyperf Coroutine
hyperf/database                    v3.1.18 A flexible database library.
hyperf/db-connection               v3.1.15 A hyperf db connection handler for hyper...
hyperf/devtool                     v3.1.19 A Devtool for Hyperf.
hyperf/di                          v3.1.15 A DI for Hyperf.
hyperf/dispatcher                  v3.1.15 A HTTP Server for Hyperf.
hyperf/engine                      v2.11.0 Coroutine engine provided by swoole.
hyperf/engine-contract             v1.10.1 Contract for Coroutine Engine
hyperf/event                       v3.1.15 an event manager that implements PSR-14.
hyperf/exception-handler           v3.1.15 Exception handler for hyperf
hyperf/framework                   v3.1.15 A coroutine framework that focuses on hy...
hyperf/guzzle                      v3.1.15 Swoole coroutine handler for guzzle
hyperf/http-message                v3.1.19 microservice framework base on swoole
hyperf/http-server                 v3.1.17 A HTTP Server for Hyperf.
hyperf/logger                      v3.1.15 A logger component for hyperf.
hyperf/macroable                   v3.1.15 Hyperf Macroable package which come from...
hyperf/memory                      v3.1.15 An independent component that use to ope...
hyperf/model-listener              v3.1.15 A model listener for Hyperf.
hyperf/pipeline                    v3.1.15 Hyperf Macroable package which come from...
hyperf/pool                        v3.1.15 An independent universal connection pool...
hyperf/process                     v3.1.15 A process component for hyperf.
hyperf/redis                       v3.1.18 A redis component for hyperf.
hyperf/serializer                  v3.1.15 A serializer component for Hyperf.
hyperf/server                      v3.1.15 A base server library for Hyperf.
hyperf/stdlib                      v3.1.15 A stdlib component for Hyperf.
hyperf/stringable                  v3.1.20 Hyperf Stringable package which come fro...
hyperf/support                     v3.1.15 A support component for Hyperf.
hyperf/tappable                    v3.1.15 Hyperf Macroable package which come from...
hyperf/testing                     v3.1.15 Testing for hyperf
hyperf/utils                       v3.1.0  A tools package that could help develope...
hyperf/watcher                     v3.1.19 Hot reload watcher for Hyperf

swoole

Swoole => enabled
Author => Swoole Team <team@swoole.com>
Version => 5.0.3
Built => Apr  3 2024 08:18:00
coroutine => enabled with boost asm context
kqueue => enabled
rwlock => enabled
http2 => enabled
json => enabled
pcre => enabled
zlib => 1.2.11
brotli => E16781312/D16781312
async_redis => enabled

Directive => Local Value => Master Value
swoole.enable_coroutine => On => On
swoole.enable_library => On => On
swoole.enable_preemptive_scheduler => Off => Off
swoole.display_errors => On => On
swoole.use_shortname => Off => Off
swoole.unixsock_buffer_size => 262144 => 262144

Description:

基于注解的枚举类, 在热更新中触发了文件修改未生效,需手动重启

Steps To Reproduce:

  1. php bin/hyperf.php gen:constant ErrorCode --type enum 生成枚举类
  2. 热更新启动, 修改枚举注解
  3. 枚举注解修改新增删除,热更新生效后 枚举类未更新

看了下触发了文件修改, 解析枚举类的时候 因为枚举类未属于Node\Stmt\Class_, 导致classname未赋值, 未进行处理,
问题比较简单尝试提了下pr, 整体流程我其实没跟, 很多概念我也不懂, 只是尝试修改生效达到目的
后续怎么找人看, 过节好多天好像没人跟下, 怎么推进我也不懂. 提个issue
而且这样改是不是有问题 只是增加个或关系, 对应属于实现是不是对后续不太好.
是不是要抽上一层, 怎么抽我也不晓得, 你们看下怎么处理