refactor: rely on context.Context for log/slog and others by dunglas · Pull Request #1969 · php/frankenphp
context.go
Introduced
contextHolder struct to couple context with frankenPHPContext
frankenphp.go
Replaced global logger with globalLogger and globalCtx, added context-aware logging
frankenphp.c
Updated frankenphp_log_message to pass thread index for context retrieval
options.go
Added WithContext option to set the main context
phpthread.go
Updated thread interface to return context and frankenPHPContext separately
threadregular.go
Embedded contextHolder in regularThread, updated to use context
threadworker.go
Split context storage into workerContext and workerFrankenPHPContext
threadinactive.go
Added context methods returning nil for inactive threads
threadtasks_test.go
Added context methods for task threads
worker.go
Changed channels to use contextHolder instead of *frankenPHPContext
workerextension.go
Updated SendMessage to accept and use context
scaling.go
Updated logging to use global context and logger
phpmainthread.go
Updated logging to use global context and logger
internal/watcher/watcher.go
Added context parameter to InitWatcher and logging functions
internal/watcher/watch_pattern.go
Updated logging to use passed context
internal/testserver/main.go
Added context creation and usage
frankenphp_test.go
Added TestMain to suppress logs in non-verbose mode
phpmainthread_test.go
Added setupGlobals helper to properly initialize test contexts
types_test.go
Updated to use globalLogger instead of logger
workerextension_test.go
Updated test to pass context to SendMessage
cgi.go
Updated to use frankenPHPContext() method
caddy/app.go
Updated Stop method to use context-aware logging