Merge branch 'develop' of https://github.com/getgrav/grav into develop

This commit is contained in:
Andy Miller
2016-09-01 12:54:47 -06:00
2 changed files with 7 additions and 1 deletions

View File

@@ -21,6 +21,7 @@ use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
use Grav\Common\Grav;
use Grav\Common\Config\Setup;
use Grav\Common\Filesystem\Folder;
$autoload = require_once(__DIR__ . '/../vendor/autoload.php');
@@ -37,6 +38,9 @@ if (!file_exists(ROOT_DIR . 'index.php')) {
exit('FATAL: Must be run from ROOT directory of Grav!');
}
// Set up environment.
Setup::$environment = 'localhost';
$grav = Grav::instance(array('loader' => $autoload));
$grav['config']->init();
$grav['streams'];

View File

@@ -17,6 +17,8 @@ use RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator;
class Setup extends Data
{
public static $environment;
protected $streams = [
'system' => [
'type' => 'ReadOnlyStream',
@@ -131,7 +133,7 @@ class Setup extends Data
*/
public function __construct($container)
{
$environment = $container['uri']->environment() ?: 'localhost';
$environment = static::$environment ?: ($container['uri']->environment() ?: 'localhost');
// Pre-load setup.php which contains our initial configuration.
// Configuration may contain dynamic parts, which is why we need to always load it.