Modify redirect.php to use .env variables

This commit is contained in:
2018-01-18 01:10:37 -05:00
parent 0efa00ff68
commit 90d4ba62d0
2 changed files with 21 additions and 8 deletions

View File

@ -1,10 +1,17 @@
#!/usr/bin/php
<?php
require_once 'vendor/autoload.php';
// Load the .env file
$dotenv = new Dotenv\Dotenv(__DIR__);
$dotenv->load();
// Debug Mode will show more information.
$debugMode = TRUE;
$debugMode = getenv('DEBUG_MODE');
// Dry Run Mode will suppress sending an e-mail to Redmine. Only really useful with debug mode on.
$dryRun = FALSE;
$dryRun = getenv('DRY_RUN');
if($debugMode) {
error_reporting(E_ALL);
@ -13,11 +20,11 @@ if($debugMode) {
// initialize.
$deliveredTo = $from = $project = $email = $subject = NULL;
$params = array(
'url' => 'https://hq.megaphonetech.com',
'key' => '4kaq0ZLsWDndWEKN8O3D',
'url' => getenv('REDMINE_URL'),
'key' => getenv('KEY'),
'unknown-user' => 'create',
'allow-override' => 'all',
'project' => 'catch',
'project' => getenv('CATCHALL_PROJECT_NAME'),
'tracker' => 'general',
);