![]() |
Bearsampp 2026.7.11
|
Public Member Functions | |
| __construct ($rootPath) | |
| errorHandler ($errno, $errstr, $errfile, $errline) | |
| getProcs () | |
| initErrorHandling () | |
| isRoot () | |
| register () | |
| removeErrorHandling () | |
Static Public Member Functions | |
| static | clearCaches () |
| static | ensureModuleLoaded ($module, $timeout=5000) |
| static | getCacheStats () |
| static | loadApps () |
| static | loadAppsAsync () |
| static | loadAppsFiber () |
| static | loadBins () |
| static | loadConfig () |
| static | loadCore () |
| static | loadHomepage () |
| static | loadHomepageAsync () |
| static | loadHomepageFiber () |
| static | loadLang () |
| static | loadOpenSsl () |
| static | loadRegistry () |
| static | loadRegistryAsync () |
| static | loadRegistryFiber () |
| static | loadTools () |
| static | loadToolsAsync () |
| static | loadToolsFiber () |
| static | loadWinbinder () |
Data Fields | |
| $path | |
| const | ERROR_HANDLER = 'errorHandler' |
Static Private Member Functions | |
| static | debugStringBacktrace () |
Private Attributes | |
| $isRoot | |
| $procs | |
| $procsLoaded = false | |
Class Root
This class represents the root of the Bearsampp application. It handles the initialization, configuration, and management of various components and settings within the application.
Definition at line 16 of file class.root.php.
| __construct | ( | $rootPath | ) |
Constructs a Root object with the specified root path.
| string | $rootPath | The root path of the application. |
Definition at line 30 of file class.root.php.
References Path\init(), and isRoot().
|
static |
Clear all configuration caches Used on version upgrade or manual reset
Definition at line 170 of file class.root.php.
References CacheManager\clearAll().
|
staticprivate |
Generates a debug backtrace string.
Definition at line 426 of file class.root.php.
Referenced by errorHandler().
|
static |
Ensures a module is loaded, waiting if it's still loading asynchronously. Safe to call for modules that may be loading in background. Supports both fiber-based and deferred loading mechanisms.
| string | $module | The module name (use ModuleLoader constants) |
| int | $timeout | Maximum wait time in milliseconds |
Definition at line 142 of file class.root.php.
References FiberModuleLoader\isAvailable(), FiberModuleLoader\waitForModule(), and ModuleLoader\waitForModule().
| errorHandler | ( | $errno, | |
| $errstr, | |||
| $errfile, | |||
| $errline ) |
Handles errors and logs them to the error log file.
| int | $errno | The level of the error raised. |
| string | $errstr | The error message. |
| string | $errfile | The filename that the error was raised in. |
| int | $errline | The line number the error was raised at. |
Definition at line 383 of file class.root.php.
References debugStringBacktrace(), E_USER_ERROR, Path\formatUnixPath(), Path\getErrorLogFilePath(), and Path\getRootPath().
|
static |
Get cache manager statistics Useful for monitoring warm start performance
Definition at line 159 of file class.root.php.
References CacheManager\getStats().
| getProcs | ( | ) |
Retrieves the list of processes. Lazy loads process list only when accessed.
Definition at line 124 of file class.root.php.
References $procs, Win32Ps\getListProcs(), and isRoot().
| initErrorHandling | ( | ) |
Initializes error handling settings for the application.
Definition at line 99 of file class.root.php.
References Path\getErrorLogFilePath().
Referenced by register().
| isRoot | ( | ) |
Checks if the current script is executed from the root path.
Definition at line 180 of file class.root.php.
References $isRoot.
Referenced by __construct(), and getProcs().
|
static |
Loads the apps components of the application.
Definition at line 244 of file class.root.php.
|
static |
Loads the apps components asynchronously. Apps module loads in background without blocking main thread.
Definition at line 295 of file class.root.php.
References ModuleLoader\APPS, and ModuleLoader\loadAsync().
Referenced by register().
|
static |
Loads the apps components in a Fiber (true async, PHP 8.1+) Apps module loads concurrently with main startup.
Definition at line 343 of file class.root.php.
References ModuleLoader\APPS, and FiberModuleLoader\loadInFiber().
Referenced by register().
|
static |
Loads the binary components of the application.
Definition at line 224 of file class.root.php.
References $bearsamppBins.
Referenced by register().
|
static |
Loads the configuration settings of the application.
Definition at line 197 of file class.root.php.
References $bearsamppConfig.
Referenced by ActionSwitchVersion\processWindow(), and register().
|
static |
Loads the core components of the application.
Definition at line 188 of file class.root.php.
References $bearsamppCore.
Referenced by register().
|
static |
Loads the homepage settings of the application.
Definition at line 273 of file class.root.php.
References $bearsamppHomepage.
|
static |
Loads the homepage settings asynchronously. Homepage is for UI display, can load in background.
Definition at line 319 of file class.root.php.
References $bearsamppHomepage, ModuleLoader\HOMEPAGE, and ModuleLoader\loadAsync().
Referenced by register().
|
static |
Loads the homepage settings in a Fiber (true async, PHP 8.1+) Homepage is for UI display, loads concurrently.
Definition at line 367 of file class.root.php.
References $bearsamppHomepage, ModuleLoader\HOMEPAGE, and FiberModuleLoader\loadInFiber().
Referenced by register().
|
static |
Loads the language settings of the application.
Definition at line 206 of file class.root.php.
References $bearsamppLang.
Referenced by register().
|
static |
Loads the OpenSSL settings of the application.
Definition at line 215 of file class.root.php.
Referenced by register().
|
static |
Loads the registry settings of the application.
Definition at line 264 of file class.root.php.
|
static |
Loads the registry settings asynchronously. Registry operations are slow (COM), loads in background.
Definition at line 307 of file class.root.php.
References ModuleLoader\loadAsync(), and ModuleLoader\REGISTRY.
Referenced by register().
|
static |
Loads the registry settings in a Fiber (true async, PHP 8.1+) Registry operations are slow (COM), loads concurrently.
Definition at line 355 of file class.root.php.
References FiberModuleLoader\loadInFiber(), and ModuleLoader\REGISTRY.
Referenced by register().
|
static |
Loads the tools components of the application.
Definition at line 233 of file class.root.php.
Referenced by Win32Service\create().
|
static |
Loads the tools components asynchronously. Tools module loads in background without blocking main thread.
Definition at line 283 of file class.root.php.
References ModuleLoader\loadAsync(), and ModuleLoader\TOOLS.
Referenced by register().
|
static |
Loads the tools components in a Fiber (true async, PHP 8.1+) Tools module loads concurrently with main startup.
Definition at line 331 of file class.root.php.
References FiberModuleLoader\loadInFiber(), and ModuleLoader\TOOLS.
Referenced by register().
|
static |
Loads the Winbinder extension if available.
Definition at line 253 of file class.root.php.
Referenced by register().
| register | ( | ) |
Registers the application components and initializes error handling.
Definition at line 40 of file class.root.php.
References Path\getTmpPath(), CacheManager\init(), FiberModuleLoader\init(), Log\init(), initErrorHandling(), loadAppsAsync(), loadAppsFiber(), loadBins(), loadConfig(), loadCore(), loadHomepageAsync(), loadHomepageFiber(), loadLang(), loadOpenSsl(), loadRegistryAsync(), loadRegistryFiber(), loadToolsAsync(), loadToolsFiber(), loadWinbinder(), and Log\separator().
| removeErrorHandling | ( | ) |
Removes the custom error handling, reverting to the default PHP error handling.
Definition at line 110 of file class.root.php.
|
private |
Definition at line 23 of file class.root.php.
Referenced by isRoot().
| $path |
Definition at line 20 of file class.root.php.
|
private |
Definition at line 21 of file class.root.php.
Referenced by getProcs().
|
private |
Definition at line 22 of file class.root.php.
| const ERROR_HANDLER = 'errorHandler' |
Definition at line 18 of file class.root.php.