View Issue Details

IDProjectCategoryView StatusLast Update
0019881mantisbtbugtrackerpublic2015-09-06 17:37
ReporterdregadAssigned Todregad 
PrioritynormalSeveritytweakReproducibilityalways
Status closedResolutionfixed 
Product Version 
Target Version1.3.0-beta.3Fixed in Version1.3.0-beta.3 
Summary0019881: config_flush_cache() doesn't properly clean the cache
Description

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.

Activities

dregad

dregad

2015-06-24 18:25

developer   ~0050977

PR for review https://github.com/mantisbt/mantisbt/pull/613

atroladmin

atroladmin

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';
...

vboctor

vboctor

2015-07-01 00:20

manager   ~0050996

Last edited: 2015-07-01 00:29

View 2 revisions

@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 11:48:28

dregad

Details Diff
config_flush_cache() now clears $g_cache_config_eval too

Fixes 0019881
mod - core/config_api.php Diff File

Issue History

Date Modified Username Field Change
2015-06-24 12:59 dregad New Issue
2015-06-24 12:59 dregad Status new => assigned
2015-06-24 12:59 dregad Assigned To => dregad
2015-06-24 18:25 dregad Note Added: 0050977
2015-06-28 09:59 atroladmin Note Added: 0050990
2015-07-01 00:20 vboctor Note Added: 0050996
2015-07-01 00:29 vboctor Note Edited: 0050996 View Revisions
2015-08-02 19:21 dregad Changeset attached => MantisBT master 1e072959
2015-08-02 19:21 dregad Status assigned => resolved
2015-08-02 19:21 dregad Resolution open => fixed
2015-08-02 19:21 dregad Fixed in Version => 1.3.0-beta.3
2015-09-06 17:37 vboctoradmin Status resolved => closed