Skip to content

Commit

Permalink
1. Added core_compress_API.php which provides optional support for co…
Browse files Browse the repository at this point in the history
…mpression.

This option improves performance but it is OFF by default since it requires PHP 4.0.4.
2. Make use of the compression APIs in View Bug Advanced, View Bug Simple,
and View Bugs.  More pages will be integrated later.
3. Disabled the debug timer (left the normal time).  We should avoid leaving debugging
code committed, since some people make use of the latest CVS and hence it
would be good to avoid needing them to change in the code.
4. In the view bugs, a select statement was executed for each bug to retrieve
the latest modification time for the bugnotes.  Disabled the execution of this
query in case the number of bugs is 0.


git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@1098 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
vboctor committed Jun 7, 2002
1 parent a4e2a81 commit 3a7eec6
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 12 deletions.
1 change: 1 addition & 0 deletions core_API.php
Expand Up @@ -85,5 +85,6 @@
require( 'core_proj_user_API.php' );
require( 'core_category_API.php' );
require( 'core_version_API.php' );
require( 'core_compress_API.php' );
# --------------------
?>
25 changes: 25 additions & 0 deletions core_compress_API.php
@@ -0,0 +1,25 @@
<?php

# Starts the buffering/compression (only if the compression option is ON)
# This method should be called after all possible re-directs and access
# level checks.
function start_compression() {
global $g_compress_html;

if ( ON == $g_compress_html ) {
ob_implicit_flush( 0 );
ob_start( 'ob_gzhandler' );
}
}

# Stop buffering and flush buffer contents.
function stop_compression() {
global $g_compress_html;

if ( ON == $g_compress_html ) {
ob_end_flush();
ob_implicit_flush();
}
}

?>
2 changes: 1 addition & 1 deletion core_timer_API.php
Expand Up @@ -13,7 +13,7 @@
# Charles Killian, modified by Kenzaburo Ito

# set to ON if you want to see debug level timings
$g_debug_timer = ON;
$g_debug_timer = OFF;

# USAGE: set #debug_timer to ON and just call mark_time( 'token name' );
# where 'token name' is descriptive of what is happening at that point
Expand Down
1 change: 1 addition & 0 deletions doc/ChangeLog
Expand Up @@ -56,6 +56,7 @@ Mantis
* Added support for private bugnotes.
* Enhanced the admin_upgrade.php script, and supported auto-generation of SQL files.
* In the view bugs, when all projects is selected the project name is now displayed in smaller font over the category.
* Added support for optional compression of html output ($g_compress_html). This option is OFF by default since it requires PHP 4.04.

2002.05.19 - 0.17.3

Expand Down
5 changes: 5 additions & 0 deletions view_all_bug_page.php
Expand Up @@ -28,6 +28,8 @@
check_varset( $f_search, false );
check_varset( $f_page_number, 1 );

start_compression();

# Load preferences
$f_show_category = $t_setting_arr[1];
$f_show_severity = $t_setting_arr[2];
Expand Down Expand Up @@ -264,3 +266,6 @@
<?php include( $g_view_all_include_file ) ?>

<?php print_page_bot1( __FILE__ ) ?>
<?php
stop_compression();
?>
20 changes: 10 additions & 10 deletions view_all_inc.php
Expand Up @@ -221,7 +221,6 @@
$v_summary = string_display( $v_summary );
$t_last_updated = date( $g_short_date_format, $v_last_updated );


# choose color based on status
$status_color = get_status_color( $v_status );

Expand All @@ -231,14 +230,15 @@
# grab the project name
$project_name = get_project_field( $v_project_id, 'name' );

$query = "SELECT UNIX_TIMESTAMP(last_modified) as last_modified
FROM $g_mantis_bugnote_table
WHERE bug_id='$v_id'
ORDER BY last_modified DESC
LIMIT 1";
$res2 = db_query( $query );
$v_bugnote_updated = db_result( $res2, 0, 0 );

if ( $bugnote_count > 0 ) {
$query = "SELECT UNIX_TIMESTAMP(last_modified) as last_modified
FROM $g_mantis_bugnote_table
WHERE bug_id='$v_id'
ORDER BY last_modified DESC
LIMIT 1";
$res2 = db_query( $query );
$v_bugnote_updated = db_result( $res2, 0, 0 );
}
?>
<tr>
<?php if ( access_level_check_greater_or_equal( $g_bug_move_access_level ) ) { ?>
Expand Down Expand Up @@ -358,4 +358,4 @@
?>
</div>

<?php print_status_colors() ?>
<?php print_status_colors() ?>
3 changes: 3 additions & 0 deletions view_bug_advanced_page.php
Expand Up @@ -39,6 +39,8 @@
$v2_description = string_display( $v2_description );
$v2_steps_to_reproduce = string_display( $v2_steps_to_reproduce );
$v2_additional_information = string_display( $v2_additional_information );

start_compression();
?>
<?php print_page_top1() ?>
<?php print_page_top2() ?>
Expand Down Expand Up @@ -446,3 +448,4 @@
}
?>
<?php print_page_bot1( __FILE__ ) ?>
<?php stop_compression(); ?>
5 changes: 4 additions & 1 deletion view_bug_page.php
Expand Up @@ -39,6 +39,8 @@
$v2_description = string_display( $v2_description );
$v2_steps_to_reproduce = string_display( $v2_steps_to_reproduce );
$v2_additional_information = string_display( $v2_additional_information );

start_compression();
?>
<?php print_page_top1() ?>
<?php print_page_top2() ?>
Expand Down Expand Up @@ -346,4 +348,5 @@
include( $g_history_include_file );
}
?>
<?php print_page_bot1( __FILE__ ) ?>
<?php print_page_bot1( __FILE__ ) ?>
<?php stop_compression(); ?>

0 comments on commit 3a7eec6

Please sign in to comment.