Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
"require": {
"php": ">=5.3.2"
},
"require-dev": {
"phpunit/phpunit": "*"
},
"autoload": {
"psr-0": {
"Dotenv": "src/"
Expand Down
2 changes: 1 addition & 1 deletion src/Dotenv.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static function load($path, $file = '.env')
putenv($line);

// Set PHP superglobals
list($key, $val) = explode('=', $line);
list($key, $val) = explode('=', $line, 2);
$_ENV[$key] = $val;
$_SERVER[$key] = $val;
}
Expand Down
1 change: 1 addition & 0 deletions tests/Dotenv/Dotenv.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public function testQuotedDotenvLoadsEnvironmentVars()
$this->assertEquals('baz', getenv('QBAR'));
$this->assertEquals('with spaces', getenv('QSPACED'));
$this->assertEquals('', getenv('QNULL'));
$this->assertEquals('pgsql:host=localhost;dbname=test', getenv('QEQUALS'));
}

public function testExportedDotenvLoadsEnvironmentVars()
Expand Down
1 change: 1 addition & 0 deletions tests/fixtures/quoted.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
QFOO='bar'
QBAR='baz'
QSPACED='with spaces'
QEQUALS='pgsql:host=localhost;dbname=test'

QNULL=''