MCPcopy Index your code
hub / github.com/php/frankenphp / Shutdown

Function Shutdown

frankenphp.go:362–389  ·  view source on GitHub ↗

Shutdown stops the workers and the PHP runtime.

()

Source from the content-addressed store, hash-verified

360
361// Shutdown stops the workers and the PHP runtime.
362func Shutdown() {
363 if !isRunning {
364 return
365 }
366
367 // call the shutdown hooks (mainly useful for extensions)
368 for _, fn := range onServerShutdown {
369 fn()
370 }
371
372 drainWatchers()
373 drainAutoScaling()
374 drainPHPThreads()
375
376 metrics.Shutdown()
377
378 // Remove the installed app
379 if EmbeddedAppPath != "" {
380 _ = os.RemoveAll(EmbeddedAppPath)
381 }
382
383 isRunning = false
384 if globalLogger.Enabled(globalCtx, slog.LevelDebug) {
385 globalLogger.LogAttrs(globalCtx, slog.LevelDebug, "FrankenPHP shut down")
386 }
387
388 resetGlobals()
389}
390
391// ServeHTTP executes a PHP script according to the given context.
392func ServeHTTP(responseWriter http.ResponseWriter, request *http.Request) error {

Callers 9

runTestFunction · 0.92
ExampleServeHTTPFunction · 0.92
ExampleServeHTTP_workersFunction · 0.92
testRegisterExtensionFunction · 0.92
mainFunction · 0.92
StartMethod · 0.92
StopMethod · 0.92
InitFunction · 0.85
TestWorkersExtensionFunction · 0.85

Calls 5

drainAutoScalingFunction · 0.85
drainPHPThreadsFunction · 0.85
resetGlobalsFunction · 0.85
drainWatchersFunction · 0.70
ShutdownMethod · 0.65

Tested by 4

runTestFunction · 0.74
ExampleServeHTTPFunction · 0.74
ExampleServeHTTP_workersFunction · 0.74
TestWorkersExtensionFunction · 0.68