Migrating to taskman_configs 6.x
Publish PHP Package / docker (push) Successful in 6s
Details
Publish PHP Package / docker (push) Successful in 6s
Details
This commit is contained in:
parent
49f2a47e64
commit
9c1dda0f6f
|
@ -40,7 +40,7 @@ function flt_str2num($val, $name, $data, $args)
|
|||
return 1*$val;
|
||||
}
|
||||
|
||||
function validate_flt_str2num(\taskman\ConfigFetchResult $fetch_result, \taskman\ConfigCacheEntry $entry)
|
||||
function validate_flt_str2num(\taskman\ConfigManager $conf_mgr, \taskman\ConfigCacheEntry $entry)
|
||||
{
|
||||
$config_extra = $entry->extras;
|
||||
|
||||
|
@ -52,7 +52,8 @@ function validate_flt_str2num(\taskman\ConfigFetchResult $fetch_result, \taskman
|
|||
if($conf_id == 0)
|
||||
continue;
|
||||
|
||||
$fetch_result->getById($conf_id);
|
||||
if($conf_mgr->getCache()->tryGetOrLoadById($conf_id) === null)
|
||||
throw new Exception("Missing config: " . $conf_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -116,14 +117,14 @@ function flt_class($val, $name, $data, $args)
|
|||
return $val;
|
||||
}
|
||||
|
||||
function validate_flt_class(\taskman\ConfigFetchResult $fetch_result, \taskman\ConfigCacheEntry $entry)
|
||||
function validate_flt_class(\taskman\ConfigManager $conf_mgr, \taskman\ConfigCacheEntry $entry)
|
||||
{
|
||||
$config_extra = $entry->extras;
|
||||
|
||||
if(!property_exists($config_extra, 'flt_class_entries'))
|
||||
return;
|
||||
|
||||
$config_globals = $GLOBALS['CONFIG_GLOBALS'];
|
||||
$conf_globals = $conf_mgr->getGlobals();
|
||||
|
||||
foreach($config_extra->flt_class_entries as $conf_ref => $target_class)
|
||||
{
|
||||
|
@ -139,16 +140,16 @@ function validate_flt_class(\taskman\ConfigFetchResult $fetch_result, \taskman\C
|
|||
if(strpos($conf_path, '@') === 0)
|
||||
$conf_path = substr($conf_path, 1) . '.conf.js';
|
||||
|
||||
$conf_path = \taskman\normalize_path(\taskman\config_real_path($config_globals->base_dirs, $conf_path));
|
||||
$conf_path = \taskman\normalize_path(\taskman\config_real_path($conf_globals->base_dirs, $conf_path));
|
||||
|
||||
$conf_cache = $fetch_result->getByPath($conf_path);
|
||||
$conf_cache = $conf_mgr->getCache()->getOrLoadByPath($conf_path);
|
||||
}
|
||||
else if(is_int($conf_ref))
|
||||
{
|
||||
if($conf_ref == 0)
|
||||
continue;
|
||||
|
||||
$conf_cache = $fetch_result->getById($conf_ref);
|
||||
$conf_cache = $conf_mgr->getCache()->getOrLoadById($conf_ref);
|
||||
}
|
||||
else
|
||||
throw new Exception("Invalid config ref: '$conf_ref'");
|
||||
|
|
Loading…
Reference in New Issue