Introduce project path constants for cleaner initialization
This commit is contained in:
parent
d3ba8eedfe
commit
d80970c452
|
|
@ -2,11 +2,14 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
require_once __DIR__ . '/../vendor/autoload.php';
|
define('PROJECT_ROOT', dirname(__DIR__));
|
||||||
|
define('CONFIG_DIRECTORY', PROJECT_ROOT . '/config/');
|
||||||
|
|
||||||
|
require_once PROJECT_ROOT . '/vendor/autoload.php';
|
||||||
|
|
||||||
use Dotenv\Dotenv;
|
use Dotenv\Dotenv;
|
||||||
|
|
||||||
$dotenv = Dotenv::createImmutable(__DIR__ . '/../config', 'PHPStarter.env');
|
$dotenv = Dotenv::createImmutable(CONFIG_DIRECTORY, 'PHPStarter.env');
|
||||||
$dotenv->load();
|
$dotenv->load();
|
||||||
|
|
||||||
use PHPStarter\DB;
|
use PHPStarter\DB;
|
||||||
|
|
|
||||||
|
|
@ -2,4 +2,6 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
require __DIR__ . '/../vendor/autoload.php';
|
define('PROJECT_ROOT', dirname(__DIR__));
|
||||||
|
|
||||||
|
require_once PROJECT_ROOT . '/vendor/autoload.php';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue