-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.php
More file actions
77 lines (63 loc) · 2.53 KB
/
config.php
File metadata and controls
77 lines (63 loc) · 2.53 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
70
71
72
73
74
75
76
77
<?php
/*
* Copyright (C) 2015 Diego Rodríguez Suárez-Bustillo
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
$config = array();
$config['db_server'] = 'localhost';
$config['db_user'] = 'root';
$config['db_pass'] = '';
$config['db_charset'] = 'utf8';
$config['db_name'] = 'isthisgamefun';
$config['db_config'] = array(
'database_type' => 'mysql',
'database_name' => $config['db_name'],
'server' => 'localhost',
'username' => $config['db_user'],
'password' => $config['db_pass'],
'charset' => $config['db_charset']
);
$config['t_users'] = 'users';
$config['t_games'] = 'games';
$config['t_user_votes'] = 'user_votes';
$config['t_platforms'] = 'platforms';
$config['t_game_platform'] = 'game_platform';
$config['t_sagas'] = 'sagas';
$config['t_game_saga'] = 'game_saga';
$config['t_saga_votes'] = 'saga_votes';
$config['t_full_users'] = $config['db_name'] . '.' . $config['t_users'];
$config['t_full_games'] = $config['db_name'] . '.' . $config['t_games'];
$config['t_full_user_votes'] = $config['db_name'] . '.' . $config['t_user_votes'];
$config['t_full_platforms'] = $config['db_name'] . '.' . $config['t_platforms'];
$config['t_full_game_platform'] = $config['db_name'] . '.' . $config['t_game_platform'];
$config['server_root'] = '/IsThisGameFun/';
$config['allow_cookies'] = 'cookie_compliance';
$config['salt'] = "curlybrace";
//Turn it false in release mode
error_reporting(E_ALL);
//Alternative mode
//ini_set( "display_errors", 0);
register_shutdown_function('CatchFatalError');
function CatchFatalError() {
global $config;
$error = error_get_last();
if ($error['type']) {
// handle the error - but DO NOT THROW ANY EXCEPTION HERE.
$log = "Type: {$error['type']}; Message: {$error['message']}; File: {$error['file']}; Line: {$error['line']}";
header("Location: {$config['server_root']}error");
file_put_contents('logs/log_' . date("j.n.Y") . '.txt', $log, FILE_APPEND);
}
die;
}