-
Notifications
You must be signed in to change notification settings - Fork 17
/
index.php
217 lines (201 loc) · 8.72 KB
/
index.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<?php
/*
RPCS3.net Compatibility List (https://github.com/AniLeo/rpcs3-compatibility)
Copyright (C) 2017 AniLeo
https://github.com/AniLeo or [email protected]
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
if (!@include_once("functions.php")) throw new Exception("Compat: functions.php is missing. Failed to include functions.php");
if (!@include_once("objects/Profiler.php")) throw new Exception("Compat: objects/Profiler.php is missing. Failed to include objects/Profiler.php");
// Check if we're running PHP 8.2 or above
if (phpversion()[0] < 8 || ((int) phpversion()[0] === 8 && phpversion()[2] < 2))
{
trigger_error("[COMPAT] Initialization: Incompatible PHP version. This application requires PHP 8.2+", E_USER_ERROR);
}
// Parses the GET data before any other code
$get = validateGet();
// Non-HTML requests: These need to be displayed before any HTML code is loaded or the syntax is broken.
// RSS Feed Request
if (isset($get['rss']))
{
if (isset($get['b']))
{
if (!@include_once("includes/inc.builds.php")) throw new Exception("Compat: inc.builds.php is missing. Failed to include inc.builds.php");
header('Content-Type: text/xml');
$Builds = new Builds();
echo $Builds->getBuildsRSS();
// No need to load the rest of the page.
exit();
}
elseif (isset($get['h']) && isset($get['m']) && ($get['m'] === 'c' || $get['m'] === 'n'))
{
if (!@include_once("includes/inc.history.php")) throw new Exception("Compat: inc.history.php is missing. Failed to include inc.history.php");
header('Content-Type: text/xml');
$History = new History();
$History->printHistoryRSS();
// No need to load the rest of the page.
exit();
}
}
// JSON API Request
if (isset($get['api']))
{
// API: v1
if ($get['api'] === "v1")
{
if (isset($_GET['export']))
{
if (!@include_once('export.php')) throw new Exception("Compat: export.php is missing. Failed to include export.php");
$results = exportDatabase();
}
elseif (isset($_GET['patch']))
{
if (!@include_once('patch.php')) throw new Exception("Compat: patch.php is missing. Failed to include patch.php");
$results = exportGamePatches();
}
else
{
if (!@include_once("includes/inc.compat.php")) throw new Exception("Compat: inc.compat.php is missing. Failed to include inc.compat.php");
$Compat = new Compat();
$results = $Compat->APIv1();
}
header('Content-Type: application/json');
echo json_encode($results, JSON_PRETTY_PRINT);
}
// No need to load the rest of the page.
exit();
}
/**
RPCS3.net Compatibility List by AniLeo
https://github.com/AniLeo
2017.01.22
**/
$start_time = microtime(true);
Profiler::add_data("Index: Start");
?>
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>
<?php
if (isset($get['h'])) { echo "RPCS3 - Compatibility History"; }
elseif (isset($get['b'])) { echo "RPCS3 - Builds History"; }
elseif (isset($get['a'])) { echo "RPCS3 - Debug Panel"; }
else { echo "RPCS3 - Compatibility List"; }
?>
</title>
<meta charset=UTF-8>
<?php
if (isset($get['h'])) { echo "<meta property=\"og:title\" content=\"RPCS3 - Compatibility History\" />"; }
elseif (isset($get['b'])) { echo "<meta property=\"og:title\" content=\"RPCS3 - Builds History\" />"; }
elseif (isset($get['a'])) { echo "<meta property=\"og:title\" content=\"RPCS3 - Debug Panel\" />"; }
else { echo "<meta property=\"og:title\" content=\"RPCS3 - Compatibility List\" />"; }
?>
<?php
if (isset($get['h'])) { echo "<meta property=\"og:description\" content=\"You're now watching the updates that altered a game's status for RPCS3's Compatibility List for the current month.\" />"; }
elseif (isset($get['b'])) { echo "<meta property=\"og:description\" content=\"This is the history of all RPCS3 master builds made per pull request after AppVeyor artifacts were firstly added to the project. Hovering over the build number displays the SHA-256 checksum and the build size.\" />"; }
elseif (isset($get['a'])) { echo "<meta property=\"og:description\" content=\"Very cool debug panel.\" />"; }
else { echo "<meta property=\"og:description\" content=\"These are the current compatible games that have been tested with the emulator. This list is subject to change frequently. Be sure to check this page often to follow the latest updates.\" />"; }
?>
<meta name="description" content="RPCS3 is a multi-platform open-source Sony PlayStation 3 emulator and debugger written in C++ for Windows, Linux, macOS and FreeBSD made possible with the power of reverse engineering.">
<meta name="keywords" content="rpcs3, playstation, playstation 3, ps3, emulator, debugger, windows, linux, macos, freebsd, open source, nekotekina, kd11, compatibility">
<meta property="og:image" content="https://rpcs3.net/img/meta/mobile/1200.png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:url" content="https://rpcs3.net" />
<meta property="og:locale" content="en_US"/>
<meta property="og:type" content="website" />
<meta property="og:site_name" content="RPCS3" />
<meta name="twitter:description" content="RPCS3 is a multi-platform open-source Sony PlayStation 3 emulator and debugger written in C++ for Windows, Linux, macOS and FreeBSD made possible with the power of reverse engineering.">
<meta name="twitter:image" content="https://rpcs3.net/img/meta/mobile/1200.png">
<meta name="twitter:site" content="@rpcs3">
<meta name="twitter:creator" content="@rpcs3">
<meta name="twitter:card" content="summary_large_image">
<?php
if (!@include(__DIR__.'/../../lib/module/sys-meta.php'))
trigger_error("[COMPAT] Integration: sys-meta not found", E_USER_WARNING);
if (!@include(__DIR__.'/../../lib/module/sys-css.php'))
{
trigger_error("[COMPAT] Integration: sys-css not found", E_USER_WARNING);
echo "<link rel=\"stylesheet\" href=\"compat.css\"/>";
}
else
{
echo "<link rel=\"stylesheet\" href=\"/lib/compat/compat.css\"/>";
}
if (!@include(__DIR__.'/../../lib/module/sys-js.php'))
trigger_error("[COMPAT] Integration: sys-js not found", E_USER_WARNING);
?>
</head>
<body>
<?php if (!@include(__DIR__.'/../../lib/module/sys-php.php'))
trigger_error("[COMPAT] Integration: sys-php not found", E_USER_WARNING); ?>
<div class="page-con-content">
<div class="banner-con-container darkmode-header">
<div id="object-particles">
</div>
<div class="wavebar-con-container">
<div class="wavebar-con-wrap">
<div class="wavebar-svg-object">
</div>
<div class="wavebar-svg-object">
</div>
</div>
</div>
<div class='banner-con-title fade-up-onstart'>
<div class='banner-tx1-title fade-up-onstart pulsate'>
<h1>
<?php
if (isset($get['h'])) { echo "History"; }
elseif (isset($get['b'])) { echo "Builds"; }
elseif (isset($get['a'])) { echo "Debug Panel"; }
else { echo "Compatibility"; }
?>
</h1>
</div>
<div class="banner-con-divider">
</div>
<div class='banner-tx2-title fade-up-onstart'>
<p>
<?php
if ((isset($c_maintenance) && !$c_maintenance) || $get['w'] != NULL) {
if (isset($get['h'])) { echo "History of the updates made to the compatibility list"; }
elseif (isset($get['b'])) { echo "History of RPCS3 builds per merged pull request"; }
elseif (isset($get['a'])) { echo "Super cool compatibility list debug control panel"; }
else
{
Profiler::add_data("Index: Count Games");
echo "There are currently ".count_game_entry_all()." games with ".count_game_id_all()." IDs listed in our database";
}
} else {
echo "Compatibility is undergoing maintenance. Please try again in a few minutes.";
}
?>
</p>
</div>
</div>
</div>
<?php
if ((isset($c_maintenance) && !$c_maintenance) || $get['w'] != NULL)
{
if (isset($get['h'])) { include 'pages/history.php'; }
elseif (isset($get['b'])) { include 'pages/builds.php'; }
elseif (isset($get['a'])) { include 'pages/panel.php'; }
else { include 'pages/compat.php'; }
}
?>
</div>
<?php if (!@include(__DIR__.'/../../lib/module/inc-footer.php'))
trigger_error("[COMPAT] Integration: inc-footer not found", E_USER_WARNING); ?>
</body>
</html>