-
Notifications
You must be signed in to change notification settings - Fork 170
/
public-routes.php
45 lines (36 loc) · 1.2 KB
/
public-routes.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
<?php
use OpCacheGUI\Network\Router;
$router->get('mainjs', function() {
header('Content-Type: application/javascript');
readfile(__DIR__ . '/public/js/main.js');
exit;
});
$router->get('maincss', function() use ($uriScheme) {
header('Content-Type: text/css');
$prefix = '?';
if ($uriScheme === Router::URL_REWRITE) {
$prefix = '/';
}
echo str_replace('{urltype}', $prefix, file_get_contents(__DIR__ . '/public/style/main.css'));
exit;
});
$router->get('fontawesome-webfont_eot', function() {
header('Content-Type: application/vnd.ms-fontobject');
readfile(__DIR__ . '/public/style/fonts/fontawesome-webfont.eot');
exit;
});
$router->get('fontawesome-webfont_woff', function() {
header('Content-Type: font/x-woff');
readfile(__DIR__ . '/public/style/fonts/fontawesome-webfont.woff');
exit;
});
$router->get('fontawesome-webfont_ttf', function() {
header('Content-Type: font/ttf');
readfile(__DIR__ . '/public/style/fonts/fontawesome-webfont.ttf');
exit;
});
$router->get('fontawesome-webfont_svg', function() {
header('Content-Type: image/svg+xml');
readfile(__DIR__ . '/public/style/fonts/fontawesome-webfont.svg');
exit;
});