![]() |
2024.8.23
|
Public Member Functions | |
__construct () | |
__toString () | |
addLoadingPid ($pid) | |
getAjaxPath ($aetrayPath=false) | |
getAppVersion () | |
getExec ($aetrayPath=false) | |
getFileFromUrl (string $moduleUrl, string $filePath, $progressBar=false) | |
getHomepagePath ($aetrayPath=false) | |
getHostsEditorExe ($aetrayPath=false) | |
getHostsEditorPath ($aetrayPath=false) | |
getIconsPath ($aetrayPath=false) | |
getisRootFilePath ($aetrayPath=false) | |
getLangsPath ($aetrayPath=false) | |
getLastPath ($aetrayPath=false) | |
getLastPathContent () | |
getLibsPath ($aetrayPath=false) | |
getLnExe ($aetrayPath=false) | |
getLnPath ($aetrayPath=false) | |
getLoadingPid ($aetrayPath=false) | |
getNssmExe ($aetrayPath=false) | |
getNssmPath ($aetrayPath=false) | |
getOpenSslConf ($aetrayPath=false) | |
getOpenSslExe ($aetrayPath=false) | |
getOpenSslPath ($aetrayPath=false) | |
getPhpExe ($aetrayPath=false) | |
getPhpPath ($aetrayPath=false) | |
getPwgenExe ($aetrayPath=false) | |
getPwgenPath ($aetrayPath=false) | |
getResourcesPath ($aetrayPath=false) | |
getScript ($type) | |
getScriptsPath ($aetrayPath=false) | |
getSetEnvExe ($aetrayPath=false) | |
getSetEnvPath ($aetrayPath=false) | |
getTmpPath ($aetrayPath=false) | |
setExec ($action) | |
unzipFile ($filePath, $destination, $progressCallback=null) | |
Data Fields | |
const | APP_VERSION = 'version.dat' |
const | EXEC = 'exec.dat' |
const | HOSTSEDITOR_EXE = 'hEdit_x64.exe' |
const | HOSTSEDITOR_VERSION = '1.3' |
const | isRoot_FILE = 'root.php' |
const | LAST_PATH = 'lastPath.dat' |
const | LN_EXE = 'ln.exe' |
const | LN_VERSION = '2.928' |
const | LOADING_PID = 'loading.pid' |
const | NSSM_EXE = 'nssm.exe' |
const | NSSM_VERSION = '2.24' |
const | OPENSSL_CONF = 'openssl.cfg' |
const | OPENSSL_EXE = 'openssl.exe' |
const | OPENSSL_VERSION = '1.1.0c' |
const | PATH_LIN_PLACEHOLDER = '~BEARSAMPP_LIN_PATH~' |
const | PATH_WIN_PLACEHOLDER = '~BEARSAMPP_WIN_PATH~' |
const | PHP_CONF = 'php.ini' |
const | PHP_EXE = 'php-win.exe' |
const | PHP_VERSION = '5.4.23' |
const | PWGEN_EXE = "PWGenPortable.exe" |
const | PWGEN_VERSION = '3.5.4' |
const | SCRIPT_EXEC_SILENT = 'execSilent.vbs' |
const | SETENV_EXE = 'SetEnv.exe' |
const | SETENV_VERSION = '1.09' |
Class Core
This class provides core functionalities and constants for the Bearsampp application. It includes methods for retrieving paths, managing application versions, and handling various executable files and configurations.
Definition at line 17 of file class.core.php.
Core::__construct | ( | ) |
Core constructor.
Loads the WinBinder extension if available.
Definition at line 59 of file class.core.php.
References getLibsPath().
Core::__toString | ( | ) |
Provides a string representation of the core object.
Definition at line 456 of file class.core.php.
Core::addLoadingPid | ( | $pid | ) |
Adds a PID to the loading PID file.
int | $pid | The PID to add. |
Definition at line 266 of file class.core.php.
References getLoadingPid().
Core::getAjaxPath | ( | $aetrayPath = false | ) |
Core::getAppVersion | ( | ) |
Retrieves the application version.
Definition at line 191 of file class.core.php.
References $bearsamppLang, APP_TITLE, APP_VERSION, Lang\ERROR_CONF_NOT_FOUND, getResourcesPath(), and Util\logError().
Core::getExec | ( | $aetrayPath = false | ) |
Retrieves the path to the exec file.
bool | $aetrayPath | Whether to format the path for AeTrayMenu. |
Definition at line 234 of file class.core.php.
References EXEC, and getTmpPath().
Referenced by setExec().
Core::getFileFromUrl | ( | string | $moduleUrl, |
string | $filePath, | ||
$progressBar = false ) |
Fetches a file from a given URL and saves it to a specified file path.
This method attempts to retrieve the content from the provided URL and save it to the specified file path. If any error occurs during fetching or saving, it logs the error and returns an error message. If the operation is successful, it returns the file path. The method also logs the file size if the input stream is a valid resource.
string | $moduleUrl | The URL from which to fetch the file content. |
string | $filePath | The path where the file content should be saved. |
bool | $progressBar | Optional. Whether to display a progress bar during the download process. Default is false. |
Definition at line 565 of file class.core.php.
References Util\logError().
Core::getHomepagePath | ( | $aetrayPath = false | ) |
Definition at line 136 of file class.core.php.
References getResourcesPath().
Referenced by getAjaxPath().
Core::getHostsEditorExe | ( | $aetrayPath = false | ) |
Retrieves the path to the HostsEditor executable.
bool | $aetrayPath | Whether to format the path for AeTrayMenu. |
Definition at line 398 of file class.core.php.
References getHostsEditorPath(), and HOSTSEDITOR_EXE.
Core::getHostsEditorPath | ( | $aetrayPath = false | ) |
Retrieves the path to the HostsEditor directory.
bool | $aetrayPath | Whether to format the path for AeTrayMenu. |
Definition at line 386 of file class.core.php.
References getLibsPath().
Referenced by getHostsEditorExe().
Core::getIconsPath | ( | $aetrayPath = false | ) |
Retrieves the path to the icons.
bool | $aetrayPath | Whether to format the path for AeTrayMenu. |
Definition at line 115 of file class.core.php.
References $bearsamppCore.
Core::getisRootFilePath | ( | $aetrayPath = false | ) |
Retrieves the path to the root file.
bool | $aetrayPath | Whether to format the path for AeTrayMenu. |
Definition at line 179 of file class.core.php.
References $bearsamppRoot, and isRoot_FILE.
Core::getLangsPath | ( | $aetrayPath = false | ) |
Retrieves the path to the language files.
bool | $aetrayPath | Whether to format the path for AeTrayMenu. |
Definition at line 73 of file class.core.php.
References $bearsamppRoot.
Core::getLastPath | ( | $aetrayPath = false | ) |
Retrieves the path to the last path file.
bool | $aetrayPath | Whether to format the path for AeTrayMenu. |
Definition at line 212 of file class.core.php.
References getResourcesPath(), and LAST_PATH.
Referenced by getLastPathContent().
Core::getLastPathContent | ( | ) |
Retrieves the content of the last path file.
Definition at line 222 of file class.core.php.
References getLastPath().
Core::getLibsPath | ( | $aetrayPath = false | ) |
Retrieves the path to the libraries.
bool | $aetrayPath | Whether to format the path for AeTrayMenu. |
Definition at line 87 of file class.core.php.
References $bearsamppRoot.
Referenced by __construct(), getHostsEditorPath(), getLnPath(), getNssmPath(), getOpenSslPath(), getPhpPath(), getPwgenPath(), getSetEnvPath(), and unzipFile().
Core::getLnExe | ( | $aetrayPath = false | ) |
Retrieves the path to the LN executable.
bool | $aetrayPath | Whether to format the path for AeTrayMenu. |
Definition at line 422 of file class.core.php.
References getLnPath(), and LN_EXE.
Core::getLnPath | ( | $aetrayPath = false | ) |
Retrieves the path to the LN directory.
bool | $aetrayPath | Whether to format the path for AeTrayMenu. |
Definition at line 410 of file class.core.php.
References getLibsPath().
Referenced by getLnExe().
Core::getLoadingPid | ( | $aetrayPath = false | ) |
Retrieves the path to the loading PID file.
bool | $aetrayPath | Whether to format the path for AeTrayMenu. |
Definition at line 256 of file class.core.php.
References getResourcesPath(), and LOADING_PID.
Referenced by addLoadingPid().
Core::getNssmExe | ( | $aetrayPath = false | ) |
Retrieves the path to the NSSM executable.
bool | $aetrayPath | Whether to format the path for AeTrayMenu. |
Definition at line 338 of file class.core.php.
References getNssmPath(), and NSSM_EXE.
Core::getNssmPath | ( | $aetrayPath = false | ) |
Retrieves the path to the NSSM directory.
bool | $aetrayPath | Whether to format the path for AeTrayMenu. |
Definition at line 326 of file class.core.php.
References getLibsPath().
Referenced by getNssmExe().
Core::getOpenSslConf | ( | $aetrayPath = false | ) |
Retrieves the path to the OpenSSL configuration file.
bool | $aetrayPath | Whether to format the path for AeTrayMenu. |
Definition at line 374 of file class.core.php.
References getOpenSslPath(), and OPENSSL_CONF.
Core::getOpenSslExe | ( | $aetrayPath = false | ) |
Retrieves the path to the OpenSSL executable.
bool | $aetrayPath | Whether to format the path for AeTrayMenu. |
Definition at line 362 of file class.core.php.
References getOpenSslPath(), and OPENSSL_EXE.
Core::getOpenSslPath | ( | $aetrayPath = false | ) |
Retrieves the path to the OpenSSL directory.
bool | $aetrayPath | Whether to format the path for AeTrayMenu. |
Definition at line 350 of file class.core.php.
References getLibsPath().
Referenced by getOpenSslConf(), and getOpenSslExe().
Core::getPhpExe | ( | $aetrayPath = false | ) |
Retrieves the path to the PHP executable.
bool | $aetrayPath | Whether to format the path for AeTrayMenu. |
Definition at line 290 of file class.core.php.
References getPhpPath(), and PHP_EXE.
Core::getPhpPath | ( | $aetrayPath = false | ) |
Retrieves the path to the PHP directory.
bool | $aetrayPath | Whether to format the path for AeTrayMenu. |
Definition at line 278 of file class.core.php.
References getLibsPath().
Referenced by getPhpExe().
Core::getPwgenExe | ( | $aetrayPath = false | ) |
Retrieves the path to the PWGen executable.
bool | $aetrayPath | Whether to format the path for AeTrayMenu. |
Definition at line 446 of file class.core.php.
References getPwgenPath(), and PWGEN_EXE.
Core::getPwgenPath | ( | $aetrayPath = false | ) |
Retrieves the path to the PWGen directory.
bool | $aetrayPath | Whether to format the path for AeTrayMenu. |
Definition at line 434 of file class.core.php.
References getLibsPath().
Referenced by getPwgenExe().
Core::getResourcesPath | ( | $aetrayPath = false | ) |
Retrieves the path to the resources.
bool | $aetrayPath | Whether to format the path for AeTrayMenu. |
Definition at line 101 of file class.core.php.
References $bearsamppRoot.
Referenced by getAppVersion(), getHomepagePath(), getLastPath(), and getLoadingPid().
Core::getScript | ( | $type | ) |
Retrieves the path to a specific script.
string | $type | The type of script. |
Definition at line 153 of file class.core.php.
References getScriptsPath().
Core::getScriptsPath | ( | $aetrayPath = false | ) |
Retrieves the path to the scripts.
bool | $aetrayPath | Whether to format the path for AeTrayMenu. |
Definition at line 129 of file class.core.php.
References $bearsamppRoot.
Referenced by getScript().
Core::getSetEnvExe | ( | $aetrayPath = false | ) |
Retrieves the path to the SetEnv executable.
bool | $aetrayPath | Whether to format the path for AeTrayMenu. |
Definition at line 314 of file class.core.php.
References getSetEnvPath(), and SETENV_EXE.
Core::getSetEnvPath | ( | $aetrayPath = false | ) |
Retrieves the path to the SetEnv directory.
bool | $aetrayPath | Whether to format the path for AeTrayMenu. |
Definition at line 302 of file class.core.php.
References getLibsPath().
Referenced by getSetEnvExe().
Core::getTmpPath | ( | $aetrayPath = false | ) |
Retrieves the path to the temporary directory.
bool | $aetrayPath | Whether to format the path for AeTrayMenu. |
Definition at line 165 of file class.core.php.
References $bearsamppRoot.
Referenced by getExec().
Core::setExec | ( | $action | ) |
Sets the content of the exec file.
string | $action | The content to set in the exec file. |
Definition at line 244 of file class.core.php.
References getExec().
Core::unzipFile | ( | $filePath, | |
$destination, | |||
$progressCallback = null ) |
Unzips a file to the specified directory and provides progress updates.
This method uses the 7-Zip command-line tool to extract the contents of a zip file. It first tests the archive to determine the number of files to be extracted, then proceeds with the extraction while providing progress updates via a callback function.
string | $filePath | The path to the zip file. |
string | $destination | The directory to extract the files to. |
callable | null | $progressCallback | A callback function to report progress. The callback receives two parameters:
|
Definition at line 478 of file class.core.php.
References $bearsamppRoot, getLibsPath(), Util\logDebug(), Util\logError(), and Util\logTrace().
const Core::APP_VERSION = 'version.dat' |
Definition at line 47 of file class.core.php.
Referenced by getAppVersion().
const Core::EXEC = 'exec.dat' |
Definition at line 49 of file class.core.php.
Referenced by getExec().
const Core::HOSTSEDITOR_EXE = 'hEdit_x64.exe' |
Definition at line 39 of file class.core.php.
Referenced by getHostsEditorExe().
const Core::HOSTSEDITOR_VERSION = '1.3' |
Definition at line 38 of file class.core.php.
const Core::isRoot_FILE = 'root.php' |
Definition at line 20 of file class.core.php.
Referenced by Batch\exitApp(), TplApp\getActionRun(), getisRootFilePath(), and Util\startLoading().
const Core::LAST_PATH = 'lastPath.dat' |
Definition at line 48 of file class.core.php.
Referenced by getLastPath().
const Core::LN_EXE = 'ln.exe' |
Definition at line 42 of file class.core.php.
Referenced by getLnExe().
const Core::LN_VERSION = '2.928' |
Definition at line 41 of file class.core.php.
const Core::LOADING_PID = 'loading.pid' |
Definition at line 50 of file class.core.php.
Referenced by getLoadingPid().
const Core::NSSM_EXE = 'nssm.exe' |
Definition at line 32 of file class.core.php.
Referenced by getNssmExe().
const Core::NSSM_VERSION = '2.24' |
Definition at line 31 of file class.core.php.
const Core::OPENSSL_CONF = 'openssl.cfg' |
Definition at line 36 of file class.core.php.
Referenced by getOpenSslConf().
const Core::OPENSSL_EXE = 'openssl.exe' |
Definition at line 35 of file class.core.php.
Referenced by getOpenSslExe().
const Core::OPENSSL_VERSION = '1.1.0c' |
Definition at line 34 of file class.core.php.
const Core::PATH_LIN_PLACEHOLDER = '~BEARSAMPP_LIN_PATH~' |
Definition at line 22 of file class.core.php.
Referenced by Util\changePath().
const Core::PATH_WIN_PLACEHOLDER = '~BEARSAMPP_WIN_PATH~' |
Definition at line 21 of file class.core.php.
Referenced by Util\changePath().
const Core::PHP_CONF = 'php.ini' |
Definition at line 26 of file class.core.php.
const Core::PHP_EXE = 'php-win.exe' |
Definition at line 25 of file class.core.php.
Referenced by getPhpExe().
const Core::PHP_VERSION = '5.4.23' |
Definition at line 24 of file class.core.php.
const Core::PWGEN_EXE = "PWGenPortable.exe" |
Definition at line 45 of file class.core.php.
Referenced by getPwgenExe().
const Core::PWGEN_VERSION = '3.5.4' |
Definition at line 44 of file class.core.php.
const Core::SCRIPT_EXEC_SILENT = 'execSilent.vbs' |
Definition at line 52 of file class.core.php.
Referenced by WinBinder\exec().
const Core::SETENV_EXE = 'SetEnv.exe' |
Definition at line 29 of file class.core.php.
Referenced by getSetEnvExe().
const Core::SETENV_VERSION = '1.09' |
Definition at line 28 of file class.core.php.