forked from Rehike/Rehike
-
Notifications
You must be signed in to change notification settings - Fork 0
/
router.php
105 lines (101 loc) · 3.35 KB
/
router.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?php
require($root . '/modules/routerBase.php');
if (isset($_GET["enable_polymer"]) && $_GET["enable_polymer"] == "1") {
include($root . "/simplefunnel.php");
die();
}
\Rehike\Debugger\Debugger::expose();
switch ($routerUrl->path[0]) {
/**
* General page definitions
*/
case '':
if ($yt->config->useWebV2HomeEndpoint) {
include('controllers/feed/what_to_watch_v2.php');
} else {
include('controllers/feed/what_to_watch.php');
}
break;
case 'results':
include('controllers/results_old.php');
break;
case 'feed':
if(isset($routerUrl->path[1])) {
switch ($routerUrl->path[1]) {
case 'trending':
include('controllers/feed/trending.php');
break;
case 'history':
include('controllers/feed/history.php');
break;
case 'guide_builder':
include('controllers/feed/guide_builder.php');
break;
default:
$template = 'error/404';
break;
}
} else {
$template = 'error/404';
}
break;
/**
* AJAX definitions
*/
case 'watch_fragments2_ajax':
include('controllers/ajax/watch_fragments2.php');
break;
case "comment_service_ajax":
include "controllers/ajax/comment_service.php";
break;
case "share_ajax":
include "controllers/ajax/share.php";
break;
case "browse_ajax":
include "controllers/ajax/browse.php";
break;
case "related_ajax":
include "controllers/ajax/related.php";
break;
/**
* Rehike special page definitions
*/
case "rehike":
switch ($routerUrl->path[1])
{
case "version":
(include "controllers/rehike/version.php")::get($yt, $template);
break;
case "static":
switch ($routerUrl->path[2])
{
case "logo.png":
header("Content-Type: image/png");
echo file_get_contents("static/version/logo.png");
exit();
break;
case "logo_small_grey.png":
header("Content-Type: image/png");
echo file_get_contents("static/version/logo_small_grey.png");
exit();
break;
case "branch_icon.png":
header("Content-Type: image/png");
echo file_get_contents("static/version/branch_icon.png");
exit();
break;
}
break;
}
break;
/**
* Test definitions
*/
case 'forcefatal':
$template = 'sdsadasds';
break;
default:
$template = 'error/404';
break;
}
require "temp_cv1_end.php";