![]() |
2024.8.23
|
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 17 of file class.vbs.php.
| Vbs::__construct | ( | ) |
Definition at line 27 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 49 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 304 of file class.vbs.php.
References $bearsamppCore, $bearsamppRoot, $result, APP_TITLE, exec(), getResultFile(), and Util\logError().
Referenced by Util\enableLaunchStartup().
Here is the caller graph for this function:
|
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 429 of file class.vbs.php.
Referenced by countFilesFolders(), createShortcut(), Registry\exists(), getDefaultBrowser(), getInstalledBrowsers(), getListProcs(), getSpecialPath(), Registry\getValue(), killProc(), and Registry\setValue().
Here is the caller graph for this function:
|
static |
Retrieves the default browser's executable path.
Definition at line 80 of file class.vbs.php.
References $result, exec(), and getResultFile().
Referenced by ActionReload\__construct(), and ActionStartup\checkBrowser().
Here is the caller graph for this function:
|
static |
Retrieves a list of installed browsers' executable paths.
Definition at line 113 of file class.vbs.php.
References $result, exec(), and getResultFile().
Referenced by ActionChangeBrowser\__construct().
Here is the caller graph for this function:
|
static |
Retrieves a list of running processes with specified keys.
| array | $vbsKeys | The keys to retrieve for each process. |
Definition at line 163 of file class.vbs.php.
References $result, exec(), Win32Ps\EXECUTABLE_PATH, and getResultFile().
Referenced by Win32Ps\getListProcs().
Here is the caller graph for this function:
|
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 414 of file class.vbs.php.
Referenced by countFilesFolders(), createShortcut(), Registry\exists(), getDefaultBrowser(), getInstalledBrowsers(), getListProcs(), getServiceInfos(), getSpecialPath(), Registry\getValue(), killProc(), and Registry\setValue().
Here is the caller graph for this function:
|
static |
Retrieves information about a Windows service.
| string | $serviceName | The name of the service to retrieve information about. |
Definition at line 345 of file class.vbs.php.
References getResultFile(), and Win32Service\getVbsKeys().
Referenced by Nssm\infos(), and Win32Service\infos().
Here is the caller graph for this function:
|
staticprivate |
Retrieves a special folder path.
| string | $path | The VBScript path constant for the special folder. |
Definition at line 265 of file class.vbs.php.
References $result, exec(), Util\formatUnixPath(), and getResultFile().
Referenced by getStartupPath().
Here is the caller graph for this function:
|
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 292 of file class.vbs.php.
References getSpecialPath().
Referenced by Util\getStartupLnkPath().
Here is the caller graph for this function:
|
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 400 of file class.vbs.php.
|
static |
Terminates a process by its PID.
| int | $pid | The process ID to terminate. |
Definition at line 223 of file class.vbs.php.
References $result, exec(), getResultFile(), and Util\logDebug().
Referenced by Win32Ps\kill().
Here is the caller graph for this function:
|
staticprivate |
Writes a log entry to the VBS log file.
| string | $log | The log message to write. |
Definition at line 36 of file class.vbs.php.
References $bearsamppRoot, and Util\logDebug().
| const Vbs::ALL_DESKTOP_PATH = 'objShell.SpecialFolders("AllUsersDesktop")' |
Definition at line 23 of file class.vbs.php.
| const Vbs::ALL_STARTUP_PATH = 'objShell.SpecialFolders("AllUsersStartup")' |
Definition at line 25 of file class.vbs.php.
| const Vbs::DESKTOP_PATH = 'objShell.SpecialFolders("Desktop")' |
Definition at line 22 of file class.vbs.php.
| const Vbs::END_PROCESS_STR = 'FINISHED!' |
Definition at line 19 of file class.vbs.php.
| const Vbs::STARTUP_PATH = 'objShell.SpecialFolders("Startup")' |
Definition at line 24 of file class.vbs.php.
| const Vbs::STR_SEPARATOR = ' || ' |
Definition at line 20 of file class.vbs.php.