This repository has been archived by the owner on Dec 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.php
50 lines (40 loc) · 2.23 KB
/
config.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
<?php
//namespace Smalex86\VkInviter;
## Главный конфигурационный файл
error_reporting(E_ALL);
if (!defined("PATH_SEPARATOR")) {
define("PATH_SEPARATOR", getenv("COMSPEC")? ";" : ":");
}
if (!defined("DIRECTORY_SEPARATOR")) {
define("DIRECTORY_SEPARATOR ", "/");
}
ini_set("include_path", ini_get("include_path").PATH_SEPARATOR.dirname(__FILE__)); // корневая папка
ini_set("include_path", ini_get("include_path").PATH_SEPARATOR.dirname(__FILE__).'/src'); // папка с классами
ini_set("include_path", ini_get("include_path").PATH_SEPARATOR.dirname(__FILE__).'/src/include'); // папка include
ini_set("session.use_trans_sid", true); // поддержка использования SID (идентификатора сессии)
ini_set('display_errors', 'On'); // показывать ошибки - на готовом продукте убрать
date_default_timezone_set('Asia/Krasnoyarsk'); // установка временной зоны для скриптов
// настройки сайта
define("ST_NAME", 'VkInviter'); // название сайта
// подключение файла с секретными настройками
$secretFileName = __DIR__ . '/secret.php';
if (file_exists($secretFileName)) {
include_once 'secret.php';
}
// проверка существования переменной $secret
if (!isset($secret)) {
die('Не найдены секретные настройки.');
}
// константы для подключения к бд
define("DB_HOST", $secret['db']['host']);
define("DB_USERNAME", $secret['db']['username']);
define("DB_PASSWD", $secret['db']['password']);
define("DB_NAME", $secret['db']['name']);
define("DB_PREFIX", $secret['db']['prefix']);
// константы вк
define("VK_CLIENT_ID", $secret['vk']['clientId']); // идентификатор пользователя
define("VK_REDIRECT_URI", $secret['vk']['redirectUri']); // uri для редиректа
define("VK_SCOPE", $secret['vk']['scope']); // права доступа
define("VK_CLIENT_SECRET", $secret['vk']['clientSecret']); // секретный ключ приложения
// удаляем секретную инфу из памяти
unset($secret);