-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.php
More file actions
26 lines (19 loc) · 760 Bytes
/
bootstrap.php
File metadata and controls
26 lines (19 loc) · 760 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
<?php
declare(strict_types=1);
require_once __DIR__ . '/vendor/autoload.php';
use Dotenv\Dotenv;
$dotenv = Dotenv::createImmutable(__DIR__);
$dotenv->load();
// Inicialização de timezone
date_default_timezone_set($_ENV['APP_TIMEZONE'] ?? 'UTC');
// Inicialização de conexões e dependências globais
use src\Database\PostgreSQL\Conexao as PostgresConexao;
use src\Repositories\UsuarioRepository;
use src\Services\UsuarioService;
use src\Http\Controllers\UsuarioController;
use src\Http\Controllers\IndexController;
$pdo = PostgresConexao::conectar();
$usuarioRepo = new UsuarioRepository($pdo);
$usuarioService = new UsuarioService($usuarioRepo);
$usuarioController = new UsuarioController($usuarioService);
$indexController = new IndexController();