-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.php
32 lines (26 loc) · 888 Bytes
/
init.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
<?php
session_start();
define('CACHE_DIR', basename(__DIR__ . DIRECTORY_SEPARATOR . 'cache'));
define('UPLOAD_PATH', basename(__DIR__ . DIRECTORY_SEPARATOR . 'uploads'));
$db = require_once 'db.php';
$link = mysqli_connect($db['host'], $db['user'], $db['password'], $db['database']);
if ($link) {
mysqli_set_charset($link, "utf8");
$content = '';
} else {
http_response_code(500);
$error = 'Не удалось подключиться к базе данных';
$content = include_template('error.php', ['error' => $error]);
$layout_content = include_template('layout.php', [
'content' => $content,
'title' => 'Дела в порядке',
'current_user_name' => '',
'is_auth' => 0
]);
print($layout_content);
exit();
}
$projects = [];
$tasks = [];
define('SECONDS_IN_DAY', 86400);
define('MAXIMUM_LENGTH', 255);