Skip to content

Hot code reloading not working #4183

Answered by sy-records
siddjain asked this question in Q&A
Discussion options

You must be logged in to vote
  1. Fatal error: Uncaught ArgumentCountError: Too few arguments to function
- $http->on('BeforeReload', function($serv, $workerId) {
+ $http->on('BeforeReload', function($serv) {
    var_dump(get_included_files());
});

- $http->on('AfterReload', function($serv, $workerId) {
+ $http->on('AfterReload', function($serv) {
    var_dump(get_included_files());
});
  1. reload

The reload operation can only reload PHP files that were loaded after the worker process was started.

Use the get_included_files function to list which PHP files were loaded before WorkerStart. PHP files in this list cannot be reloaded, even after a reload operation, and need to be shut down and restarted to take effect.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sy-records
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants