forked from bjohnson045/phpMyDirectory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
load.php
51 lines (41 loc) · 1.3 KB
/
load.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
define('DEFAULTS_PATHS_ONLY',true);
include('./defaults.php');
header("Expires: ".gmdate("D, d M Y H:i:s",strtotime("+7 day"))." GMT");
if(strstr($_SERVER['HTTP_ACCEPT_ENCODING'],'gzip') AND extension_loaded('zlib')) {
@ob_start('ob_gzhandler');
@ob_implicit_flush(0);
@header("Content-Encoding: zlib,deflate,gzip");
}
$last_modified = 0;
header("Last-Modified: ".gmdate("D, d M Y H:i:s", $last_modified)." GMT");
if(isset($_GET['css'])) {
header("Content-Type: text/css");
$parts = explode(',',$_GET['css']);
ob_start();
foreach($parts AS $part) {
switch($part) {
default:
break;
}
if($file_time > $last_modified) {
$last_modified = $file_time;
}
}
$contents = ob_get_contents();
ob_end_clean();
echo $contents;
}
if(strstr('gzip',$_SERVER['HTTP_ACCEPT_ENCODING']) AND extension_loaded('zlib')) {
$gzip_contents = ob_get_contents();
ob_end_clean();
$gzip_size = strlen($gzip_contents);
$gzip_crc = crc32($gzip_contents);
$gzip_contents = gzcompress($gzip_contents, 9);
$gzip_contents = substr($gzip_contents, 0, strlen($gzip_contents) - 4);
echo "\x1f\x8b\x08\x00\x00\x00\x00\x00";
echo $gzip_contents;
echo pack("V", $gzip_crc);
echo pack("V", $gzip_size);
}
?>