diff --git a/composer.json b/composer.json index 32d7465a..c78749ad 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ "php": ">=5.4.0", "netresearch/jsonmapper": "~0.5", "monolog/monolog": "~1.12", - "vlucas/phpdotenv" : "~2.0" + "vlucas/phpdotenv" : "~1.0" }, "require-dev": { "phpunit/phpunit": "~4.4" diff --git a/src/JiraClient.php b/src/JiraClient.php index e4264f09..143a3a9e 100644 --- a/src/JiraClient.php +++ b/src/JiraClient.php @@ -9,6 +9,8 @@ class JIRAException extends \Exception use Monolog\Logger as Logger; use Monolog\Handler\StreamHandler; +use Dotenv; + /** * interact jira server with REST API. */ @@ -82,10 +84,10 @@ protected function filterNullVariable($haystack) public function __construct() { - $dotenv = new \Dotenv\Dotenv('.'); - $dotenv->load(); + $dotenv = Dotenv::load('.'); - $dotenv->required(['JIRA_HOST', 'JIRA_USER', 'JIRA_PASS']); + // not available in dotenv 1.1 + // $dotenv->required(['JIRA_HOST', 'JIRA_USER', 'JIRA_PASS']); $this->json_mapper = new \JsonMapper(); $this->json_mapper->bExceptionOnUndefinedProperty = true;