-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmigrations.php
More file actions
39 lines (23 loc) · 874 Bytes
/
migrations.php
File metadata and controls
39 lines (23 loc) · 874 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
32
33
34
35
36
37
38
39
<?php
//to use the application class that exist in the app\core\application
use app\core\Application;
//to use the siteController class that exist in the app\core\application
use app\controllers\siteController;
//to use the AuthController class that exist in the app\core\application
use app\controllers\AuthController;
use app\core\Database;
/*every thing in under namespace app will be inculded auto*/
require_once __DIR__.'/vendor/autoload.php';
//to load the configration from env file
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
$dotenv->load();
$config =[
'db'=>[
'dsn' => $_ENV['DB_DSN'],
'user' => $_ENV['DB_USER'],
'password' => $_ENV['DB_PASSWORD'],
]
];
/* Create an instance of Application Class to run the website */
$app = new Application(__DIR__,$config);
$app->db->applyMigrations();