-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.php
More file actions
69 lines (62 loc) · 1.91 KB
/
bootstrap.php
File metadata and controls
69 lines (62 loc) · 1.91 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
/**
* Bootstrap Loader
*
* 부트스트랩 로더
*
* @author ZerglingGo <zerglinggo@zerglinggo.net>
* @license http://opensource.org/licenses/MIT MIT License
*/
$bootstrap_dir = "/home/simpreative/public_html/WebSockChat/bootstrap/";
$version = isset($_GET["v"]) == true ? $_GET["v"] : false;
$filetype = isset($_GET["t"]) == true ? $_GET["t"] : false;
if($version && $filetype) {
$bootstrap_dir .= $version;
if(is_dir($bootstrap_dir)) {
if($filetype == "css") {
$cssfile = $bootstrap_dir."/css/bootstrap.min.css";
$cssthemefile = $bootstrap_dir."/css/bootstrap-theme.min.css";
header('Content-Type: text/css');
header('Content-Length: '.(filesize($cssfile) + filesize($cssthemefile)));
readfile($cssfile);
readfile($cssthemefile);
exit;
} elseif($filetype == "js") {
$jsfile = $bootstrap_dir."/js/bootstrap.min.js";
header('Content-Type: text/javascript');
header('Content-Length: '.filesize($jsfile));
readfile($jsfile);
exit;
} else {
header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
exit;
}
} else {
header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
exit;
}
} else {
if($filetype) {
$bootstrap_dir .= scandir($bootstrap_dir, 1)[0];
if($filetype == "css") {
$cssfile = $bootstrap_dir."/css/bootstrap.min.css";
$cssthemefile = $bootstrap_dir."/css/bootstrap-theme.min.css";
$data = file_get_contents($cssfile).file_get_contents($cssthemefile);
$tmp = array(".." => explode("public_html", $bootstrap_dir)[1]);
$data = strtr($data, $tmp);
header('Content-Type: text/css');
header('Content-Length: '.strlen($data));
echo $data;
exit;
} elseif($filetype == "js") {
$jsfile = $bootstrap_dir."/js/bootstrap.min.js";
header('Content-Type: text/javascript');
header('Content-Length: '.filesize($jsfile));
readfile($jsfile);
exit;
}
}
header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
exit;
}
?>