update v1.0.7.9 R.C.
This is a Release Candidate. We are still testing.
This commit is contained in:
2
vendor/vlucas/phpdotenv/composer.json
vendored
2
vendor/vlucas/phpdotenv/composer.json
vendored
@@ -23,7 +23,7 @@
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.2-dev"
|
||||
"dev-master": "2.3-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
28
vendor/vlucas/phpdotenv/src/Dotenv.php
vendored
28
vendor/vlucas/phpdotenv/src/Dotenv.php
vendored
@@ -39,27 +39,23 @@ class Dotenv
|
||||
}
|
||||
|
||||
/**
|
||||
* Load `.env` file in given directory.
|
||||
* Load environment file in given directory.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function load()
|
||||
{
|
||||
$this->loader = new Loader($this->filePath, true);
|
||||
|
||||
return $this->loader->load();
|
||||
return $this->loadData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load `.env` file in given directory.
|
||||
* Load environment file in given directory.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function overload()
|
||||
{
|
||||
$this->loader = new Loader($this->filePath, false);
|
||||
|
||||
return $this->loader->load();
|
||||
return $this->loadData(true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -82,7 +78,21 @@ class Dotenv
|
||||
}
|
||||
|
||||
/**
|
||||
* Required ensures that the specified variables exist, and returns a new Validator object.
|
||||
* Actually load the data.
|
||||
*
|
||||
* @param bool $overload
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function loadData($overload = false)
|
||||
{
|
||||
$this->loader = new Loader($this->filePath, !$overload);
|
||||
|
||||
return $this->loader->load();
|
||||
}
|
||||
|
||||
/**
|
||||
* Required ensures that the specified variables exist, and returns a new validator object.
|
||||
*
|
||||
* @param string|string[] $variable
|
||||
*
|
||||
|
14
vendor/vlucas/phpdotenv/src/Loader.php
vendored
14
vendor/vlucas/phpdotenv/src/Loader.php
vendored
@@ -147,7 +147,7 @@ class Loader
|
||||
*/
|
||||
protected function isComment($line)
|
||||
{
|
||||
return strpos(trim($line), '#') === 0;
|
||||
return strpos(ltrim($line), '#') === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -235,8 +235,8 @@ class Loader
|
||||
/**
|
||||
* Resolve the nested variables.
|
||||
*
|
||||
* Look for {$varname} patterns in the variable value and replace with an existing
|
||||
* environment variable.
|
||||
* Look for {$varname} patterns in the variable value and replace with an
|
||||
* existing environment variable.
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
@@ -295,7 +295,7 @@ class Loader
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getEnvironmentVariable($name)
|
||||
{
|
||||
@@ -335,6 +335,12 @@ class Loader
|
||||
return;
|
||||
}
|
||||
|
||||
// If PHP is running as an Apache module and an existing
|
||||
// Apache environment variable exists, overwrite it
|
||||
if (function_exists('apache_getenv') && function_exists('apache_setenv') && apache_getenv($name)) {
|
||||
apache_setenv($name, $value);
|
||||
}
|
||||
|
||||
putenv("$name=$value");
|
||||
|
||||
$_ENV[$name] = $value;
|
||||
|
Reference in New Issue
Block a user