![]() |
Bearsampp 2025.8.29
|
Public Member Functions | |
__construct () |
Static Public Member Functions | |
static | countFilesFolders ($path) |
static | createShortcut ($savePath) |
static | exec ($basename, $resultFile, $content, $timeout=true) |
static | getDefaultBrowser () |
static | getInstalledBrowsers () |
static | getListProcs ($vbsKeys) |
static | getResultFile ($basename) |
static | getServiceInfos ($serviceName) |
static | getStartupPath ($file=null) |
static | getTmpFile ($ext, $customName=null) |
static | killProc ($pid) |
Data Fields | |
const | ALL_DESKTOP_PATH = 'objShell.SpecialFolders("AllUsersDesktop")' |
const | ALL_STARTUP_PATH = 'objShell.SpecialFolders("AllUsersStartup")' |
const | DESKTOP_PATH = 'objShell.SpecialFolders("Desktop")' |
const | END_PROCESS_STR = 'FINISHED!' |
const | STARTUP_PATH = 'objShell.SpecialFolders("Startup")' |
const | STR_SEPARATOR = ' || ' |
Static Private Member Functions | |
static | getSpecialPath ($path) |
static | writeLog ($log) |
Class Vbs
This class provides various utility functions for interacting with the Windows operating system using VBScript. It includes methods for counting files and folders, retrieving default and installed browsers, managing processes, and creating shortcuts.
Definition at line 18 of file class.vbs.php.
__construct | ( | ) |
Definition at line 28 of file class.vbs.php.
|
static |
Counts the number of files and folders in the specified path.
string | $path | The path to count files and folders in. |
Definition at line 50 of file class.vbs.php.
References $result, exec(), and getResultFile().
|
static |
Creates a shortcut to the Bearsampp executable.
string | $savePath | The path to save the shortcut. |
Definition at line 314 of file class.vbs.php.
References $bearsamppCore, $bearsamppRoot, $result, APP_TITLE, exec(), getResultFile(), and Util\logError().
Referenced by Util\enableLaunchStartup().
|
static |
Executes a VBScript file and retrieves the result.
string | $basename | The base name for the script and result files. |
string | $resultFile | The path to the result file. |
string | $content | The VBScript content to execute. |
int | bool | $timeout | The timeout duration in seconds, or true for default timeout, or false for no timeout. |
Definition at line 439 of file class.vbs.php.
Referenced by countFilesFolders(), createShortcut(), Registry\exists(), getDefaultBrowser(), getInstalledBrowsers(), getListProcs(), getSpecialPath(), Registry\getValue(), killProc(), and Registry\setValue().
|
static |
Retrieves the default browser's executable path.
Definition at line 81 of file class.vbs.php.
References $result, exec(), and getResultFile().
Referenced by ActionReload\__construct(), and ActionStartup\checkBrowser().
|
static |
Retrieves a list of installed browsers' executable paths.
Definition at line 114 of file class.vbs.php.
References $result, exec(), and getResultFile().
Referenced by ActionChangeBrowser\__construct().
|
static |
Retrieves a list of running processes with specified keys.
array | $vbsKeys | The keys to retrieve for each process. |
Definition at line 164 of file class.vbs.php.
References $result, exec(), Win32Ps\EXECUTABLE_PATH, and getResultFile().
Referenced by Win32Ps\getListProcs().
|
static |
Retrieves the path for a result file based on a given basename.
string | $basename | The base name to use for the result file. |
Definition at line 424 of file class.vbs.php.
Referenced by countFilesFolders(), createShortcut(), Registry\exists(), getDefaultBrowser(), getInstalledBrowsers(), getListProcs(), getServiceInfos(), getSpecialPath(), Registry\getValue(), killProc(), and Registry\setValue().
|
static |
Retrieves information about a Windows service.
string | $serviceName | The name of the service to retrieve information about. |
Definition at line 355 of file class.vbs.php.
References getResultFile(), and Win32Service\getVbsKeys().
Referenced by Nssm\infos(), and Win32Service\infos().
|
staticprivate |
Retrieves a special folder path.
string | $path | The VBScript path constant for the special folder. |
Definition at line 275 of file class.vbs.php.
References $result, exec(), Util\formatUnixPath(), and getResultFile().
Referenced by getStartupPath().
|
static |
Retrieves the startup path, optionally appending a file name.
string | null | $file | The file name to append to the startup path. |
Definition at line 302 of file class.vbs.php.
References getSpecialPath().
Referenced by Util\getStartupLnkPath().
|
static |
Generates a temporary file path with a given extension and optional custom name.
string | $ext | The file extension for the temporary file. |
string | null | $customName | An optional custom name to include in the file name. |
Definition at line 410 of file class.vbs.php.
|
static |
Terminates a process by its PID.
int | $pid | The process ID to terminate. |
Definition at line 224 of file class.vbs.php.
References $result, exec(), getResultFile(), and Util\logDebug().
Referenced by Win32Ps\kill(), and ActionQuit\terminatePhpProcesses().
|
staticprivate |
Writes a log entry to the VBS log file.
string | $log | The log message to write. |
Definition at line 37 of file class.vbs.php.
References $bearsamppRoot, and Util\logDebug().
const ALL_DESKTOP_PATH = 'objShell.SpecialFolders("AllUsersDesktop")' |
Definition at line 24 of file class.vbs.php.
const ALL_STARTUP_PATH = 'objShell.SpecialFolders("AllUsersStartup")' |
Definition at line 26 of file class.vbs.php.
const DESKTOP_PATH = 'objShell.SpecialFolders("Desktop")' |
Definition at line 23 of file class.vbs.php.
const END_PROCESS_STR = 'FINISHED!' |
Definition at line 20 of file class.vbs.php.
const STARTUP_PATH = 'objShell.SpecialFolders("Startup")' |
Definition at line 25 of file class.vbs.php.
const STR_SEPARATOR = ' || ' |
Definition at line 21 of file class.vbs.php.