Bearsampp
2026.3.26
API documentation
Loading...
Searching...
No Matches
class.action.reload.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
17
class
ActionReload
18
{
31
public
function
__construct
($args)
32
{
33
global
$bearsamppRoot
,
$bearsamppCore
,
$bearsamppConfig
,
$bearsamppBins
, $bearsamppApps,
$bearsamppHomepage
;
34
35
// If the executable file exists, return early.
36
if
(file_exists(
$bearsamppCore
->getExec())) {
37
return
;
38
}
39
40
// Start loading process
41
Util::startLoading
();
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
51
$bearsamppConfig
->replace(
Config::CFG_LAUNCH_STARTUP
,
Util::isLaunchStartup
() ?
Config::ENABLED
:
Config::DISABLED
);
52
53
// Check and update the browser setting in the configuration
54
$currentBrowser =
$bearsamppConfig
->getBrowser();
55
if
(empty($currentBrowser) || !file_exists($currentBrowser)) {
56
$bearsamppConfig
->replace(
Config::CFG_BROWSER
,
Vbs::getDefaultBrowser
());
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
63
TplPowerShell::process
();
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
}
74
}
$bearsamppBins
global $bearsamppBins
Definition
ajax.apache.php:16
$bearsamppRoot
global $bearsamppRoot
Definition
ajax.apache.php:16
$bearsamppCore
global $bearsamppCore
Definition
ajax.latestversion.php:24
ActionReload
Definition
class.action.reload.php:18
ActionReload\__construct
__construct($args)
Definition
class.action.reload.php:31
Config\CFG_HOSTNAME
const CFG_HOSTNAME
Definition
class.config.php:30
Config\DISABLED
const DISABLED
Definition
class.config.php:36
Config\CFG_BROWSER
const CFG_BROWSER
Definition
class.config.php:31
Config\ENABLED
const ENABLED
Definition
class.config.php:35
Config\CFG_LAUNCH_STARTUP
const CFG_LAUNCH_STARTUP
Definition
class.config.php:33
TplApp\process
static process()
Definition
class.tpl.app.php:43
TplPowerShell\process
static process()
Definition
class.tpl.powershell.php:50
Util\isLaunchStartup
static isLaunchStartup()
Definition
class.util.php:895
Util\utf8ToCp1252
static utf8ToCp1252($data)
Definition
class.util.php:1379
Util\startLoading
static startLoading()
Definition
class.util.php:1399
Vbs\getDefaultBrowser
static getDefaultBrowser()
Definition
class.vbs.php:81
$bearsamppConfig
global $bearsamppConfig
Definition
homepage.php:41
$bearsamppHomepage
global $bearsamppHomepage
Definition
homepage.php:41
Bearsampp-development
sandbox
core
classes
actions
class.action.reload.php
Generated by
1.16.1