![]() |
Bearsampp 2026.9.23
|
Static Public Member Functions | |
| static | isLoaded ($module) |
| static | isLoading ($module) |
| static | loadAsync ($module, callable $loader) |
| static | loadSync ($module, callable $loader) |
| static | markLoaded ($module) |
| static | waitForModule ($module, $timeout=5000) |
Data Fields | |
| const | APPS = 'apps' |
| const | BINS = 'bins' |
| const | CONFIG = 'config' |
| const | CORE = 'core' |
| const | HOMEPAGE = 'homepage' |
| const | LANG = 'lang' |
| const | OPENSSL = 'openssl' |
| const | REGISTRY = 'registry' |
| const | TOOLS = 'tools' |
| const | WINBINDER = 'winbinder' |
Static Private Member Functions | |
| static | loadInBackground ($module, callable $loader) |
Static Private Attributes | |
| static | $loading = array() |
| static | $maxWaitTime = 5000 |
| static | $modules = array() |
Class ModuleLoader
Manages asynchronous loading of non-critical modules. Critical modules (Core, Config, Lang, Bins) load synchronously. Non-critical modules (Apps, Tools, Registry, Homepage) load in background.
Definition at line 16 of file class.moduleloader.php.
|
static |
Check if a module is loaded
| string | $module | Module name |
Definition at line 149 of file class.moduleloader.php.
|
static |
Check if a module is currently loading
| string | $module | Module name |
Definition at line 161 of file class.moduleloader.php.
|
static |
Queue a module for background loading (non-blocking)
| string | $module | Module name |
| callable | $loader | Callback that loads the module |
Definition at line 64 of file class.moduleloader.php.
References Log\debug(), and loadInBackground().
Referenced by Root\loadAppsAsync(), Root\loadHomepageAsync(), Root\loadRegistryAsync(), and Root\loadToolsAsync().
|
staticprivate |
Attempts to load a module in the background.
PHP has no true async in-process execution here, so the loader callback is invoked directly and the module is marked as loaded.
| string | $module | Module name |
| callable | $loader | Loader callback |
Definition at line 92 of file class.moduleloader.php.
Referenced by loadAsync().
|
static |
Load a module synchronously (blocking)
| string | $module | Module name |
| callable | $loader | Callback that loads the module |
Definition at line 46 of file class.moduleloader.php.
References Log\debug().
|
static |
Mark a module as loaded
| string | $module | Module name |
Definition at line 136 of file class.moduleloader.php.
|
static |
Wait for a module to finish loading (blocking) Used when code needs a module that may be loading asynchronously
| string | $module | Module name |
| int | $timeout | Maximum wait time in milliseconds |
Definition at line 112 of file class.moduleloader.php.
References Log\error().
Referenced by Root\ensureModuleLoaded().
|
staticprivate |
Definition at line 22 of file class.moduleloader.php.
|
staticprivate |
Definition at line 25 of file class.moduleloader.php.
|
staticprivate |
Definition at line 19 of file class.moduleloader.php.
| const APPS = 'apps' |
Definition at line 33 of file class.moduleloader.php.
Referenced by Root\loadAppsAsync(), and Root\loadAppsFiber().
| const BINS = 'bins' |
Definition at line 31 of file class.moduleloader.php.
| const CONFIG = 'config' |
Definition at line 28 of file class.moduleloader.php.
| const CORE = 'core' |
Definition at line 27 of file class.moduleloader.php.
| const HOMEPAGE = 'homepage' |
Definition at line 36 of file class.moduleloader.php.
Referenced by Root\loadHomepageAsync(), and Root\loadHomepageFiber().
| const LANG = 'lang' |
Definition at line 29 of file class.moduleloader.php.
| const OPENSSL = 'openssl' |
Definition at line 30 of file class.moduleloader.php.
| const REGISTRY = 'registry' |
Definition at line 35 of file class.moduleloader.php.
Referenced by Root\loadRegistryAsync(), and Root\loadRegistryFiber().
| const TOOLS = 'tools' |
Definition at line 32 of file class.moduleloader.php.
Referenced by Root\loadToolsAsync(), and Root\loadToolsFiber().
| const WINBINDER = 'winbinder' |
Definition at line 34 of file class.moduleloader.php.