Find/replace the LoadConfiguration class #163

This commit is contained in:
Nabeel Shahzad 2018-03-14 09:46:02 -05:00
parent 6975167a77
commit 7148f27d33

View File

@ -17,11 +17,11 @@ class Application extends Illuminate\Foundation\Application
public function __construct(string $basePath = null)
{
parent::__construct(dirname(__DIR__) . '/');
parent::__construct(dirname(__DIR__).'/');
$this->loadEnvironmentFrom('env.php');
$this->useDatabasePath($this->basePath . '/app/Database');
$this->useStoragePath($this->basePath . '/storage');
$this->useDatabasePath($this->basePath.'/app/Database');
$this->useStoragePath($this->basePath.'/storage');
}
/**
@ -32,11 +32,18 @@ class Application extends Illuminate\Foundation\Application
*/
public function bootstrapWith(array $bootstrappers)
{
#$find = '\Illuminate\Foundation\Bootstrap\LoadConfiguration';
$find = \Illuminate\Foundation\Bootstrap\LoadConfiguration::class;
$replace = LoadConfiguration::class;
$bootstrappers[1] = $replace;
parent::bootstrapWith($bootstrappers); // TODO: Change the autogenerated stub
$bootstrappers = array_replace(
$bootstrappers,
array_fill_keys(
array_keys($bootstrappers, $find),
$replace
)
);
parent::bootstrapWith($bootstrappers);
}
/**
@ -94,7 +101,7 @@ class Application extends Illuminate\Foundation\Application
public function configPath($path = '')
{
return $this->basePath . DS . 'config' . ($path ? DS . $path : $path);
return $this->basePath.DS.'config'.($path ? DS.$path : $path);
}
public function environmentPath()
@ -104,16 +111,16 @@ class Application extends Illuminate\Foundation\Application
public function langPath()
{
return $this->resourcePath() . DS . 'lang';
return $this->resourcePath().DS.'lang';
}
public function publicPath()
{
return $this->publicDirPath ?: $this->basePath . DS . 'public';
return $this->publicDirPath ?: $this->basePath.DS.'public';
}
public function resourcePath($path = '')
{
return $this->basePath . DS . 'resources' . ($path ? DS . $path : $path);
return $this->basePath.DS.'resources'.($path ? DS.$path : $path);
}
}