View Issue Details

IDProjectCategoryView StatusLast Update
0019881mantisbtbugtrackerpublic2022-07-24 06:35
Reporterdregad Assigned Todregad  
Status closedResolutionfixed 
Target Version1.3.0-beta.3Fixed in Version1.3.0-beta.3 
Summary0019881: config_flush_cache() doesn't properly clean the cache

The config api uses several cache variables. Currently the config_flush_cache() function only clears $g_cache_config and $g_cache_config_access.

It should also clear $g_cache_config_eval.

Additional Information

I don't think this issue affects the current MantisBT core in any way, I stumbled upon this problem while performing tests for another issue.

TagsNo tags attached.


related to 0030793 closeddregad config_flush_cache() doesn't clean the eval cache for individual options 




2015-06-24 18:25

developer   ~0050977

PR for review



2015-06-28 09:59

administrator   ~0050990

Maybe we could get rid of the whole config_eval stuff.
Not sure, but should be better in terms of performance and memory.

It seems to be used just a view times, e.g.
$g_cookie_prefix = 'MANTIS';
$g_string_cookie = '%cookie_prefix%_STRING_COOKIE';
$g_project_cookie = '%cookie_prefix%_PROJECT_COOKIE';
$g_manage_users_cookie = '%cookie_prefix%_MANAGE_USERS_COOKIE';

Do we really need this?
Isn't it enough to allow users to set just $g_cookie_prefix in config_defaults_inc.php and to compute the other values hardcoded on the fly?

I hardly believe that administrators do something like
$g_cookie_prefix = 'MyMANTIS';
$g_string_cookie = '%cookie_prefix%_MY_STRING_COOKIE';
$g_project_cookie = '%cookie_prefix%_MY_PROJECT_COOKIE';



2015-07-01 00:20

manager   ~0050996

Last edited: 2015-07-01 00:29

@atrol, the idea was that the admin will just need to set one config option:
$g_cookie_prefix = 'MyMANTIS';

This will in-turn using eval result in the following values:
$g_string_cookie = 'MyMANTIS_STRING_COOKIE';
$g_project_cookie = 'MyMANTIS_PROJECT_COOKIE';

This also means that if we add a third one $g_xxx_cookie in a future release, then it will automatically pickup the same logical prefix.

Now whether this this is really useful or not is a different story :)

Related Changesets

MantisBT: master 1e072959

2015-06-21 07:48


Details Diff
config_flush_cache() now clears $g_cache_config_eval too

Fixes 0019881
Affected Issues
mod - core/config_api.php Diff File