update v1.0.7.9 R.C.

This is a Release Candidate. We are still testing.
This commit is contained in:
Sujit Prasad
2016-08-03 20:04:36 +05:30
parent 8b6b924d09
commit ffa56a43cb
3830 changed files with 181529 additions and 495353 deletions

View File

@@ -23,7 +23,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "2.2-dev"
"dev-master": "2.3-dev"
}
}
}

View File

@@ -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
*

View File

@@ -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;