Support a .env file, include a .env.example

This commit is contained in:
Jon Goldberg 2018-01-03 04:23:49 -05:00
parent ecf6161040
commit b2c061b842
3 changed files with 10 additions and 1 deletions

3
.env.example Normal file
View File

@ -0,0 +1,3 @@
REDMINE_URL="https://hq.example.com"
REDMINE_API_KEY="abc123"
DEBUG_MODE=FALSE

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
/vendor/
/data/*.csv
.env

View File

@ -2,7 +2,12 @@
<?php
require_once 'vendor/autoload.php';
$client = new Redmine\Client('https://hq.megaphonetech.com', '965fddd60cfb5690d15542944998058224d7289f');
// Load the .env file
$dotenv = new Dotenv\Dotenv(__DIR__);
$dotenv->load();
$client = new Redmine\Client(getenv('REDMINE_URL'), getenv('REDMINE_API_KEY'));
$client->setCheckSslCertificate(true);
$limit = 100;