Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
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.
 
static should_gracefully_exit ()
 Should we gracefully exit?
 
static signal_handler (int $signo)
 Handle the signal.
 

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: