2024.8.23
|
Public Member Functions | |
__construct ($args) | |
processWindow ($window, $id, $ctrl, $param1, $param2) | |
Data Fields | |
const | GAUGE_OTHERS = 19 |
const | GAUGE_SERVICES = 5 |
Private Member Functions | |
changePath () | |
checkBinsRegKey () | |
checkBrowser () | |
checkLaunchStartup () | |
checkPath () | |
checkPathRegKey () | |
checkSystemPathRegKey () | |
cleanOldBehaviors () | |
cleanTmpFolders () | |
createSslCrts () | |
installServices () | |
killOldInstances () | |
refreshAliases () | |
refreshGitRepos () | |
refreshHostname () | |
refreshVhosts () | |
rotationLogs () | |
savePath () | |
scanFolders () | |
sysInfos () | |
updateConfig () | |
writeLog ($log) | |
Private Attributes | |
$error | |
$filesToScan | |
$restart | |
$rootPath | |
$splash | |
$startTime | |
Class ActionStartup Handles the startup process of the Bearsampp application, including initializing services, cleaning temporary files, refreshing configurations, and more.
Definition at line 15 of file class.action.startup.php.
ActionStartup::__construct | ( | $args | ) |
ActionStartup constructor. Initializes the startup process, including the splash screen and various configurations.
array | $args | Command line arguments. |
Definition at line 34 of file class.action.startup.php.
References $bearsamppBins, $bearsamppCore, $bearsamppLang, $bearsamppRoot, APP_TITLE, Util\getMicrotime(), Lang\STARTUP, Lang\STARTUP_STARTING_TEXT, and writeLog().
|
private |
Changes the application path and logs the number of files and occurrences changed.
Definition at line 460 of file class.action.startup.php.
References $bearsamppLang, $result, Util\changePath(), Lang\STARTUP_CHANGE_PATH_TEXT, and writeLog().
Referenced by processWindow().
|
private |
Checks and updates the application bins registry key. If the current registry key does not match the generated key, it updates the registry key. Logs the current and generated registry keys. Sets an error message if the registry key update fails. Sets a restart flag if the registry key is updated.
Definition at line 519 of file class.action.startup.php.
References $bearsamppLang, Registry\APP_BINS_REG_ENTRY, Util\getAppBinsRegKey(), Util\setAppBinsRegKey(), Lang\STARTUP_REGISTRY_ERROR_TEXT, Lang\STARTUP_REGISTRY_TEXT, and writeLog().
Referenced by processWindow().
|
private |
Checks and sets the default browser configuration.
Definition at line 374 of file class.action.startup.php.
References $bearsamppConfig, $bearsamppLang, Config\CFG_BROWSER, Vbs\getDefaultBrowser(), Lang\STARTUP_CHECK_BROWSER_TEXT, and writeLog().
Referenced by processWindow().
|
private |
Checks and sets the launch startup configuration.
Definition at line 357 of file class.action.startup.php.
References $bearsamppConfig, Util\disableLaunchStartup(), Util\enableLaunchStartup(), and writeLog().
Referenced by processWindow().
|
private |
Checks the application path and logs the last path content.
Definition at line 433 of file class.action.startup.php.
References $bearsamppCore, $bearsamppLang, Lang\STARTUP_CHECK_PATH_TEXT, and writeLog().
Referenced by processWindow().
|
private |
Checks and updates the application path registry key.
Definition at line 486 of file class.action.startup.php.
References $bearsamppLang, $bearsamppRoot, Registry\APP_PATH_REG_ENTRY, Util\formatWindowsPath(), Util\getAppPathRegKey(), Util\setAppPathRegKey(), Lang\STARTUP_REGISTRY_ERROR_TEXT, Lang\STARTUP_REGISTRY_TEXT, and writeLog().
Referenced by processWindow().
|
private |
Checks and updates the system PATH registry key. Ensures the application bins registry entry is at the beginning of the system PATH. Logs the current and new system PATH. Sets an error message if the system PATH update fails. Sets a restart flag if the system PATH is updated.
Definition at line 552 of file class.action.startup.php.
References $bearsamppLang, Registry\APP_BINS_REG_ENTRY, Util\getSysPathRegKey(), Util\setSysPathRegKey(), Lang\STARTUP_REGISTRY_ERROR_TEXT, Lang\STARTUP_REGISTRY_TEXT, Registry\SYSPATH_REG_ENTRY, and writeLog().
Referenced by processWindow().
|
private |
Cleans old behaviors by removing outdated registry entries.
Definition at line 288 of file class.action.startup.php.
References $bearsamppLang, APP_TITLE, Registry\HKEY_LOCAL_MACHINE, Lang\STARTUP_CLEAN_OLD_BEHAVIORS_TEXT, and writeLog().
Referenced by processWindow().
|
private |
Cleans temporary folders by removing unnecessary files.
Definition at line 273 of file class.action.startup.php.
References $bearsamppCore, $bearsamppLang, $bearsamppRoot, Util\clearFolder(), Lang\STARTUP_CLEAN_TMP_TEXT, and writeLog().
Referenced by processWindow().
|
private |
Creates SSL certificates if they do not already exist. Logs the creation process.
Definition at line 608 of file class.action.startup.php.
References $bearsamppLang, and Lang\STARTUP_GEN_SSL_CRT_TEXT.
Referenced by processWindow().
|
private |
Installs and starts services for the application. Checks if services are already installed and updates them if necessary. Logs the installation process and any errors encountered.
Definition at line 624 of file class.action.startup.php.
References $bearsamppBins, $bearsamppLang, $bearsamppRoot, $port, BinApache\CMD_SYNTAX_CHECK, BinMariadb\CMD_SYNTAX_CHECK, BinMysql\CMD_SYNTAX_CHECK, Util\getMicrotime(), Util\isPortInUse(), BinApache\SERVICE_NAME, BinFilezilla\SERVICE_NAME, BinMailhog\SERVICE_NAME, BinMailpit\SERVICE_NAME, BinMariadb\SERVICE_NAME, BinMemcached\SERVICE_NAME, BinMysql\SERVICE_NAME, BinPostgresql\SERVICE_NAME, BinXlight\SERVICE_NAME, Lang\STARTUP_CHECK_SERVICE_TEXT, Lang\STARTUP_INSTALL_SERVICE_TEXT, Lang\STARTUP_SERVICE_CREATE_ERROR, Lang\STARTUP_SERVICE_ERROR, Lang\STARTUP_SERVICE_PORT_ERROR, Lang\STARTUP_SERVICE_START_ERROR, Lang\STARTUP_SERVICE_SYNTAX_ERROR, Lang\STARTUP_START_SERVICE_TEXT, Win32Service\VBS_PATH_NAME, and writeLog().
Referenced by processWindow().
|
private |
Kills old instances of Bearsampp processes.
Definition at line 308 of file class.action.startup.php.
References $bearsamppLang, $proc, Win32Ps\EXECUTABLE_PATH, Util\formatUnixPath(), Win32Ps\killBins(), Win32Ps\PROCESS_ID, Lang\STARTUP_KILL_OLD_PROCS_TEXT, and writeLog().
Referenced by processWindow().
ActionStartup::processWindow | ( | $window, | |
$id, | |||
$ctrl, | |||
$param1, | |||
$param2 ) |
Processes the main window events during startup.
mixed | $window | The window handle. |
int | $id | The event ID. |
mixed | $ctrl | The control that triggered the event. |
mixed | $param1 | Additional parameter 1. |
mixed | $param2 | Additional parameter 2. |
Definition at line 72 of file class.action.startup.php.
References $bearsamppBins, $bearsamppCore, $bearsamppLang, $bearsamppRoot, $proc, APP_TITLE, changePath(), checkBinsRegKey(), checkBrowser(), checkLaunchStartup(), checkPath(), checkPathRegKey(), checkSystemPathRegKey(), cleanOldBehaviors(), cleanTmpFolders(), createSslCrts(), Lang\DISABLED, Win32Ps\EXECUTABLE_PATH, Util\formatUnixPath(), Util\getMicrotime(), installServices(), killOldInstances(), Win32Ps\PROCESS_ID, refreshAliases(), refreshGitRepos(), refreshHostname(), refreshVhosts(), ActionExec\RESTART, rotationLogs(), savePath(), scanFolders(), Util\startLoading(), Lang\STARTUP_ERROR_TITLE, Lang\STARTUP_PREPARE_RESTART_TEXT, sysInfos(), updateConfig(), and writeLog().
|
private |
Refreshes the aliases in the Apache configuration.
Definition at line 405 of file class.action.startup.php.
References $bearsamppBins, $bearsamppConfig, $bearsamppLang, Lang\STARTUP_REFRESH_ALIAS_TEXT, and writeLog().
Referenced by processWindow().
|
private |
Refreshes Git repositories if the scan on startup is enabled. Logs the number of repositories found.
Definition at line 767 of file class.action.startup.php.
References $bearsamppLang, Lang\STARTUP_REFRESH_GIT_REPOS_TEXT, and writeLog().
Referenced by processWindow().
|
private |
Refreshes the hostname in the configuration.
Definition at line 343 of file class.action.startup.php.
References $bearsamppConfig, $bearsamppLang, Config\CFG_HOSTNAME, Lang\STARTUP_REFRESH_HOSTNAME_TEXT, and writeLog().
Referenced by processWindow().
|
private |
Refreshes the virtual hosts in the Apache configuration.
Definition at line 419 of file class.action.startup.php.
References $bearsamppBins, $bearsamppConfig, $bearsamppLang, Lang\STARTUP_REFRESH_VHOSTS_TEXT, and writeLog().
Referenced by processWindow().
|
private |
Rotates the logs by archiving old logs and purging old archives.
Definition at line 192 of file class.action.startup.php.
References $bearsamppBins, $bearsamppConfig, $bearsamppCore, $bearsamppLang, $bearsamppRoot, Util\clearFolder(), Util\clearFolders(), Util\deleteFolder(), and Lang\STARTUP_ROTATION_LOGS_TEXT.
Referenced by processWindow().
|
private |
Saves the current application path.
Definition at line 475 of file class.action.startup.php.
References $bearsamppCore, and writeLog().
Referenced by processWindow().
|
private |
Scans folders and logs the number of files to scan.
Definition at line 446 of file class.action.startup.php.
References $bearsamppLang, Util\getFilesToScan(), Lang\STARTUP_SCAN_FOLDERS_TEXT, and writeLog().
Referenced by processWindow().
|
private |
Logs system information.
Definition at line 391 of file class.action.startup.php.
References $bearsamppLang, Batch\getOsInfo(), Lang\STARTUP_SYS_INFOS, and writeLog().
Referenced by processWindow().
|
private |
Updates the configuration for bins, tools, and apps. Logs the update process.
Definition at line 591 of file class.action.startup.php.
References $bearsamppBins, $bearsamppLang, Lang\STARTUP_UPDATE_CONFIG_TEXT, and writeLog().
Referenced by processWindow().
|
private |
Writes a log message to the startup log file.
string | $log | The log message to write. |
Definition at line 785 of file class.action.startup.php.
References $bearsamppRoot, and Util\logDebug().
Referenced by __construct(), changePath(), checkBinsRegKey(), checkBrowser(), checkLaunchStartup(), checkPath(), checkPathRegKey(), checkSystemPathRegKey(), cleanOldBehaviors(), cleanTmpFolders(), installServices(), killOldInstances(), processWindow(), refreshAliases(), refreshGitRepos(), refreshHostname(), refreshVhosts(), savePath(), scanFolders(), sysInfos(), and updateConfig().
|
private |
Definition at line 20 of file class.action.startup.php.
|
private |
Definition at line 23 of file class.action.startup.php.
|
private |
Definition at line 18 of file class.action.startup.php.
|
private |
Definition at line 22 of file class.action.startup.php.
|
private |
Definition at line 17 of file class.action.startup.php.
|
private |
Definition at line 19 of file class.action.startup.php.
const ActionStartup::GAUGE_OTHERS = 19 |
Definition at line 26 of file class.action.startup.php.
const ActionStartup::GAUGE_SERVICES = 5 |
Definition at line 25 of file class.action.startup.php.