Bearsampp 2026.3.26
API documentation
Loading...
Searching...
No Matches
ActionReload Class Reference

Public Member Functions

 __construct ($args)

Detailed Description

Class ActionReload

This class handles the reloading of various configurations and settings for the Bearsampp application. It performs operations such as refreshing the hostname, updating startup settings, checking and updating the browser configuration, processing configuration files, and rebuilding certain cached contents.

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

Constructor & Destructor Documentation

◆ __construct()

__construct ( $args)

Constructs an ActionReload object and performs various refresh operations.

Parameters
array$argsThe arguments passed to the constructor.

@global Root $bearsamppRoot The root object of the Bearsampp application. @global Core $bearsamppCore The core object of the Bearsampp application. @global Config $bearsamppConfig The configuration object of the Bearsampp application. @global Bins $bearsamppBins The bins object containing various binaries used by the Bearsampp application. @global Apps $bearsamppApps The apps object containing various applications used by the Bearsampp application. @global Homepage $bearsamppHomepage The homepage object for managing homepage-related settings and content.

Definition at line 31 of file class.action.reload.php.

32 {
34
35 // If the executable file exists, return early.
36 if (file_exists($bearsamppCore->getExec())) {
37 return;
38 }
39
40 // Start loading process
42
43 // Reload bins and apps to recreate symlinks if needed
44 $bearsamppBins->reload();
45 $bearsamppApps->reload();
46
47 // Refresh hostname in the configuration
48 $bearsamppConfig->replace(Config::CFG_HOSTNAME, gethostname());
49
50 // Refresh launch startup setting in the configuration
52
53 // Check and update the browser setting in the configuration
54 $currentBrowser = $bearsamppConfig->getBrowser();
55 if (empty($currentBrowser) || !file_exists($currentBrowser)) {
57 }
58
59 // Process and update the bearsampp.ini file
60 file_put_contents($bearsamppRoot->getIniFilePath(), Util::utf8ToCp1252(TplApp::process()));
61
62 // Process and update the PowerShell configuration
64
65 // Refresh PEAR version cache file
66 $bearsamppBins->getPhp()->getPearVersion();
67
68 // Rebuild alias homepage content
69 $bearsamppHomepage->refreshAliasContent();
70
71 // Rebuild _commons.js content
72 $bearsamppHomepage->refreshCommonsJsContent();
73 }
global $bearsamppBins
global $bearsamppRoot
global $bearsamppCore
const CFG_HOSTNAME
const DISABLED
const CFG_BROWSER
const ENABLED
const CFG_LAUNCH_STARTUP
static process()
static isLaunchStartup()
static utf8ToCp1252($data)
static startLoading()
static getDefaultBrowser()
Definition class.vbs.php:81
global $bearsamppConfig
Definition homepage.php:41
global $bearsamppHomepage
Definition homepage.php:41

References $bearsamppBins, $bearsamppConfig, $bearsamppCore, $bearsamppHomepage, $bearsamppRoot, Config\CFG_BROWSER, Config\CFG_HOSTNAME, Config\CFG_LAUNCH_STARTUP, Config\DISABLED, Config\ENABLED, Vbs\getDefaultBrowser(), Util\isLaunchStartup(), TplApp\process(), TplPowerShell\process(), Util\startLoading(), and Util\utf8ToCp1252().


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