Skip to content

Commit d98b22a

Browse files
committed
Install phpdotenv. Set environment variables
1 parent 775676c commit d98b22a

File tree

8 files changed

+303
-38
lines changed

8 files changed

+303
-38
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/vendor/
22
node_modules
33
.phpintel
4+
.env

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"require": {
2929
"philo/laravel-blade": "^3.1",
3030
"phpmailer/phpmailer": "^6.1",
31-
"paypal/rest-api-sdk-php": "^1.14"
31+
"paypal/rest-api-sdk-php": "^1.14",
32+
"vlucas/phpdotenv": "^5.2"
3233
}
3334
}

composer.lock

Lines changed: 280 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
* @author José Abraham Castillo
77
* @link https://github.com/crjoseabraham/shoppingcart
88
*/
9-
109
date_default_timezone_set('America/Caracas');
10+
session_start();
1111

1212
require dirname(__DIR__) . '/vendor/autoload.php';
1313

14-
session_start();
14+
$dotenv = Dotenv\Dotenv::createImmutable('../');
15+
$dotenv->load();
1516

1617
App\Core\Router::loadRoutes(dirname(__DIR__) . '/src/Config/routes.php')->redirect();

0 commit comments

Comments
 (0)