![]() |
Bearsampp 2026.9.23
|
Public Member Functions | |
| __toString () | |
| getId () | |
| getName () | |
| getRelease () | |
| getType () | |
| getVersion () | |
| getVersionList () | |
| isEnable () | |
| setVersion ($version) | |
| update ($sub=0, $showWindow=false) | |
Static Public Member Functions | |
| static | clearMemoryCache () |
| static | invalidateConfigCacheForPath ($sourcePath) |
Data Fields | |
| $currentPath | |
| $rootPath | |
| $symlinkPath | |
Protected Member Functions | |
| __construct () | |
| reload ($id=null, $type=null) | |
| replace ($key, $value) | |
| replaceAll ($params) | |
| updateConfig ($version=null, $sub=0, $showWindow=false) | |
Protected Attributes | |
| $bearsamppConf | |
| $bearsamppConfRaw | |
| $enable | |
| $name | |
| $release = 'N/A' | |
| $version | |
Private Attributes | |
| $id | |
| $type | |
Static Private Attributes | |
| static | $configCache = array() |
Abstract class representing a module in the Bearsampp application. This class provides common functionalities for managing modules such as apps, bins, and tools.
Definition at line 14 of file class.module.php.
|
protected |
Constructor for the Module class. Initializes the module with default values.
Definition at line 56 of file class.module.php.
| __toString | ( | ) |
Returns the name of the module.
Definition at line 215 of file class.module.php.
References getName().
|
static |
Clears all in-memory configuration caches.
Definition at line 181 of file class.module.php.
Referenced by CacheManager\clearAll().
| getId | ( | ) |
Gets the ID of the module.
Definition at line 235 of file class.module.php.
References $id.
| getName | ( | ) |
Gets the name of the module.
Definition at line 245 of file class.module.php.
References $name.
Referenced by __toString(), BinApache\changePort(), BinMailpit\changePort(), BinMariadb\changePort(), BinMemcached\changePort(), BinMysql\changePort(), BinPostgresql\changePort(), BinXlight\changePort(), BinApache\checkPort(), BinMailpit\checkPort(), BinMariadb\checkPort(), BinMemcached\checkPort(), BinMysql\checkPort(), BinPostgresql\checkPort(), BinXlight\checkPort(), BinPostgresql\handleNonPostgresUsage(), BinApache\reload(), BinMailpit\reload(), BinMariadb\reload(), BinMemcached\reload(), BinMysql\reload(), BinPostgresql\reload(), BinXlight\reload(), BinApache\setEnable(), BinMailpit\setEnable(), BinMariadb\setEnable(), BinMemcached\setEnable(), BinMysql\setEnable(), BinNodejs\setEnable(), BinPhp\setEnable(), BinPostgresql\setEnable(), BinXlight\setEnable(), AppPhpmyadmin\updateConfig(), AppPhppgadmin\updateConfig(), BinApache\updateConfig(), BinMailpit\updateConfig(), BinMariadb\updateConfig(), BinMemcached\updateConfig(), BinMysql\updateConfig(), BinNodejs\updateConfig(), BinPhp\updateConfig(), BinPostgresql\updateConfig(), and BinXlight\updateConfig().
| getRelease | ( | ) |
Gets the release information of the module.
Definition at line 282 of file class.module.php.
References $release.
| getType | ( | ) |
Gets the type of the module.
Definition at line 225 of file class.module.php.
References $type.
| getVersion | ( | ) |
Gets the version of the module.
Definition at line 255 of file class.module.php.
References $version.
Referenced by BinPhp\getApacheModule(), BinApache\getOfflineContent(), BinApache\getOnlineContent(), BinPhp\getTsDll(), BinMariadb\initData(), BinMysql\initData(), BinApache\setEnable(), BinMailpit\setEnable(), BinMariadb\setEnable(), BinMemcached\setEnable(), BinMysql\setEnable(), BinNodejs\setEnable(), BinPhp\setEnable(), BinPostgresql\setEnable(), BinXlight\setEnable(), BinApache\updateConfig(), BinMailpit\updateConfig(), BinMariadb\updateConfig(), BinMemcached\updateConfig(), BinMysql\updateConfig(), BinNodejs\updateConfig(), BinPhp\updateConfig(), BinPostgresql\updateConfig(), and BinXlight\updateConfig().
| getVersionList | ( | ) |
Gets the list of available versions for the module.
Definition at line 265 of file class.module.php.
References Util\getVersionList().
Referenced by BinPhp\getApacheModule().
|
static |
Invalidates the configuration cache for a given source path. Clears both in-memory cache and disk cache via CacheManager.
| string | $sourcePath | The path to the configuration file to invalidate cache for. |
Definition at line 171 of file class.module.php.
References CacheManager\invalidate().
Referenced by BinApache\replaceAll(), BinMailpit\replaceAll(), BinMariadb\replaceAll(), BinMemcached\replaceAll(), BinMysql\replaceAll(), BinPostgresql\replaceAll(), BinXlight\replaceAll(), replaceAll(), and BinMysql\updateConfig().
| isEnable | ( | ) |
Checks if the module is enabled.
Definition at line 293 of file class.module.php.
References $enable.
|
protected |
Reloads the module configuration based on the provided ID and type.
| string | null | $id | The ID of the module. If null, the current ID is used. |
| string | null | $type | The type of the module. If null, the current type is used. |
Reimplemented in AppPhpmyadmin, AppPhppgadmin, BinApache, BinMailpit, BinMariadb, BinMemcached, BinMysql, BinNodejs, BinPhp, BinPostgresql, BinXlight, ToolBruno, ToolComposer, ToolGhostscript, ToolGit, ToolNgrok, ToolPerl, ToolPowerShell, ToolPython, and ToolRuby.
Definition at line 67 of file class.module.php.
References $bearsamppConfRaw, $bearsamppRoot, $id, $type, $version, Symlinks\createModuleSymlink(), Path\getAppsPath(), Path\getBinPath(), Path\getToolsPath(), Symlinks\isSkippingSymlinkCreation(), CacheManager\load(), Apps\TYPE, Bins\TYPE, and Tools\TYPE.
|
protected |
Replaces a specific key-value pair in the configuration file.
| string | $key | The key to replace. |
| string | $value | The new value for the key. |
Definition at line 127 of file class.module.php.
References replaceAll().
Referenced by BinMailpit\setListen(), BinMemcached\setMemory(), BinApache\setPort(), BinMariadb\setPort(), BinMemcached\setPort(), BinMysql\setPort(), BinPostgresql\setPort(), BinXlight\setPort(), BinMariadb\setRootPwd(), BinMysql\setRootPwd(), BinPostgresql\setRootPwd(), BinMariadb\setRootUser(), BinMysql\setRootUser(), BinPostgresql\setRootUser(), BinMailpit\setSmtpPort(), BinApache\setSslPort(), BinXlight\setSslPort(), BinMailpit\setUiPort(), and BinMailpit\setWebRoot().
|
protected |
Replaces multiple key-value pairs in the configuration file.
| array | $params | An associative array of key-value pairs to replace. |
| RuntimeException | If the configuration key or value is invalid. |
Reimplemented in BinApache, BinMailpit, BinMariadb, BinMemcached, BinMysql, BinPostgresql, and BinXlight.
Definition at line 139 of file class.module.php.
References invalidateConfigCacheForPath().
Referenced by replace().
|
abstract |
Sets the version of the module.
| string | $version | The version to set. |
Reimplemented in AppPhpmyadmin, AppPhppgadmin, BinApache, BinMailpit, BinMariadb, BinMemcached, BinMysql, BinNodejs, BinPhp, BinPostgresql, BinXlight, ToolBruno, ToolComposer, ToolGhostscript, ToolGit, ToolNgrok, ToolPerl, ToolPowerShell, ToolPython, and ToolRuby.
References $version.
| update | ( | $sub = 0, | |
| $showWindow = false ) |
Updates the module configuration.
| int | $sub | The sub-level for logging indentation. |
| bool | $showWindow | Whether to show a window during the update process. |
Definition at line 192 of file class.module.php.
References updateConfig().
Referenced by BinApache\changePort(), BinMailpit\changePort(), BinMariadb\changePort(), BinMemcached\changePort(), BinMysql\changePort(), BinPostgresql\changePort(), BinXlight\changePort(), BinMariadb\changeRootPassword(), BinMysql\changeRootPassword(), and BinPostgresql\changeRootPassword().
|
protected |
Updates the module configuration with a specific version.
| string | null | $version | The version to update to. If null, the current version is used. |
| int | $sub | The sub-level for logging indentation. |
| bool | $showWindow | Whether to show a window during the update process. |
Reimplemented in AppPhpmyadmin, AppPhppgadmin, BinApache, BinMailpit, BinMariadb, BinMemcached, BinMysql, BinNodejs, BinPhp, BinPostgresql, BinXlight, and ToolGit.
Definition at line 204 of file class.module.php.
References $version, and Log\debug().
Referenced by update().
|
protected |
Definition at line 47 of file class.module.php.
Referenced by BinPhp\getApacheModule(), BinApache\updateConfig(), BinMailpit\updateConfig(), BinMariadb\updateConfig(), BinMemcached\updateConfig(), BinMysql\updateConfig(), BinNodejs\updateConfig(), BinPhp\updateConfig(), BinPostgresql\updateConfig(), and BinXlight\updateConfig().
|
protected |
Definition at line 50 of file class.module.php.
Referenced by reload(), BinApache\updateConfig(), BinMailpit\updateConfig(), BinMariadb\updateConfig(), BinMemcached\updateConfig(), BinMysql\updateConfig(), BinNodejs\updateConfig(), BinPhp\updateConfig(), BinPostgresql\updateConfig(), and BinXlight\updateConfig().
|
staticprivate |
Definition at line 17 of file class.module.php.
| $currentPath |
Definition at line 38 of file class.module.php.
Referenced by BinPhp\getApacheModule(), BinPhp\getTsDll(), BinMysql\updateConfig(), and BinPostgresql\updateConfig().
|
protected |
Definition at line 44 of file class.module.php.
Referenced by isEnable().
|
private |
Definition at line 23 of file class.module.php.
Referenced by AppPhpmyadmin\__construct(), AppPhppgadmin\__construct(), BinApache\__construct(), BinMailpit\__construct(), BinMariadb\__construct(), BinMemcached\__construct(), BinMysql\__construct(), BinNodejs\__construct(), BinPhp\__construct(), BinPostgresql\__construct(), BinXlight\__construct(), ToolBruno\__construct(), ToolComposer\__construct(), ToolGhostscript\__construct(), ToolGit\__construct(), ToolNgrok\__construct(), ToolPerl\__construct(), ToolPowerShell\__construct(), ToolPython\__construct(), ToolRuby\__construct(), getId(), AppPhpmyadmin\reload(), AppPhppgadmin\reload(), BinApache\reload(), BinMailpit\reload(), BinMariadb\reload(), BinMemcached\reload(), BinMysql\reload(), BinNodejs\reload(), BinPhp\reload(), BinPostgresql\reload(), BinXlight\reload(), reload(), ToolBruno\reload(), ToolComposer\reload(), ToolGhostscript\reload(), ToolGit\reload(), ToolNgrok\reload(), ToolPerl\reload(), ToolPowerShell\reload(), ToolPython\reload(), and ToolRuby\reload().
|
protected |
Definition at line 26 of file class.module.php.
Referenced by BinApache\getAliasContent(), BinPhp\getExtensionsFromConf(), BinPhp\getExtensionsFromFolder(), BinPhp\getExtensionsLoaded(), BinApache\getModulesFromConf(), BinApache\getModulesFromFolder(), BinApache\getModulesLoaded(), getName(), BinPhp\isSettingActive(), and BinPhp\isSettingExists().
|
protected |
Definition at line 32 of file class.module.php.
Referenced by getRelease().
| $rootPath |
Definition at line 35 of file class.module.php.
| $symlinkPath |
Definition at line 41 of file class.module.php.
|
private |
Definition at line 20 of file class.module.php.
Referenced by AppPhpmyadmin\__construct(), AppPhppgadmin\__construct(), BinApache\__construct(), BinMailpit\__construct(), BinMariadb\__construct(), BinMemcached\__construct(), BinMysql\__construct(), BinNodejs\__construct(), BinPhp\__construct(), BinPostgresql\__construct(), BinXlight\__construct(), ToolBruno\__construct(), ToolComposer\__construct(), ToolGhostscript\__construct(), ToolGit\__construct(), ToolNgrok\__construct(), ToolPerl\__construct(), ToolPowerShell\__construct(), ToolPython\__construct(), ToolRuby\__construct(), getType(), AppPhpmyadmin\reload(), AppPhppgadmin\reload(), BinApache\reload(), BinMailpit\reload(), BinMariadb\reload(), BinMemcached\reload(), BinMysql\reload(), BinNodejs\reload(), BinPhp\reload(), BinPostgresql\reload(), BinXlight\reload(), reload(), ToolBruno\reload(), ToolComposer\reload(), ToolGhostscript\reload(), ToolGit\reload(), ToolNgrok\reload(), ToolPerl\reload(), ToolPowerShell\reload(), ToolPython\reload(), and ToolRuby\reload().
|
protected |
Definition at line 29 of file class.module.php.
Referenced by BinMysql\changeRootPassword(), BinMariadb\checkPort(), BinMemcached\checkPort(), BinMysql\checkPort(), BinApache\getOfflineContent(), BinApache\getOnlineContent(), BinApache\getRequiredContent(), getVersion(), BinMariadb\initData(), BinMysql\initData(), reload(), BinApache\setVersion(), BinMailpit\setVersion(), BinMariadb\setVersion(), BinMemcached\setVersion(), BinMysql\setVersion(), BinNodejs\setVersion(), BinPhp\setVersion(), BinPostgresql\setVersion(), BinXlight\setVersion(), setVersion(), ToolBruno\setVersion(), ToolComposer\setVersion(), ToolGhostscript\setVersion(), ToolGit\setVersion(), ToolNgrok\setVersion(), ToolPerl\setVersion(), ToolPowerShell\setVersion(), ToolPython\setVersion(), ToolRuby\setVersion(), BinApache\switchVersion(), BinMailpit\switchVersion(), BinMariadb\switchVersion(), BinMemcached\switchVersion(), BinMysql\switchVersion(), BinNodejs\switchVersion(), BinPhp\switchVersion(), BinPostgresql\switchVersion(), BinXlight\switchVersion(), AppPhpmyadmin\updateConfig(), AppPhppgadmin\updateConfig(), BinApache\updateConfig(), BinMailpit\updateConfig(), BinMariadb\updateConfig(), BinMemcached\updateConfig(), BinMysql\updateConfig(), BinNodejs\updateConfig(), BinPhp\updateConfig(), BinPostgresql\updateConfig(), BinXlight\updateConfig(), updateConfig(), and ToolGit\updateConfig().