2024.8.23
|
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 17 of file class.win32ps.php.
Win32Ps::__construct | ( | ) |
Definition at line 25 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 35 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 108 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 141 of file class.win32ps.php.
References $proc, $procs, Util\formatUnixPath(), and getListProcs().
|
static |
Finds a process by its PID.
int | $pid | The process ID to find. |
Definition at line 119 of file class.win32ps.php.
References $proc, $procs, and getListProcs().
Referenced by exists().
|
static |
Retrieves the current process ID.
Definition at line 67 of file class.win32ps.php.
References getStatProc().
Referenced by ActionLoading\__construct(), and ActionLoading\processLoading().
|
static |
Retrieves the keys used for process information.
Definition at line 51 of file class.win32ps.php.
|
static |
Retrieves a list of running processes.
Definition at line 78 of file class.win32ps.php.
References Vbs\getListProcs().
Referenced by findByPath(), findByPid(), killBins(), and Root\register().
|
static |
Retrieves the status of the current process.
Definition at line 88 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 164 of file class.win32ps.php.
References Vbs\killProc().
Referenced by killBins(), ActionLoading\processLoading(), and Util\stopLoading().
|
static |
Terminates all Bearsampp-related processes except the current one.
bool | $refreshProcs | Whether to refresh the list of processes before terminating. |
Definition at line 178 of file class.win32ps.php.
References $bearsamppRoot, $proc, $procs, Util\contains(), Util\formatUnixPath(), getListProcs(), kill(), and Util\startWith().
Referenced by ActionManualRestart\__construct(), Batch\exitApp(), ActionStartup\killOldInstances(), ActionQuit\processWindow(), and ActionExt\procReload().
const Win32Ps::CAPTION = 'Caption' |
Definition at line 22 of file class.win32ps.php.
const Win32Ps::COMMAND_LINE = 'CommandLine' |
Definition at line 23 of file class.win32ps.php.
const Win32Ps::EXECUTABLE_PATH = 'ExecutablePath' |
Definition at line 21 of file class.win32ps.php.
Referenced by Vbs\getListProcs(), ActionStartup\killOldInstances(), and ActionStartup\processWindow().
const Win32Ps::NAME = 'Name' |
Definition at line 19 of file class.win32ps.php.
const Win32Ps::PROCESS_ID = 'ProcessID' |
Definition at line 20 of file class.win32ps.php.
Referenced by ActionStartup\killOldInstances(), and ActionStartup\processWindow().