Skip to content

Commit

Permalink
Find/replace the LoadConfiguration class #163
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeelio committed Mar 14, 2018
1 parent 6975167 commit 7148f27
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions bootstrap/application.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
class Application extends Illuminate\Foundation\Application
{
private $publicDirPath,
$publicUrlPath = '/';
$publicUrlPath = '/';

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');
}

/**
Expand All @@ -32,11 +32,18 @@ public function __construct(string $basePath = null)
*/
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);
}

/**
Expand Down Expand Up @@ -94,7 +101,7 @@ public function publicUrlPath()

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()
Expand All @@ -104,16 +111,16 @@ public function environmentPath()

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);
}
}

0 comments on commit 7148f27

Please sign in to comment.