Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Static Public Member Functions | Static Protected Attributes | List of all members
core\local\cli\shutdown Class Reference

CLI script shutdown helper class. More...

Static Public Member Functions

static script_supports_graceful_exit ()
 Declares that this CLI script can gracefully handle signals. More...
 
static should_gracefully_exit ()
 Should we gracefully exit? More...
 
static signal_handler (int $signo)
 Handle the signal. More...
 

Static Protected Attributes

static bool $cligracefulexit = false
 Should we exit gracefully at the next opportunity?
 

Detailed Description

CLI script shutdown helper class.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ script_supports_graceful_exit()

static core\local\cli\shutdown::script_supports_graceful_exit ( )
static

Declares that this CLI script can gracefully handle signals.

Return values
void

◆ should_gracefully_exit()

static core\local\cli\shutdown::should_gracefully_exit ( )
static

Should we gracefully exit?

Return values
booltrue if we should gracefully exit

◆ signal_handler()

static core\local\cli\shutdown::signal_handler ( int  $signo)
static

Handle the signal.

The first signal flags a graceful exit. If a second signal is received then it immediately exits.

Parameters
int$signoThe signal number
Return values
booltrue if we should exit

The documentation for this class was generated from the following file: