]>
jfr.im git - uguu.git/blob - static/php/classes/Core.php
5 * @copyright Copyright (c) 2022 Go Johansson (nekunekus) <neku@pomf.se> <github.com/nokonoko>
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
24 * @property mixed $DB_CONN
40 public $FILES_RETRIES;
47 public $BLOCKED_EXTENSIONS;
51 public function __constructSettings()
53 $settings_array = json_decode(file_get_contents('/Users/go.johansson/PERSONAL_REPOS/Uguu/dist.json'), true);
54 $this->DB_MODE
= $settings_array['DB_MODE'];
55 $this->DB_PATH
= $settings_array['DB_PATH'];
56 $this->DB_USER
= $settings_array['DB_USER'];
57 $this->DB_PASS
= $settings_array['DB_PASS'];
58 $this->LOG_IP
= $settings_array['LOG_IP'];
59 $this->ANTI_DUPE
= $settings_array['ANTI_DUPE'];
60 $this->BLACKLIST_DB
= $settings_array['BLACKLIST_DB'];
61 $this->FILTER_MODE
= $settings_array['FILTER_MODE'];
62 $this->FILES_ROOT
= $settings_array['FILES_ROOT'];
63 $this->FILES_RETRIES
= $settings_array['FILES_RETRIES'];
64 $this->SSL
= $settings_array['SSL'];
65 $this->URL
= $settings_array['URL'];
66 $this->NAME_LENGTH
= $settings_array['NAME_LENGTH'];
67 $this->ID_CHARSET
= $settings_array['ID_CHARSET'];
68 $this->BLOCKED_EXTENSIONS
= $settings_array['BLOCKED_EXTENSIONS'];
69 $this->BLOCKED_MIME
= $settings_array['BLOCKED_MIME'];
70 $this->DOUBLE_DOTS
= $settings_array['DOUBLE_DOTS'];
74 class Database
extends Settings
78 public function __constructDB()
80 $this->DB
= new PDO($this->DB_MODE
.':'.$this->DB_PATH
, $this->DB_USER
, $this->DB_PASS
);