2024.8.23
Loading...
Searching...
No Matches
class.action.launchStartup.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 ActionLaunchStartup
12
*
13
* This class manages the application's launch startup settings.
14
* It initializes the settings based on the provided arguments and updates the configuration accordingly.
15
*/
16
class
ActionLaunchStartup
17
{
18
/**
19
* ActionLaunchStartup constructor.
20
*
21
* This constructor uses the provided arguments to determine whether to enable or disable the application's
22
* launch at startup feature. It starts the loading process, updates the launch startup configuration based on
23
* the provided argument, and modifies the system's startup settings accordingly.
24
*
25
* @param array $args An array of arguments where the first element should be either Config::ENABLED or Config::DISABLED
26
* to indicate the desired launch startup setting.
27
*/
28
public
function
__construct
($args)
29
{
30
global
$bearsamppConfig
;
31
32
if
(isset($args[0])) {
33
Util::startLoading
();
34
$launchStartup = $args[0] ==
Config::ENABLED
;
35
if
($launchStartup) {
36
Util::enableLaunchStartup
();
37
}
else
{
38
Util::disableLaunchStartup
();
39
}
40
$bearsamppConfig
->replace(
Config::CFG_LAUNCH_STARTUP
, $args[0]);
41
}
42
}
43
}
ActionLaunchStartup
Definition
class.action.launchStartup.php:17
ActionLaunchStartup\__construct
__construct($args)
Definition
class.action.launchStartup.php:28
Config\ENABLED
const ENABLED
Definition
class.config.php:32
Config\CFG_LAUNCH_STARTUP
const CFG_LAUNCH_STARTUP
Definition
class.config.php:30
Util\startLoading
static startLoading()
Definition
class.util.php:947
Util\enableLaunchStartup
static enableLaunchStartup()
Definition
class.util.php:655
Util\disableLaunchStartup
static disableLaunchStartup()
Definition
class.util.php:665
$bearsamppConfig
global $bearsamppConfig
Definition
homepage.php:26
Bearsampp-development
sandbox
core
classes
actions
class.action.launchStartup.php
Generated by
1.11.0