<?php
/* --------------------------------------------------------------
HTTPCaching.inc.php 2012-01-11 mb
Gambio GmbH
http://www.gambio.de
Copyright (c) 2012 Gambio GmbH
Released under the GNU General Public License (Version 2)
[http://www.gnu.org/licenses/gpl-2.0.html]
--------------------------------------------------------------
*/
class HTTPCaching
{
var $v_etag = '';
var $v_last_modified = '';
var $v_activated = true;
function HTTPCaching()
{
if(isset($_SERVER['HTTP_IF_NONE_MATCH']))
{
$this->v_etag = trim($_SERVER['HTTP_IF_NONE_MATCH']);
}
if(isset($_SERVER['HTTP_IF_MODIFIED_SINCE']))
{
$this->v_last_modified = @strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']);
}
if(defined('HTTP_CACHING') && HTTP_CACHING == 'false')
{
$this->v_activated = false;
}
}
function send_header($p_unencrypted_etag_content = false, $p_md5_file = false, $p_last_modified_unixtime = false, $p_cache_control = false, $p_expires_unixtime = false, $p_pragma = false)
{
if(!empty($p_unencrypted_etag_content))
{
if($p_md5_file && is_file($p_unencrypted_etag_content))
{
$t_etag = md5_file($p_unencrypted_etag_content);
}
else
{
$t_etag = md5($p_unencrypted_etag_content);
}
header('Etag: "' . $t_etag . '"');
}
if(!empty($p_last_modified_unixtime))
{
header('Last-Modified: ' . gmdate("D, d M Y H:i:s", (int)$p_last_modified_unixtime) . ' GMT');
}
if(is_string($p_cache_control))
{
header('Cache-Control: ' . $p_cache_control);
}
if(!empty($p_expires_unixtime))
{
header('Expires: ' . gmdate("D, d M Y H:i:s", (int)$p_expires_unixtime) . ' GMT');
}
if(is_string($p_pragma))
{
header('Pragma: ' . $p_pragma);
}
}
function check_cache($p_unencrypted_etag_content = false, $p_md5_file = false, $p_last_modified_unixtime = false)
{
if(!empty($p_unencrypted_etag_content))
{
if($p_md5_file)
{
$t_etag = '"' . md5_file($p_unencrypted_etag_content). '"';
}
else
{
$t_etag = '"' . md5($p_unencrypted_etag_content) . '"';
}
if($this->v_etag === $t_etag && $this->v_activated === true)
{
header('HTTP/1.1 304 Not Modified');
exit;
}
}
if(!empty($p_last_modified_unixtime))
{
if($this->v_last_modified === gmdate("D, d M Y H:i:s", (int)$p_last_modified_unixtime) . ' GMT' && $this->v_activated === true)
{
header('HTTP/1.1 304 Not Modified');
exit;
}
}
}
function start_gzip()
{
// if gzip_compression is enabled, start to buffer the output
if(strpos(gm_get_env_info('SCRIPT_NAME'), 'fckeditor') === false
&& GZIP_COMPRESSION == 'true'
&& $ext_zlib_loaded = extension_loaded('zlib')
&& strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'msie 6.') === false)
{
if(PREFER_GZHANDLER == 'false')
{
@ini_set('zlib.output_compression', 'On');
}
if(strtolower((string)ini_get('zlib.output_compression') == 'off') || (string)ini_get('zlib.output_compression') == '0' || PREFER_GZHANDLER == 'true')
{
@ini_set('zlib.output_compression', 'Off');
$t_buffer = ob_start("ob_gzhandler");
if($t_buffer === false)
{
ob_start();
}
}
else
{
$t_output_compression_level = (int)GZIP_LEVEL;
if($t_output_compression_level < 1 || $t_output_compression_level > 9)
{
$t_output_compression_level = 9;
}
@ini_set('zlib.output_compression_level', $t_output_compression_level);
}
}
}
function start_output_buffer($p_callback = false)
{
if($p_callback)
{
ob_start($p_callback);
}
else
{
ob_start();
}
}
function stop_output_buffer()
{
$t_content = ob_get_contents();
ob_end_clean();
return $t_content;
}
}
?>| nama | waktu | ukuran | owner | perm | aksi |
|---|---|---|---|---|---|
| .. | |||||
| FeatureFilter/ | 2013-11-12 21:11 | 63.96 KB | 76129f60960:kunden | dxwrx-rx-r | |
| Properties/ | 2013-11-12 21:11 | 33.17 KB | 76129f60960:kunden | dxwrx-rx-r | |
| QuantityUnit/ | 2013-11-12 21:11 | 11.82 KB | 76129f60960:kunden | dxwrx-rx-r | |
| SliderSet/ | 2013-11-12 21:11 | 35.94 KB | 76129f60960:kunden | dxwrx-rx-r | |
| google/ | 2013-11-12 21:11 | 13.18 KB | 76129f60960:kunden | dxwrx-rx-r | |
| AdminMenuControl.inc.php | 2013-11-12 21:11 | 2.54 KB | 76129f60960:kunden | -xw-x----- | |
| BrowserExtensionControl.inc.php | 2013-11-12 21:11 | 5.4 KB | 76129f60960:kunden | -xw-x----- | |
| CacheControl.inc.php | 2013-11-12 21:11 | 7.99 KB | 76129f60960:kunden | -xw-x----- | |
| CategoriesAgent.inc.php | 2013-11-12 21:11 | 9.8 KB | 76129f60960:kunden | -xw-x----- | |
| DataObjectContainer.inc.php | 2013-11-12 21:11 | 1.44 KB | 76129f60960:kunden | -xw-x----- | |
| EkomiAccountManager.inc.php | 2013-11-12 21:11 | 3.63 KB | 76129f60960:kunden | -xw-x----- | |
| EkomiManager.inc.php | 2013-11-12 21:11 | 8.81 KB | 76129f60960:kunden | -xw-x----- | |
| ExtenderComponent.inc.php | 2013-11-12 21:11 | 758 B | 76129f60960:kunden | -xw-x----- | |
| HTTPCaching.inc.php | 2013-11-12 21:11 | 3.78 KB | 76129f60960:kunden | -xw-x----- | |
| JSOptionsControl.inc.php | 2013-11-12 21:11 | 654 B | 76129f60960:kunden | -xw-x----- | |
| LanguageTextManager.inc.php | 2013-11-12 21:11 | 5.66 KB | 76129f60960:kunden | -xw-x----- | |
| ListingManager.inc.php | 2013-11-12 21:11 | 1.34 KB | 76129f60960:kunden | -xw-x----- | |
| LoadUrl.php | 2013-11-12 21:11 | 1.86 KB | 76129f60960:kunden | -xw-x----- | |
| PageTrack.inc.php | 2013-11-12 21:11 | 1.73 KB | 76129f60960:kunden | -xw-x----- | |
| RecreateOrder.inc.php | 2013-11-12 21:11 | 7.99 KB | 76129f60960:kunden | -xw-x----- | |
| ShopURLHandler.inc.php | 2013-11-12 21:11 | 2 KB | 76129f60960:kunden | -xw-x----- | |
| TemplateControl.inc.php | 2013-11-12 21:11 | 3.47 KB | 76129f60960:kunden | -xw-x----- | |
| index.html | 2013-11-12 21:11 | 395 B | 76129f60960:kunden | -xw-x----- | |