System_Daemon :: setSigHandler

0 Cevap php

I am using system daemon inside a class,
I am wondering if the following code for setting a handler is ok or not

System_Daemon::setSigHandler(SIGTERM, array($this, myShutdownHandler) );

in the documentation they don't mention how to pass an object method as a "handler"
here: array($this, shutdownHandler)

docs qiven örnek:

System_Daemon::setSigHandler(SIGTERM, "ownShutdownHandler" );

function ownShutdownHandler($sig)
{
 //etc
}

0 Cevap