]> jfr.im git - uguu.git/blob - src/static/php/grill.php
d193949355f18f231a358b61aabe74df83c8dc05
[uguu.git] / src / static / php / grill.php
1 <?php
2
3 function checkConfig()
4 {
5 if (!file_exists(__DIR__ . '../config.json')) {
6 throw new Exception('Cant read settings file.', 500);
7 }
8 try {
9 $settings = json_decode(
10 file_get_contents(__DIR__ . '../config.json'),
11 true,
12 );
13 if ($settings['PHP_ERRORS']) {
14 error_reporting(E_ALL);
15 ini_set('display_errors', 1);
16 }
17 }
18 catch (Exception) {
19 throw new Exception('Cant populate settings.', 500);
20 }
21 }
22
23 checkConfig();
24 /**
25 * Uguu
26 *
27 * @copyright Copyright (c) 2022 Go Johansson (nokonoko) <neku@pomf.se>
28 *
29 * This program is free software: you can redistribute it and/or modify
30 * it under the terms of the GNU General Public License as published by
31 * the Free Software Foundation, either version 3 of the License, or
32 * (at your option) any later version.
33 *
34 * This program is distributed in the hope that it will be useful,
35 * but WITHOUT ANY WARRANTY; without even the implied warranty of
36 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
37 * GNU General Public License for more details.
38 *
39 * You should have received a copy of the GNU General Public License
40 * along with this program. If not, see <https://www.gnu.org/licenses/>.
41 */
42 require_once __DIR__ . '/../vendor/autoload.php';
43
44 use Pomf\Uguu\GrillLoader;
45
46 new GrillLoader();