Changeset 2564

Show
Ignore:
Timestamp:
04/24/2008 09:28:05 PM (7 months ago)
Author:
Shadowhand
Message:

Added core.render_stats configuration option.

NOTE: This must be added to existing configuration files that are used with trunk!

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/application/config/config.php

    r2486 r2564  
    5454 
    5555/** 
     56 * Enable or display statistics in the final output. Stats are replaced via 
     57 * specific strings, such as {execution_time}. 
     58 * 
     59 * @see http://doc.kohanaphp.com/general/configuration/config 
     60 */ 
     61$config['render_stats'] = FALSE; 
     62 
     63/** 
    5664 * Filename prefixed used to determine extensions. For example, an 
    5765 * extension to the Controller class would be named MY_Controller.php. 
  • trunk/system/core/Kohana.php

    r2466 r2564  
    367367                $benchmark = Benchmark::get(SYSTEM_BENCHMARK.'_total_execution'); 
    368368 
    369                 // Replace the global template variables 
    370                 $output = str_replace( 
    371                         array 
    372                         ( 
    373                                 '{kohana_version}', 
    374                                 '{kohana_codename}', 
    375                                 '{execution_time}', 
    376                                 '{memory_usage}', 
    377                                 '{included_files}', 
    378                         ), 
    379                         array 
    380                         ( 
    381                                 KOHANA_VERSION, 
    382                                 KOHANA_CODENAME, 
    383                                 $benchmark['time'], 
    384                                 number_format($memory, 2).'MB', 
    385                                 count(get_included_files()), 
    386                         ), 
    387                         $output 
    388                 ); 
    389  
    390                 if (ini_get('output_handler') != 'ob_gzhandler' AND ini_get('zlib.output_compression') == 0 AND $level = Config::item('core.output_compression')) 
     369                if (Config::item('core.render_stats') === TRUE) 
     370                { 
     371                        // Replace the global template variables 
     372                        $output = str_replace( 
     373                                array 
     374                                ( 
     375                                        '{kohana_version}', 
     376                                        '{kohana_codename}', 
     377                                        '{execution_time}', 
     378                                        '{memory_usage}', 
     379                                        '{included_files}', 
     380                                ), 
     381                                array 
     382                                ( 
     383                                        KOHANA_VERSION, 
     384                                        KOHANA_CODENAME, 
     385                                        $benchmark['time'], 
     386                                        number_format($memory, 2).'MB', 
     387                                        count(get_included_files()), 
     388                                ), 
     389                                $output 
     390                        ); 
     391                } 
     392 
     393                if ($level = Config::item('core.output_compression') AND ini_get('output_handler') !== 'ob_gzhandler' AND (int) ini_get('zlib.output_compression') === 0) 
    391394                { 
    392395                        if ($level < 1 OR $level > 9)