![]() |
Bearsampp 2026.9.23
|
Public Member Functions | |
| __construct ($id, $type) | |
| changePort ($port, $checkUsed=false, $wbProgressBar=null) | |
| checkPort ($port, $showWindow=false) | |
| getExe () | |
| getLog () | |
| getPort () | |
| getService () | |
| getUiPort () | |
| rebuildConf () | |
| reload ($id=null, $type=null) | |
| setEnable ($enabled, $showWindow=false) | |
| setPort ($port) | |
| setSslPort ($SslPort) | |
| setVersion ($version) | |
| switchVersion ($version, $showWindow=false) | |
| Public Member Functions inherited from Module | |
| __toString () | |
| getId () | |
| getName () | |
| getRelease () | |
| getType () | |
| getVersion () | |
| getVersionList () | |
| isEnable () | |
| update ($sub=0, $showWindow=false) | |
Data Fields | |
| const | LOCAL_CFG_EXE = 'xlightExe' |
| const | LOCAL_CFG_PORT = 'xlightPort' |
| const | LOCAL_CFG_SSL_PORT = 'xlightSslPort' |
| const | ROOT_CFG_ENABLE = 'xlightEnable' |
| const | ROOT_CFG_VERSION = 'xlightVersion' |
| const | SERVICE_NAME = 'bearsamppxlight' |
| const | SERVICE_PARAMS = ' -startall' |
| Data Fields inherited from Module | |
| $currentPath | |
| $rootPath | |
| $symlinkPath | |
Protected Member Functions | |
| replaceAll ($params) | |
| updateConfig ($version=null, $sub=0, $showWindow=false) | |
| Protected Member Functions inherited from Module | |
| __construct () | |
| replace ($key, $value) | |
Private Attributes | |
| $exe | |
| $log | |
| $port | |
| $service | |
| $SslPort | |
Additional Inherited Members | |
| Static Public Member Functions inherited from Module | |
| static | clearMemoryCache () |
| static | invalidateConfigCacheForPath ($sourcePath) |
| Protected Attributes inherited from Module | |
| $bearsamppConf | |
| $bearsamppConfRaw | |
| $enable | |
| $name | |
| $release = 'N/A' | |
| $version | |
Class BinXlight
This class represents the Xlight FTP server module in the Bearsampp application. It handles the configuration, initialization, and management of the Xlight FTP server.
Definition at line 17 of file class.bin.xlight.php.
| __construct | ( | $id, | |
| $type ) |
Constructs a BinXlight object and initializes the module.
| string | $id | The ID of the module. |
| string | $type | The type of the module. |
Definition at line 78 of file class.bin.xlight.php.
References Module\$id, Module\$type, Log\initClass(), and reload().
| changePort | ( | $port, | |
| $checkUsed = false, | |||
| $wbProgressBar = null ) |
Changes the port used by the Xlight FTP server.
| int | $port | The new port number. |
| bool | $checkUsed | Whether to check if the port is already in use. |
| mixed | null | $wbProgressBar | The progress bar object for UI updates (optional). |
Definition at line 218 of file class.bin.xlight.php.
References $port, Log\debug(), Log\error(), Module\getName(), ServiceHelper\isPortInUse(), Util\isValidPort(), setPort(), and Module\update().
| checkPort | ( | $port, | |
| $showWindow = false ) |
Checks if a port is used by the Xlight FTP server.
| int | $port | The port number to check. |
| bool | $showWindow | Whether to show a message box with the result. |
Definition at line 257 of file class.bin.xlight.php.
References $bearsamppLang, $port, APP_LOCALHOST, Lang\CHECK_PORT_TITLE, UtilString\contains(), Log\debug(), Log\error(), HttpClient\getHeaders(), Module\getName(), Util\isValidPort(), Lang\PORT_NOT_USED, Lang\PORT_NOT_USED_BY, and Lang\PORT_USED_BY.
| getExe | ( | ) |
Gets the executable file path for the Xlight FTP server.
Definition at line 441 of file class.bin.xlight.php.
References $exe.
| getLog | ( | ) |
Gets the log file path for the Xlight FTP server.
Definition at line 431 of file class.bin.xlight.php.
References $log.
| getPort | ( | ) |
Gets the port used by the Xlight FTP server.
Definition at line 471 of file class.bin.xlight.php.
References $port.
| getService | ( | ) |
Gets the service object for the Xlight FTP server.
Definition at line 388 of file class.bin.xlight.php.
References $service.
| getUiPort | ( | ) |
Gets the SSL port used by the Xlight FTP server.
Definition at line 451 of file class.bin.xlight.php.
References $SslPort.
| rebuildConf | ( | ) |
Rebuilds the configuration in the Windows Registry.
Definition at line 188 of file class.bin.xlight.php.
References Registry\HKEY_LOCAL_MACHINE, and Nssm\INFO_APP_PARAMETERS.
| 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 90 of file class.bin.xlight.php.
References $bearsamppConfig, $bearsamppLang, $bearsamppRoot, Module\$id, Module\$type, APP_TITLE, Log\error(), Lang\ERROR_CONF_NOT_FOUND, Lang\ERROR_EXE_NOT_FOUND, Lang\ERROR_FILE_NOT_FOUND, Lang\ERROR_INVALID_PARAMETER, Path\getLogsPath(), Module\getName(), Log\info(), Log\reloadClass(), Nssm\SERVICE_DEMAND_START, and Lang\XLIGHT.
Referenced by __construct(), setEnable(), and setVersion().
|
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 161 of file class.bin.xlight.php.
References Module\invalidateConfigCacheForPath().
| setEnable | ( | $enabled, | |
| $showWindow = false ) |
Enables or disables the Xlight FTP server.
| bool | $enabled | Whether to enable or disable the server. |
| bool | $showWindow | Whether to show a message box with the result. |
Definition at line 399 of file class.bin.xlight.php.
References $bearsamppConfig, $bearsamppLang, Log\debug(), Config\DISABLED, Lang\ENABLE_BUNDLE_NOT_EXIST, Lang\ENABLE_TITLE, Config\ENABLED, Module\getName(), Module\getVersion(), Log\info(), ServiceHelper\installService(), reload(), and ServiceHelper\removeService().
| setPort | ( | $port | ) |
Sets the port for the Xlight FTP server.
| int | $port | The port number. |
Definition at line 481 of file class.bin.xlight.php.
References $port, and Module\replace().
Referenced by changePort().
| setSslPort | ( | $SslPort | ) |
Sets the SSL port for the Xlight FTP server.
| int | $SslPort | The SSL port number. |
Definition at line 461 of file class.bin.xlight.php.
References $SslPort, and Module\replace().
| setVersion | ( | $version | ) |
Sets the version of the Xlight FTP server.
| string | $version | The version to set. |
Reimplemented from Module.
Definition at line 375 of file class.bin.xlight.php.
References $bearsamppConfig, Module\$version, and reload().
Referenced by updateConfig().
| switchVersion | ( | $version, | |
| $showWindow = false ) |
Switches the version of the Xlight FTP server.
| string | $version | The version to switch to. |
| bool | $showWindow | Whether to show a message box with the result. |
Definition at line 309 of file class.bin.xlight.php.
References Module\$version, Log\debug(), and updateConfig().
|
protected |
Updates the configuration of the Xlight FTP server.
| 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 message box with the result. |
Reimplemented from Module.
Definition at line 325 of file class.bin.xlight.php.
References Module\$bearsamppConf, Module\$bearsamppConfRaw, $bearsamppLang, Module\$version, Lang\BEARSAMPP_CONF_MALFORMED_ERROR, Lang\BEARSAMPP_CONF_NOT_FOUND_ERROR, Log\debug(), Log\error(), Module\getName(), Module\getVersion(), setVersion(), and Lang\SWITCH_VERSION_TITLE.
Referenced by switchVersion().
|
private |
Definition at line 62 of file class.bin.xlight.php.
Referenced by getExe().
|
private |
Definition at line 57 of file class.bin.xlight.php.
Referenced by getLog().
|
private |
Definition at line 66 of file class.bin.xlight.php.
Referenced by changePort(), checkPort(), getPort(), and setPort().
|
private |
Definition at line 53 of file class.bin.xlight.php.
Referenced by getService().
|
private |
Definition at line 70 of file class.bin.xlight.php.
Referenced by getUiPort(), and setSslPort().
| const LOCAL_CFG_EXE = 'xlightExe' |
Configuration key for the Xlight executable in the local configuration.
Definition at line 40 of file class.bin.xlight.php.
| const LOCAL_CFG_PORT = 'xlightPort' |
Configuration key for the Xlight port in the local configuration.
Definition at line 48 of file class.bin.xlight.php.
| const LOCAL_CFG_SSL_PORT = 'xlightSslPort' |
Configuration key for the Xlight SSL port in the local configuration.
Definition at line 44 of file class.bin.xlight.php.
| const ROOT_CFG_ENABLE = 'xlightEnable' |
Configuration key for the Xlight enable flag in the root configuration.
Definition at line 31 of file class.bin.xlight.php.
| const ROOT_CFG_VERSION = 'xlightVersion' |
Configuration key for the Xlight version in the root configuration.
Definition at line 35 of file class.bin.xlight.php.
| const SERVICE_NAME = 'bearsamppxlight' |
The name of the Windows service.
Definition at line 22 of file class.bin.xlight.php.
Referenced by ActionService\__construct(), ServiceHelper\forceKillService(), TplAppXlight\getActionInstallXlightService(), TplAppXlight\getActionRemoveXlightService(), ServiceHelper\getAllServiceNames(), ActionQuit\getServiceDisplayName(), Bins\getServices(), ActionQuit\getServiceShutdownOrder(), ActionRestartAllServices\getServiceShutdownOrder(), ActionRestartAllServices\getServiceStartupOrder(), ServiceHelper\initializeMappings(), ActionStartup\prepareService(), and Win32Service\start().
| const SERVICE_PARAMS = ' -startall' |
The command line parameters passed to the Xlight service.
Definition at line 26 of file class.bin.xlight.php.