![]() |
Bearsampp 2026.9.23
|
Public Member Functions | |
| __construct ($id, $type) | |
| getConf () | |
| getExe () | |
| getLaunch () | |
| getNpm () | |
| getVars () | |
| reload ($id=null, $type=null) | |
| setEnable ($enabled, $showWindow=false) | |
| 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_CONF = 'nodejsConf' |
| const | LOCAL_CFG_EXE = 'nodejsExe' |
| const | LOCAL_CFG_LAUNCH = 'nodejsLaunch' |
| const | LOCAL_CFG_NPM = 'nodejsNpm' |
| const | LOCAL_CFG_VARS = 'nodejsVars' |
| const | ROOT_CFG_ENABLE = 'nodejsEnable' |
| const | ROOT_CFG_VERSION = 'nodejsVersion' |
| Data Fields inherited from Module | |
| $currentPath | |
| $rootPath | |
| $symlinkPath | |
Protected Member Functions | |
| updateConfig ($version=null, $sub=0, $showWindow=false) | |
| Protected Member Functions inherited from Module | |
| __construct () | |
| replace ($key, $value) | |
| replaceAll ($params) | |
Private Attributes | |
| $conf | |
| $exe | |
| $launch | |
| $npm | |
| $vars | |
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 BinNodejs
The BinNodejs class extends the Module class and provides functionalities specific to managing the Node.js module within the Bearsampp application. It includes methods for reloading the module configuration, switching versions, enabling/disabling the module, and retrieving various configuration paths such as the executable, configuration file, variables file, npm executable, and launch script.
Constants:
Properties:
Methods:
Definition at line 48 of file class.bin.nodejs.php.
| __construct | ( | $id, | |
| $type ) |
Constructs a BinNodejs object and initializes the module with the given ID and type.
| string | $id | The ID of the module. |
| string | $type | The type of the module. |
Definition at line 107 of file class.bin.nodejs.php.
References Module\$id, Module\$type, Log\initClass(), and reload().
| getConf | ( | ) |
Retrieves the configuration file path for Node.js.
Definition at line 300 of file class.bin.nodejs.php.
References $conf.
Referenced by updateConfig().
| getExe | ( | ) |
Retrieves the executable path for Node.js.
Definition at line 290 of file class.bin.nodejs.php.
References $exe.
| getLaunch | ( | ) |
Retrieves the launch script path for Node.js.
Definition at line 330 of file class.bin.nodejs.php.
References $launch.
| getNpm | ( | ) |
Retrieves the npm executable path for Node.js.
Definition at line 320 of file class.bin.nodejs.php.
References $npm.
| getVars | ( | ) |
Retrieves the variables file path for Node.js.
Definition at line 310 of file class.bin.nodejs.php.
References $vars.
| 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 119 of file class.bin.nodejs.php.
References $bearsamppConfig, $bearsamppLang, Module\$id, Module\$type, Log\error(), Lang\ERROR_CONF_NOT_FOUND, Lang\ERROR_EXE_NOT_FOUND, Lang\ERROR_FILE_NOT_FOUND, Log\info(), Lang\NODEJS, and Log\reloadClass().
Referenced by __construct(), and setVersion().
| setEnable | ( | $enabled, | |
| $showWindow = false ) |
Enables or disables the module.
| int | $enabled | The enable status (1 for enabled, 0 for disabled). |
| bool | $showWindow | Whether to show a window during the enable/disable process. |
Definition at line 265 of file class.bin.nodejs.php.
References $bearsamppConfig, $bearsamppLang, Log\debug(), Config\DISABLED, Lang\ENABLE_BUNDLE_NOT_EXIST, Lang\ENABLE_TITLE, Config\ENABLED, Module\getName(), Module\getVersion(), and Log\info().
| setVersion | ( | $version | ) |
Sets the version of the module.
| string | $version | The version to set. |
Reimplemented from Module.
Definition at line 251 of file class.bin.nodejs.php.
References $bearsamppConfig, Module\$version, and reload().
Referenced by updateConfig().
| switchVersion | ( | $version, | |
| $showWindow = false ) |
Switches the Node.js version to the specified version.
| string | $version | The version to switch to. |
| bool | $showWindow | Whether to show a window during the switch process. |
Definition at line 183 of file class.bin.nodejs.php.
References Module\$version, Log\debug(), and updateConfig().
|
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 from Module.
Definition at line 199 of file class.bin.nodejs.php.
References Module\$bearsamppConf, Module\$bearsamppConfRaw, $bearsamppLang, $conf, Module\$version, Lang\BEARSAMPP_CONF_MALFORMED_ERROR, Lang\BEARSAMPP_CONF_NOT_FOUND_ERROR, Log\debug(), Log\error(), getConf(), Module\getName(), Module\getVersion(), setVersion(), and Lang\SWITCH_VERSION_TITLE.
Referenced by switchVersion().
|
private |
Definition at line 87 of file class.bin.nodejs.php.
Referenced by getConf(), and updateConfig().
|
private |
Definition at line 83 of file class.bin.nodejs.php.
Referenced by getExe().
|
private |
Definition at line 99 of file class.bin.nodejs.php.
Referenced by getLaunch().
|
private |
Definition at line 95 of file class.bin.nodejs.php.
Referenced by getNpm().
|
private |
Definition at line 91 of file class.bin.nodejs.php.
Referenced by getVars().
| const LOCAL_CFG_CONF = 'nodejsConf' |
Configuration key for the Node.js configuration file.
Definition at line 78 of file class.bin.nodejs.php.
| const LOCAL_CFG_EXE = 'nodejsExe' |
Configuration key for the Node.js executable.
Definition at line 62 of file class.bin.nodejs.php.
| const LOCAL_CFG_LAUNCH = 'nodejsLaunch' |
Configuration key for the Node.js launch script.
Definition at line 74 of file class.bin.nodejs.php.
| const LOCAL_CFG_NPM = 'nodejsNpm' |
Configuration key for the npm executable.
Definition at line 70 of file class.bin.nodejs.php.
| const LOCAL_CFG_VARS = 'nodejsVars' |
Configuration key for the Node.js variables file.
Definition at line 66 of file class.bin.nodejs.php.
| const ROOT_CFG_ENABLE = 'nodejsEnable' |
Configuration key for enabling the Node.js module.
Definition at line 53 of file class.bin.nodejs.php.
| const ROOT_CFG_VERSION = 'nodejsVersion' |
Configuration key for the Node.js version.
Definition at line 57 of file class.bin.nodejs.php.