![]() |
Bearsampp 2025.8.29
|
Public Member Functions | |
__construct () |
Static Public Member Functions | |
static | exists ($pid) |
static | findByPath ($path) |
static | findByPid ($pid) |
static | getCurrentPid () |
static | getKeys () |
static | getListProcs () |
static | getStatProc () |
static | kill ($pid) |
static | killBins ($refreshProcs=false) |
Data Fields | |
const | CAPTION = 'Caption' |
const | COMMAND_LINE = 'CommandLine' |
const | EXECUTABLE_PATH = 'ExecutablePath' |
const | NAME = 'Name' |
const | PROCESS_ID = 'ProcessID' |
Static Private Member Functions | |
static | callWin32Ps ($function) |
Class Win32Ps
This class provides various utility functions for interacting with Windows processes. It includes methods for retrieving process information, checking process existence, finding processes by PID or path, and terminating processes.
Definition at line 18 of file class.win32ps.php.
__construct | ( | ) |
Definition at line 26 of file class.win32ps.php.
|
staticprivate |
Calls a specified function if it exists.
string | $function | The name of the function to call. |
Definition at line 36 of file class.win32ps.php.
References $result.
Referenced by getStatProc().
|
static |
Checks if a process with the specified PID exists.
int | $pid | The process ID to check. |
Definition at line 109 of file class.win32ps.php.
References findByPid().
|
static |
Finds a process by its executable path.
string | $path | The path to the executable. |
Definition at line 142 of file class.win32ps.php.
References $proc, Util\formatUnixPath(), and getListProcs().
|
static |
Finds a process by its PID.
int | $pid | The process ID to find. |
Definition at line 120 of file class.win32ps.php.
References $proc, and getListProcs().
Referenced by exists().
|
static |
Retrieves the current process ID.
Definition at line 68 of file class.win32ps.php.
References getStatProc().
Referenced by ActionLoading\__construct(), WinBinder\destroyWindow(), ActionLoading\processLoading(), ActionQuit\processWindow(), ActionStartup\processWindow(), and ActionQuit\terminatePhpProcesses().
|
static |
Retrieves the keys used for process information.
Definition at line 52 of file class.win32ps.php.
|
static |
Retrieves a list of running processes.
Definition at line 79 of file class.win32ps.php.
References Vbs\getListProcs().
Referenced by findByPath(), findByPid(), killBins(), Root\register(), and ActionQuit\terminatePhpProcesses().
|
static |
Retrieves the status of the current process.
Definition at line 89 of file class.win32ps.php.
References callWin32Ps().
Referenced by getCurrentPid().
|
static |
Terminates a process by its PID.
int | $pid | The process ID to terminate. |
Definition at line 165 of file class.win32ps.php.
References Vbs\killProc().
Referenced by killBins(), ActionLoading\processLoading(), Util\stopLoading(), and ActionQuit\terminatePhpProcesses().
|
static |
Terminates all Bearsampp-related processes except the current one.
bool | $refreshProcs | Whether to refresh the list of processes before terminating. |
Definition at line 179 of file class.win32ps.php.
References $bearsamppRoot, $proc, Util\contains(), Util\formatUnixPath(), getListProcs(), kill(), and Util\startWith().
Referenced by ActionManualRestart\__construct(), Batch\exitApp(), ActionStartup\installServices(), ActionStartup\killOldInstances(), ActionQuit\processWindow(), and ActionExt\procReload().
const CAPTION = 'Caption' |
Definition at line 23 of file class.win32ps.php.
const COMMAND_LINE = 'CommandLine' |
Definition at line 24 of file class.win32ps.php.
const EXECUTABLE_PATH = 'ExecutablePath' |
Definition at line 22 of file class.win32ps.php.
Referenced by Vbs\getListProcs(), ActionStartup\killOldInstances(), ActionStartup\processWindow(), and ActionQuit\terminatePhpProcesses().
const NAME = 'Name' |
Definition at line 20 of file class.win32ps.php.
const PROCESS_ID = 'ProcessID' |
Definition at line 21 of file class.win32ps.php.
Referenced by ActionStartup\killOldInstances(), ActionStartup\processWindow(), and ActionQuit\terminatePhpProcesses().