2024.8.23
Loading...
Searching...
No Matches
class.action.manualRestart.php
Go to the documentation of this file.
1
<?php
2
/*
3
* Copyright (c) 2021-2024 Bearsampp
4
* License: GNU General Public License version 3 or later; see LICENSE.txt
5
* Author: Bear
6
* Website: https://bearsampp.com
7
* Github: https://github.com/Bearsampp
8
*/
9
10
/**
11
* Class ActionManualRestart
12
*
13
* This class handles the manual restart of services in the Bearsampp application.
14
* It stops all running services, kills all related processes, and sets the application
15
* to restart.
16
*/
17
class
ActionManualRestart
18
{
19
/**
20
* ActionManualRestart constructor.
21
*
22
* @param array $args Arguments passed to the constructor.
23
*
24
* This constructor initializes the manual restart process by performing the following steps:
25
* 1. Starts the loading process.
26
* 2. Deletes all services managed by Bearsampp.
27
* 3. Kills all related processes.
28
* 4. Sets the application to restart.
29
* 5. Stops the loading process.
30
*/
31
public
function
__construct
($args)
32
{
33
global
$bearsamppCore
,
$bearsamppBins
;
34
35
// Start the loading process
36
Util::startLoading
();
37
38
// Delete all services managed by Bearsampp
39
foreach
(
$bearsamppBins
->getServices() as $sName => $service) {
40
$service->delete();
41
}
42
43
// Kill all related processes
44
Win32Ps::killBins
(
true
);
45
46
// Set the application to restart
47
$bearsamppCore
->setExec(
ActionExec::RESTART
);
48
49
// Stop the loading process
50
Util::stopLoading
();
51
}
52
}
$bearsamppBins
global $bearsamppBins
Definition
ajax.apache.php:16
$bearsamppCore
global $bearsamppCore
Definition
ajax.latestversion.php:24
ActionExec\RESTART
const RESTART
Definition
class.action.exec.php:27
ActionManualRestart
Definition
class.action.manualRestart.php:18
ActionManualRestart\__construct
__construct($args)
Definition
class.action.manualRestart.php:31
Util\stopLoading
static stopLoading()
Definition
class.util.php:956
Util\startLoading
static startLoading()
Definition
class.util.php:947
Win32Ps\killBins
static killBins($refreshProcs=false)
Definition
class.win32ps.php:178
Bearsampp-development
sandbox
core
classes
actions
class.action.manualRestart.php
Generated by
1.11.0