-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.php
35 lines (28 loc) · 1.06 KB
/
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
33
34
35
<?php
require_once __DIR__.'/settings.php';
require_once __DIR__.'/vendor/autoload.php';
use Maradik\User\UserCurrent;
use Maradik\User\UserRepository;
use Maradik\Hinter\Core\RepositoryFactory;
use Maradik\Hinter\Core\Params;
$db = new PDO(
"{$database_s['driver']}:host={$database_s['host']};dbname={$database_s['database']};charset=UTF8",
$database_s['username'],
$database_s['password']
);
$user = new UserCurrent(new UserRepository($db, $table_s['user'], $database_s['prefix']), $general_s['enctryptsalt']);
$user->init();
$repositoryFactory = new RepositoryFactory(
$db,
$database_s['prefix'],
$table_s['category'],
$table_s['mainquestion'],
$table_s['mainanswer'],
$table_s['secondquestion'],
$table_s['secondanswer'],
$table_s['relationanswers'],
$table_s['param'],
$table_s['file'],
$general_s['upload_dir']
);
Params::setRepository($repositoryFactory->getParamRepository());