2024.8.23
Loading...
Searching...
No Matches
ActionExec Class Reference

Public Member Functions

 __construct ($args)
 

Data Fields

const QUIT = 'quit'
 
const RESTART = 'restart'
 

Detailed Description

Class ActionExec

This class handles the execution of specific actions based on the content of a file. The actions include quitting the application or restarting it. The actions are read from a file whose path is provided by the global $bearsamppCore object.

Definition at line 17 of file class.action.exec.php.

Constructor & Destructor Documentation

◆ __construct()

ActionExec::__construct ( $args)

ActionExec constructor.

This constructor reads the action from a file specified by $bearsamppCore->getExec(). If the action is 'quit', it calls Batch\exitApp(). If the action is 'restart', it calls Batch\restartApp(). After executing the action, it deletes the action file.

Parameters
array$argsArguments passed to the constructor (not used in the current implementation).

Definition at line 38 of file class.action.exec.php.

39 {
40 global $bearsamppCore;
41
42 if (file_exists($bearsamppCore->getExec())) {
43 $action = file_get_contents($bearsamppCore->getExec());
44 if ($action == self::QUIT) {
46 } elseif ($action == self::RESTART) {
48 }
49 @unlink($bearsamppCore->getExec());
50 }
51 }
global $bearsamppCore
static exitApp($restart=false)
static restartApp()

References $bearsamppCore, Batch\exitApp(), and Batch\restartApp().

Field Documentation

◆ QUIT

const ActionExec::QUIT = 'quit'

Constant representing the 'quit' action.

Definition at line 22 of file class.action.exec.php.

◆ RESTART

const ActionExec::RESTART = 'restart'

Constant representing the 'restart' action.

Definition at line 27 of file class.action.exec.php.

Referenced by ActionManualRestart\__construct(), ActionStartup\processWindow(), and ActionSwitchVersion\processWindow().


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