|
Bearsampp 2026.3.26
API documentation
|
Public Member Functions | |
| __construct ($args) | |
| processWindow ($window, $id, $ctrl, $param1, $param2) | |
Static Public Member Functions | |
| static | terminatePhpProcesses ($excludePid, $window=null, $splash=null, $timeout=10) |
Data Fields | |
| const | GAUGE_OTHERS = 1 |
| const | GAUGE_PROCESSES = 1 |
Private Member Functions | |
| checkForOrphanedProcesses () | |
| cleanupTemporaryFiles () | |
| generateCleanupReport ($serviceVerification, $symlinkVerification, $tempCleanup, $orphanedProcesses) | |
| getServiceDisplayName ($sName, $service) | |
| getServiceShutdownOrder () | |
| performQuickCleanupVerification ($services) | |
| verifyServicesStoppedAndCleanup ($services) | |
| verifySymlinksRemoved () | |
Private Attributes | |
| $splash | |
Class ActionQuit Handles the quitting process of the Bearsampp application. Displays a splash screen and stops all services and processes.
Definition at line 16 of file class.action.quit.php.
| __construct | ( | $args | ) |
ActionQuit constructor. Initializes the quitting process, displays the splash screen, and sets up the main loop.
| array | $args | Command line arguments. |
Definition at line 35 of file class.action.quit.php.
References $bearsamppBins, $bearsamppCore, $bearsamppLang, APP_TITLE, Lang\EXIT_LEAVING_TEXT, Util\logDebug(), Util\logInfo(), and Lang\QUIT.
|
private |
Check for orphaned Bearsampp processes that should have been terminated.
Definition at line 526 of file class.action.quit.php.
References $bearsamppRoot, $proc, Win32Ps\EXECUTABLE_PATH, Util\formatUnixPath(), Win32Ps\getCurrentPid(), Win32Ps\getListProcs(), Win32Ps\kill(), Util\logDebug(), Util\logError(), Util\logInfo(), Util\logWarning(), and Win32Ps\PROCESS_ID.
Referenced by performQuickCleanupVerification().
|
private |
Clean up temporary files created during Bearsampp operation.
Definition at line 447 of file class.action.quit.php.
References $bearsamppCore, Util\logDebug(), Util\logError(), Util\logInfo(), and Util\logWarning().
Referenced by performQuickCleanupVerification().
|
private |
Generate a comprehensive cleanup report.
| array | $serviceVerification | Service verification results |
| array | $symlinkVerification | Symlink verification results |
| array | $tempCleanup | Temp file cleanup results |
| array | $orphanedProcesses | Orphaned process check results |
Definition at line 608 of file class.action.quit.php.
References $proc.
|
private |
Get the display name for a service.
| string | $sName | The service name constant |
| object | $service | The service object |
Definition at line 97 of file class.action.quit.php.
References $bearsamppBins, BinApache\SERVICE_NAME, BinMailpit\SERVICE_NAME, BinMariadb\SERVICE_NAME, BinMemcached\SERVICE_NAME, BinMysql\SERVICE_NAME, BinPostgresql\SERVICE_NAME, and BinXlight\SERVICE_NAME.
Referenced by processWindow(), and verifyServicesStoppedAndCleanup().
|
private |
Get the optimal service shutdown order based on dependencies. Services are ordered to stop dependent services first, then core services.
Definition at line 70 of file class.action.quit.php.
References BinApache\SERVICE_NAME, BinMailpit\SERVICE_NAME, BinMariadb\SERVICE_NAME, BinMemcached\SERVICE_NAME, BinMysql\SERVICE_NAME, BinPostgresql\SERVICE_NAME, and BinXlight\SERVICE_NAME.
Referenced by processWindow().
|
private |
Perform quick cleanup verification without blocking the exit process. This is a lightweight version that only does essential checks.
| array | $services | Array of service objects |
Definition at line 665 of file class.action.quit.php.
References checkForOrphanedProcesses(), cleanupTemporaryFiles(), Util\logDebug(), Util\logInfo(), and Util\logWarning().
Referenced by processWindow().
| processWindow | ( | $window, | |
| $id, | |||
| $ctrl, | |||
| $param1, | |||
| $param2 ) |
Processes the splash screen window events. Stops all services in optimal order, deletes symlinks, and kills remaining processes.
| resource | $window | The window resource. |
| int | $id | The event ID. |
| int | $ctrl | The control ID. |
| mixed | $param1 | Additional parameter 1. |
| mixed | $param2 | Additional parameter 2. |
Definition at line 139 of file class.action.quit.php.
References $bearsamppBins, $bearsamppLang, $result, Symlinks\deleteCurrentSymlinks(), exit, Lang\EXIT_REMOVE_SERVICE_TEXT, Lang\EXIT_STOP_OTHER_PROCESS_TEXT, Win32Ps\getCurrentPid(), getServiceDisplayName(), getServiceShutdownOrder(), Win32Ps\killBins(), Util\logDebug(), Util\logInfo(), Util\logWarning(), performQuickCleanupVerification(), and terminatePhpProcesses().
|
static |
Terminates PHP processes with timeout handling.
| int | $excludePid | Process ID to exclude |
| mixed | $window | Window handle or null |
| mixed | $splash | Splash screen or null |
| int | $timeout | Maximum time to wait for termination (seconds) |
Definition at line 233 of file class.action.quit.php.
References $bearsamppCore, $proc, $splash, Win32Ps\EXECUTABLE_PATH, exit, Win32Ps\getCurrentPid(), Win32Ps\getListProcs(), Win32Ps\kill(), Vbs\killProc(), Util\logTrace(), and Win32Ps\PROCESS_ID.
Referenced by processWindow().
|
private |
Verify that all services are actually stopped and clean up any that are still running.
| array | $services | Array of service objects |
Definition at line 313 of file class.action.quit.php.
References getServiceDisplayName(), Util\logDebug(), Util\logError(), Util\logInfo(), and Util\logWarning().
|
private |
Verify that symlinks have been removed.
Definition at line 381 of file class.action.quit.php.
References $bearsamppRoot, Util\logError(), Util\logInfo(), and Util\logWarning().
|
private |
Definition at line 21 of file class.action.quit.php.
Referenced by terminatePhpProcesses().
| const GAUGE_OTHERS = 1 |
Definition at line 27 of file class.action.quit.php.
| const GAUGE_PROCESSES = 1 |
Gauge values for progress bar increments.
Definition at line 26 of file class.action.quit.php.