Fixing initialization of globals
Publish PHP Package / docker (push) Successful in 7s Details

This commit is contained in:
Pavel Shevaev 2025-02-25 14:07:10 +03:00
parent 1079143376
commit aa9ff115aa
2 changed files with 5 additions and 1 deletions

View File

@ -243,6 +243,9 @@ function _config_cache_fetch(ConfigFetchParams $params) : ConfigFetchResult
if($params->scanned->isEmpty())
return new ConfigFetchResult();
//TODO: not sure if it's the best place for this one
$GLOBALS['CONFIG_GLOBALS'] = $params->globals;
$params->scanned->apply(function($base_dir, $files) { sort($files); return $files;});
$jobs = $params->splitJobs();
@ -354,7 +357,6 @@ function _config_invalidate_cache(ConfigFetchParams $params, string $base_dir, s
throw new Exception("Bad conf id: {$conf_id}");
//TODO: this is a bit ugly but kinda works for now
$GLOBALS['CONFIG_GLOBALS'] = $params->globals;
$GLOBALS['CONFIG_CURRENT_FILE'] = $file;
$GLOBALS['CONFIG_CURRENT_PROTO_ID'] = $conf_id;
$GLOBALS['CONFIG_EXTRAS'] = ConfigCacheEntryExtras::create();

View File

@ -25,6 +25,8 @@ class ConfigGlobals
function initWorker()
{
$GLOBALS['CONFIG_GLOBALS'] = $this;
if($this->worker_init_fn !== null)
{
$fn = $this->worker_init_fn;