-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.php
More file actions
31 lines (25 loc) · 834 Bytes
/
config.php
File metadata and controls
31 lines (25 loc) · 834 Bytes
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
<?php
require 'vendor/autoload.php';
$host = 'localhost';
$user = 'root';
$pass = 'root';
$database = 'sklad';
$charset = 'utf8mb4';
$dsn = "mysql:host=$host;dbname=$database;charset=$charset";
try {
$pdo = new PDO($dsn, $user, $pass);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
echo $e->getMessage();
throw new PDOException($e->getMessage());
}
use App\Controllers\SkladController;
use App\Controllers\UserController;
use App\Controllers\RoleController;
use App\Controllers\CategoryController;
use App\Controllers\ProductController;
$sklad = new SkladController($pdo);
$user = new UserController($pdo);
$role = new RoleController($pdo);
$category = new CategoryController($pdo);
$product = new ProductController($pdo);