mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 10:11:38 +09:00
Remove gzip support; rely on webserver instead
This commit is contained in:
parent
de2a9288f2
commit
e3ce2bcbcc
5 changed files with 3 additions and 33 deletions
|
|
@ -9,9 +9,8 @@ class DisplayHandler extends Handler
|
|||
{
|
||||
public static $response_size = 0;
|
||||
public static $debug_printed = 0;
|
||||
var $content_size = 0; // /< The size of displaying contents
|
||||
var $gz_enabled = FALSE; // / <a flog variable whether to call contents after compressing by gzip
|
||||
var $handler = NULL;
|
||||
public $content_size = 0;
|
||||
public $handler = NULL;
|
||||
|
||||
/**
|
||||
* print either html or xml content given oModule object
|
||||
|
|
@ -21,12 +20,6 @@ class DisplayHandler extends Handler
|
|||
*/
|
||||
public function printContent(&$oModule)
|
||||
{
|
||||
// Check if the gzip encoding supported
|
||||
if(config('view.use_gzip') && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false && extension_loaded('zlib') && $oModule->gzhandler_enable)
|
||||
{
|
||||
$this->gz_enabled = TRUE;
|
||||
}
|
||||
|
||||
// Extract contents to display by the response method
|
||||
$responseMethod = Context::getResponseMethod();
|
||||
if(Context::get('xeVirtualRequestMethod') == 'xml')
|
||||
|
|
@ -122,21 +115,11 @@ class DisplayHandler extends Handler
|
|||
}
|
||||
}
|
||||
|
||||
// disable gzip if output already exists
|
||||
// flush output buffer
|
||||
while (ob_get_level())
|
||||
{
|
||||
ob_end_flush();
|
||||
}
|
||||
if(headers_sent())
|
||||
{
|
||||
$this->gz_enabled = FALSE;
|
||||
}
|
||||
|
||||
// enable gzip using zlib extension
|
||||
if($this->gz_enabled)
|
||||
{
|
||||
ini_set('zlib.output_compression', true);
|
||||
}
|
||||
|
||||
// call a trigger after display
|
||||
self::$response_size = $this->content_size = strlen($output);
|
||||
|
|
|
|||
|
|
@ -80,7 +80,6 @@ return array(
|
|||
'delay_compile' => 0,
|
||||
'jquery_version' => 2,
|
||||
'server_push' => false,
|
||||
'use_gzip' => false,
|
||||
),
|
||||
'admin' => array(
|
||||
'allow' => array(),
|
||||
|
|
|
|||
|
|
@ -206,7 +206,6 @@ class ConfigParser
|
|||
|
||||
// Convert view configuration.
|
||||
$config['view']['minify_scripts'] = $db_info->minify_scripts ?: 'common';
|
||||
$config['view']['use_gzip'] = (defined('__OB_GZHANDLER_ENABLE__') && constant('__OB_GZHANDLER_ENABLE__'));
|
||||
|
||||
// Convert admin IP whitelist.
|
||||
if (isset($db_info->admin_ip_list) && is_array($db_info->admin_ip_list) && count($db_info->admin_ip_list))
|
||||
|
|
|
|||
|
|
@ -108,7 +108,6 @@ class Advanced extends Base
|
|||
Context::set('concat_scripts', Config::get('view.concat_scripts'));
|
||||
Context::set('jquery_version', Config::get('view.jquery_version'));
|
||||
Context::set('use_server_push', Config::get('view.server_push'));
|
||||
Context::set('use_gzip', Config::get('view.use_gzip'));
|
||||
|
||||
$this->setTemplateFile('config_advanced');
|
||||
}
|
||||
|
|
@ -216,7 +215,6 @@ class Advanced extends Base
|
|||
Config::set('view.delay_compile', intval($vars->delay_template_compile));
|
||||
Config::set('view.jquery_version', $vars->jquery_version == 3 ? 3 : 2);
|
||||
Config::set('view.server_push', $vars->use_server_push === 'Y');
|
||||
Config::set('view.use_gzip', $vars->use_gzip === 'Y');
|
||||
|
||||
// Save
|
||||
if (!Config::save())
|
||||
|
|
|
|||
|
|
@ -239,15 +239,6 @@
|
|||
<p class="x_help-block">{$lang->about_use_server_push}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->use_gzip}</label>
|
||||
<div class="x_controls">
|
||||
<label for="use_gzip_y" class="x_inline"><input type="radio" name="use_gzip" id="use_gzip_y" value="Y" checked="checked"|cond="$use_gzip" /> {$lang->cmd_yes}</label>
|
||||
<label for="use_gzip_n" class="x_inline"><input type="radio" name="use_gzip" id="use_gzip_n" value="N" checked="checked"|cond="!$use_gzip" /> {$lang->cmd_no}</label>
|
||||
<br />
|
||||
<p class="x_help-block">{$lang->about_use_gzip}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_clearfix btnArea">
|
||||
<div class="x_pull-right">
|
||||
<button type="submit" class="x_btn x_btn-primary">{$lang->cmd_save}</button>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue