![]() |
Bearsampp 2025.8.29
API Documentation for Bearsampp
|
Public Member Functions | |
| __construct ($id, $type) | |
| findRepos ($cache=true) | |
| getBash () | |
| getExe () | |
| getRepos () | |
| isScanStartup () | |
| reload ($id=null, $type=null) | |
| setScanStartup ($scanStartup) | |
| setVersion ($version) | |
| 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 | LOCAL_CFG_BASH = 'gitBash' |
| const | LOCAL_CFG_EXE = 'gitExe' |
| const | LOCAL_CFG_SCAN_STARTUP = 'gitScanStartup' |
| const | REPOS_CACHE_FILE = 'reposCache.dat' |
| const | REPOS_FILE = 'repos.dat' |
| const | ROOT_CFG_VERSION = 'gitVersion' |
| Data Fields inherited from Module | |
| const | BUNDLE_RELEASE = 'bundleRelease' |
Protected Member Functions | |
| updateConfig ($version=null, $sub=0, $showWindow=false) | |
| Protected Member Functions inherited from Module | |
| __construct () | |
| replace ($key, $value) | |
| replaceAll ($params) | |
Private Attributes | |
| $bash | |
| $exe | |
| $repos | |
| $reposCacheFile | |
| $reposFile | |
| $scanStartup | |
Additional Inherited Members | |
| Protected Attributes inherited from Module | |
| $bearsamppConf | |
| $bearsamppConfRaw | |
| $currentPath | |
| $enable | |
| $name | |
| $release = 'N/A' | |
| $rootPath | |
| $symlinkPath | |
| $version | |
Class ToolGit
This class represents the Git tool module in the Bearsampp application. It handles the configuration, initialization, and management of Git-related settings and repositories.
Definition at line 16 of file class.tool.git.php.
| __construct | ( | $id, | |
| $type ) |
Constructs a ToolGit object and initializes the Git tool module.
| string | $id | The ID of the module. |
| string | $type | The type of the module. |
Definition at line 41 of file class.tool.git.php.
References Module\$id, Module\$type, Util\logInitClass(), and reload().
| findRepos | ( | $cache = true | ) |
Finds Git repositories either from cache or by scanning the directories.
| bool | $cache | Whether to use the cached repositories list. |
Definition at line 145 of file class.tool.git.php.
References $repos, $result, and Util\findRepos().
| getBash | ( | ) |
Retrieves the path to the Git Bash executable.
Definition at line 208 of file class.tool.git.php.
References $bash.
Referenced by updateConfig().
| getExe | ( | ) |
Retrieves the path to the Git executable.
Definition at line 199 of file class.tool.git.php.
References $exe.
Referenced by updateConfig().
| getRepos | ( | ) |
Retrieves the list of repositories.
Definition at line 190 of file class.tool.git.php.
References $repos.
| isScanStartup | ( | ) |
Checks if the Git tool module is set to scan repositories at startup.
Definition at line 217 of file class.tool.git.php.
References Config\ENABLED.
| reload | ( | $id = null, | |
| $type = null ) |
Reloads the Git tool 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 52 of file class.tool.git.php.
References $bearsamppConfig, $bearsamppLang, $bearsamppRoot, Module\$id, Module\$type, Lang\ERROR_CONF_NOT_FOUND, Lang\ERROR_EXE_NOT_FOUND, Lang\ERROR_FILE_NOT_FOUND, Util\formatUnixPath(), Lang\GIT, Util\logError(), Util\logInfo(), Util\logReloadClass(), and Util\logWarning().
Referenced by __construct(), and setVersion().
| setScanStartup | ( | $scanStartup | ) |
Sets whether the Git tool module should scan repositories at startup.
| bool | $scanStartup | True to enable scanning at startup, false to disable. |
Definition at line 226 of file class.tool.git.php.
References $scanStartup, and Util\replaceInFile().
| setVersion | ( | $version | ) |
Sets the version of the Git tool module.
| string | $version | The version to set. |
Reimplemented from Module.
Definition at line 178 of file class.tool.git.php.
References $bearsamppConfig, Module\$version, and reload().
|
protected |
Updates the Git tool 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 119 of file class.tool.git.php.
References Module\$version, getBash(), getExe(), Module\getSymlinkPath(), and Util\logDebug().
|
private |
Definition at line 32 of file class.tool.git.php.
Referenced by getBash().
|
private |
Definition at line 31 of file class.tool.git.php.
Referenced by getExe().
|
private |
Definition at line 29 of file class.tool.git.php.
Referenced by findRepos(), and getRepos().
|
private |
Definition at line 28 of file class.tool.git.php.
|
private |
Definition at line 27 of file class.tool.git.php.
|
private |
Definition at line 33 of file class.tool.git.php.
Referenced by setScanStartup().
| const LOCAL_CFG_BASH = 'gitBash' |
Definition at line 21 of file class.tool.git.php.
| const LOCAL_CFG_EXE = 'gitExe' |
Definition at line 20 of file class.tool.git.php.
| const LOCAL_CFG_SCAN_STARTUP = 'gitScanStartup' |
Definition at line 22 of file class.tool.git.php.
| const REPOS_CACHE_FILE = 'reposCache.dat' |
Definition at line 25 of file class.tool.git.php.
| const REPOS_FILE = 'repos.dat' |
Definition at line 24 of file class.tool.git.php.
| const ROOT_CFG_VERSION = 'gitVersion' |
Definition at line 18 of file class.tool.git.php.