Implement .env configuration
This commit is contained in:
+5
-1
@@ -5,9 +5,13 @@ declare(strict_types=1);
|
||||
|
||||
require_once __DIR__ . '/src/VoipMsResponse.php';
|
||||
require_once __DIR__ . '/src/VoipMsClient.php';
|
||||
require_once __DIR__ . '/src/EnvLoader.php';
|
||||
|
||||
use VoipMs\EnvLoader;
|
||||
use VoipMs\VoipMsClient;
|
||||
|
||||
EnvLoader::load(__DIR__ . '/.env');
|
||||
|
||||
/**
|
||||
* @return array<string, array{category: string, description: string, params?: list<string>, examples?: list<string>}>
|
||||
*/
|
||||
@@ -624,7 +628,7 @@ function parseCdrArguments(array $args): array
|
||||
$params['date_to'] = $positionals[1];
|
||||
}
|
||||
|
||||
$envTimezone = getenv('VOIPMS_TIMEZONE');
|
||||
$envTimezone = getenv('VOIPMS_TIMEZONE') ?: getenv('DEFAULT_TIMEZONE');
|
||||
if (!isset($params['timezone']) && is_string($envTimezone) && $envTimezone !== '') {
|
||||
$params['timezone'] = $envTimezone;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user