From 11cd96e650901aa502c3f41b81258f681118328a Mon Sep 17 00:00:00 2001 From: Carlos Proensa Date: Mon, 10 Apr 2017 22:38:26 +0200 Subject: [PATCH] rename filter cache variables add comments --- core/filter_api.php | 69 +++++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/core/filter_api.php b/core/filter_api.php index 4436d3d838..1aef81e012 100644 --- a/core/filter_api.php +++ b/core/filter_api.php @@ -82,8 +82,28 @@ require_api( 'version_api.php' ); require_api( 'filter_form_api.php' ); +# @global array $g_filter Filter array for the filter in use through view_all_bug_page +# This gets initialized on filter load +# @TODO cproensa We should move towards not relying on this variable, as we reuse filter logic +# to allow operating on other filter different that the one in use for view_all_bug_page. +# For example: manage and edit stored filters. $g_filter = null; + +# ========================================================================== +# CACHING +# ========================================================================== +# We cache filter requests to reduce the number of SQL queries + +# @global array $g_cache_filter_db_rows +# indexed by filter_id, contains the filter rows as read from db table +$g_cache_filter_db_rows = array(); + +# @global array $g_cache_filter_db_serialized +# indexed by filter_id, contains the serialized filter strings +$g_cache_filter_db_serialized = array(); + + /** * Initialize the filter API with the current filter. * @param array $p_filter The filter to set as the current filter. @@ -2640,25 +2660,8 @@ function filter_draw_selection_area2( $p_page_number, $p_for_screen = true, $p_e