![]() |
2024.8.23
|
Inheritance diagram for BinMariadb:
Collaboration diagram for BinMariadb:Public Member Functions | |
| __construct ($id, $type) | |
| changePort ($port, $checkUsed=false, $wbProgressBar=null) | |
| changeRootPassword ($currentPwd, $newPwd, $wbProgressBar=null) | |
| checkPort ($port, $showWindow=false) | |
| checkRootPassword ($currentPwd=null, $wbProgressBar=null) | |
| getAdmin () | |
| getCliExe () | |
| getCmdLineOutput ($cmd) | |
| getConf () | |
| getErrorLog () | |
| getExe () | |
| getPort () | |
| getRootPwd () | |
| getRootUser () | |
| getService () | |
| reload ($id=null, $type=null) | |
| setEnable ($enabled, $showWindow=false) | |
| setPort ($port) | |
| setRootPwd ($rootPwd) | |
| setRootUser ($rootUser) | |
| setVersion ($version) | |
| switchVersion ($version, $showWindow=false) | |
Public Member Functions inherited from Module | |
| __toString () | |
| getCurrentPath () | |
| getId () | |
| getName () | |
| getRelease () | |
| getRootPath () | |
| getSymlinkPath () | |
| getType () | |
| getVersion () | |
| getVersionList () | |
| isEnable () | |
| update ($sub=0, $showWindow=false) | |
Data Fields | |
| const | CMD_SYNTAX_CHECK = '--help --verbose 1>NUL' |
| const | CMD_VARIABLES = 'variables' |
| const | CMD_VERSION = '--version' |
| const | LOCAL_CFG_ADMIN = 'mariadbAdmin' |
| const | LOCAL_CFG_CLI_EXE = 'mariadbCliExe' |
| const | LOCAL_CFG_CONF = 'mariadbConf' |
| const | LOCAL_CFG_EXE = 'mariadbExe' |
| const | LOCAL_CFG_PORT = 'mariadbPort' |
| const | LOCAL_CFG_ROOT_PWD = 'mariadbRootPwd' |
| const | LOCAL_CFG_ROOT_USER = 'mariadbRootUser' |
| const | ROOT_CFG_ENABLE = 'mariadbEnable' |
| const | ROOT_CFG_VERSION = 'mariadbVersion' |
| const | SERVICE_NAME = 'bearsamppmariadb' |
Data Fields inherited from Module | |
| const | BUNDLE_RELEASE = 'bundleRelease' |
Protected Member Functions | |
| replaceAll ($params) | |
| updateConfig ($version=null, $sub=0, $showWindow=false) | |
Protected Member Functions inherited from Module | |
| __construct () | |
| replace ($key, $value) | |
Private Attributes | |
| $admin | |
| $cliExe | |
| $conf | |
| $errorLog | |
| $exe | |
| $port | |
| $rootPwd | |
| $rootUser | |
| $service | |
Additional Inherited Members | |
Protected Attributes inherited from Module | |
| $bearsamppConf | |
| $bearsamppConfRaw | |
| $currentPath | |
| $enable | |
| $name | |
| $release = 'N/A' | |
| $rootPath | |
| $symlinkPath | |
| $version | |
Class BinMariadb
This class represents the MariaDB module in the Bearsampp application. It handles the configuration, management, and operations related to MariaDB.
Definition at line 16 of file class.bin.mariadb.php.
| BinMariadb::__construct | ( | $id, | |
| $type ) |
Constructs a BinMariadb object and initializes the module.
| string | $id | The ID of the module. |
| string | $type | The type of the module. |
Definition at line 52 of file class.bin.mariadb.php.
References Module\$id, Module\$type, Util\logInitClass(), and reload().
| BinMariadb::changePort | ( | $port, | |
| $checkUsed = false, | |||
| $wbProgressBar = null ) |
Changes the port for MariaDB.
| int | $port | The new port number. |
| bool | $checkUsed | Whether to check if the port is already in use. |
| mixed | $wbProgressBar | The progress bar object for UI updates. |
Definition at line 182 of file class.bin.mariadb.php.
References $port, Module\getName(), Util\isPortInUse(), Util\isValidPort(), Util\logDebug(), Util\logError(), setPort(), and Module\update().
| BinMariadb::changeRootPassword | ( | $currentPwd, | |
| $newPwd, | |||
| $wbProgressBar = null ) |
Changes the root password for MariaDB.
| string | $currentPwd | The current root password. |
| string | $newPwd | The new root password. |
| mixed | $wbProgressBar | The progress bar object for UI updates. |
Definition at line 313 of file class.bin.mariadb.php.
References setRootPwd(), and Module\update().
| BinMariadb::checkPort | ( | $port, | |
| $showWindow = false ) |
Checks if the specified port is used by MariaDB.
| int | $port | The port number to check. |
| bool | $showWindow | Whether to show a window with the result. |
Definition at line 221 of file class.bin.mariadb.php.
References $bearsamppLang, $port, $result, Module\$version, Lang\CHECK_PORT_TITLE, Module\getName(), Util\isValidPort(), Util\logDebug(), Util\logError(), Lang\PORT_NOT_USED, Lang\PORT_NOT_USED_BY, Lang\PORT_USED_BY, Lang\PORT_USED_BY_ANOTHER_DBMS, and Util\startWith().
| BinMariadb::checkRootPassword | ( | $currentPwd = null, | |
| $wbProgressBar = null ) |
Checks if the provided root password is correct.
| string | null | $currentPwd | The current root password. If null, the stored root password is used. |
| mixed | $wbProgressBar | The progress bar object for UI updates. |
Definition at line 383 of file class.bin.mariadb.php.
| BinMariadb::getAdmin | ( | ) |
Retrieves the admin executable path for the module.
Definition at line 680 of file class.bin.mariadb.php.
References $admin.
Referenced by getCmdLineOutput().
Here is the caller graph for this function:| BinMariadb::getCliExe | ( | ) |
Retrieves the CLI executable path for the module.
Definition at line 671 of file class.bin.mariadb.php.
References $cliExe.
| BinMariadb::getCmdLineOutput | ( | $cmd | ) |
Retrieves the command line output for a given command.
| string | $cmd | The command to execute. |
Definition at line 498 of file class.bin.mariadb.php.
References $result, Util\contains(), Batch\exec(), getAdmin(), getExe(), getRootPwd(), and getRootUser().
| BinMariadb::getConf | ( | ) |
Retrieves the configuration file path for the module.
Definition at line 608 of file class.bin.mariadb.php.
References $conf.
Referenced by updateConfig().
Here is the caller graph for this function:| BinMariadb::getErrorLog | ( | ) |
Retrieves the error log path for the module.
Definition at line 590 of file class.bin.mariadb.php.
References $errorLog.
| BinMariadb::getExe | ( | ) |
Retrieves the executable path for the module.
Definition at line 599 of file class.bin.mariadb.php.
References $exe.
Referenced by getCmdLineOutput().
Here is the caller graph for this function:| BinMariadb::getPort | ( | ) |
Retrieves the port number for the module.
Definition at line 617 of file class.bin.mariadb.php.
References $port.
| BinMariadb::getRootPwd | ( | ) |
Retrieves the root password for the module.
Definition at line 653 of file class.bin.mariadb.php.
References $rootPwd.
Referenced by getCmdLineOutput().
Here is the caller graph for this function:| BinMariadb::getRootUser | ( | ) |
Retrieves the root user for the module.
Definition at line 635 of file class.bin.mariadb.php.
References $rootUser.
Referenced by getCmdLineOutput().
Here is the caller graph for this function:| BinMariadb::getService | ( | ) |
Retrieves the service associated with the module.
Definition at line 549 of file class.bin.mariadb.php.
References $service.
| BinMariadb::reload | ( | $id = null, | |
| $type = null ) |
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 from Module.
Definition at line 64 of file class.bin.mariadb.php.
References $bearsamppConfig, $bearsamppLang, $bearsamppRoot, Module\$id, Module\$type, APP_TITLE, Lang\ERROR_CONF_NOT_FOUND, Lang\ERROR_EXE_NOT_FOUND, Lang\ERROR_FILE_NOT_FOUND, Lang\ERROR_INVALID_PARAMETER, Module\getName(), LOCAL_CFG_ADMIN, LOCAL_CFG_CLI_EXE, LOCAL_CFG_CONF, LOCAL_CFG_EXE, LOCAL_CFG_PORT, LOCAL_CFG_ROOT_PWD, LOCAL_CFG_ROOT_USER, Util\logError(), Util\logInfo(), Util\logReloadClass(), Lang\MARIADB, Win32Service\SERVER_ERROR_NORMAL, and Win32Service\SERVICE_DEMAND_START.
Referenced by __construct(), setEnable(), and setVersion().
Here is the caller graph for this function:
|
protected |
Replaces multiple key-value pairs in the configuration file.
| array | $params | An associative array of key-value pairs to replace. |
Reimplemented from Module.
Definition at line 150 of file class.bin.mariadb.php.
References LOCAL_CFG_PORT, LOCAL_CFG_ROOT_PWD, and LOCAL_CFG_ROOT_USER.
| BinMariadb::setEnable | ( | $enabled, | |
| $showWindow = false ) |
Enables or disables the module.
| bool | $enabled | Whether to enable or disable the module. |
| bool | $showWindow | Whether to show a window with the result. |
Definition at line 559 of file class.bin.mariadb.php.
References $bearsamppConfig, $bearsamppLang, Config\DISABLED, Lang\ENABLE_BUNDLE_NOT_EXIST, Lang\ENABLE_TITLE, Config\ENABLED, Module\getName(), Module\getVersion(), Util\installService(), Util\logDebug(), Util\logInfo(), reload(), and Util\removeService().
| BinMariadb::setPort | ( | $port | ) |
Sets the port number for the module.
| int | $port | The port number to set. |
Definition at line 626 of file class.bin.mariadb.php.
References $port, and Module\replace().
Referenced by changePort().
Here is the caller graph for this function:| BinMariadb::setRootPwd | ( | $rootPwd | ) |
Sets the root password for the module.
| string | $rootPwd | The root password to set. |
Definition at line 662 of file class.bin.mariadb.php.
References $rootPwd, and Module\replace().
Referenced by changeRootPassword().
Here is the caller graph for this function:| BinMariadb::setRootUser | ( | $rootUser | ) |
Sets the root user for the module.
| string | $rootUser | The root user to set. |
Definition at line 644 of file class.bin.mariadb.php.
References $rootUser, and Module\replace().
| BinMariadb::setVersion | ( | $version | ) |
Sets the version of the module.
| string | $version | The version to set. |
Reimplemented from Module.
Definition at line 537 of file class.bin.mariadb.php.
References $bearsamppConfig, Module\$version, and reload().
Referenced by updateConfig().
Here is the caller graph for this function:| BinMariadb::switchVersion | ( | $version, | |
| $showWindow = false ) |
Switches the version of MariaDB.
| string | $version | The version to switch to. |
| bool | $showWindow | Whether to show a window with the result. |
Definition at line 420 of file class.bin.mariadb.php.
References Module\$version, Util\logDebug(), and updateConfig().
|
protected |
Updates the configuration for the specified 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 with the result. |
Reimplemented from Module.
Definition at line 436 of file class.bin.mariadb.php.
References Module\$bearsamppConf, Module\$bearsamppConfRaw, $bearsamppLang, $conf, Module\$version, Lang\BEARSAMPP_CONF_MALFORMED_ERROR, Lang\BEARSAMPP_CONF_NOT_FOUND_ERROR, getConf(), Module\getName(), Module\getVersion(), Util\logDebug(), Util\logError(), Util\replaceInFile(), setVersion(), and Lang\SWITCH_VERSION_TITLE.
Referenced by switchVersion().
Here is the caller graph for this function:
|
private |
Definition at line 44 of file class.bin.mariadb.php.
Referenced by getAdmin().
|
private |
Definition at line 43 of file class.bin.mariadb.php.
Referenced by getCliExe().
|
private |
Definition at line 39 of file class.bin.mariadb.php.
Referenced by getConf(), and updateConfig().
|
private |
Definition at line 36 of file class.bin.mariadb.php.
Referenced by getErrorLog().
|
private |
Definition at line 38 of file class.bin.mariadb.php.
Referenced by getExe().
|
private |
Definition at line 40 of file class.bin.mariadb.php.
Referenced by changePort(), checkPort(), getPort(), and setPort().
|
private |
Definition at line 42 of file class.bin.mariadb.php.
Referenced by getRootPwd(), and setRootPwd().
|
private |
Definition at line 41 of file class.bin.mariadb.php.
Referenced by getRootUser(), and setRootUser().
|
private |
Definition at line 35 of file class.bin.mariadb.php.
Referenced by getService().
| const BinMariadb::CMD_SYNTAX_CHECK = '--help --verbose 1>NUL' |
Definition at line 33 of file class.bin.mariadb.php.
Referenced by ActionDebugMariadb\__construct(), ActionService\__construct(), TplAppMariadb\getMenuMariadbDebug(), ActionStartup\installServices(), and Win32Service\start().
| const BinMariadb::CMD_VARIABLES = 'variables' |
Definition at line 32 of file class.bin.mariadb.php.
Referenced by ActionDebugMariadb\__construct(), and TplAppMariadb\getMenuMariadbDebug().
| const BinMariadb::CMD_VERSION = '--version' |
Definition at line 31 of file class.bin.mariadb.php.
Referenced by ActionDebugMariadb\__construct(), and TplAppMariadb\getMenuMariadbDebug().
| const BinMariadb::LOCAL_CFG_ADMIN = 'mariadbAdmin' |
Definition at line 25 of file class.bin.mariadb.php.
Referenced by reload().
| const BinMariadb::LOCAL_CFG_CLI_EXE = 'mariadbCliExe' |
Definition at line 24 of file class.bin.mariadb.php.
Referenced by reload().
| const BinMariadb::LOCAL_CFG_CONF = 'mariadbConf' |
Definition at line 26 of file class.bin.mariadb.php.
Referenced by reload().
| const BinMariadb::LOCAL_CFG_EXE = 'mariadbExe' |
Definition at line 23 of file class.bin.mariadb.php.
Referenced by reload().
| const BinMariadb::LOCAL_CFG_PORT = 'mariadbPort' |
Definition at line 27 of file class.bin.mariadb.php.
Referenced by reload(), and replaceAll().
| const BinMariadb::LOCAL_CFG_ROOT_PWD = 'mariadbRootPwd' |
Definition at line 29 of file class.bin.mariadb.php.
Referenced by reload(), and replaceAll().
| const BinMariadb::LOCAL_CFG_ROOT_USER = 'mariadbRootUser' |
Definition at line 28 of file class.bin.mariadb.php.
Referenced by reload(), and replaceAll().
| const BinMariadb::ROOT_CFG_ENABLE = 'mariadbEnable' |
Definition at line 20 of file class.bin.mariadb.php.
| const BinMariadb::ROOT_CFG_VERSION = 'mariadbVersion' |
Definition at line 21 of file class.bin.mariadb.php.
| const BinMariadb::SERVICE_NAME = 'bearsamppmariadb' |
Definition at line 18 of file class.bin.mariadb.php.
Referenced by ActionService\__construct(), TplAppMariadb\getActionInstallMariadbService(), TplAppMariadb\getActionRemoveMariadbService(), Bins\getServices(), ActionStartup\installServices(), ActionQuit\processWindow(), and Win32Service\start().