Skip to content

Commit

Permalink
Allow the app path to be configured
Browse files Browse the repository at this point in the history
  • Loading branch information
rojtjo committed Jan 28, 2019
1 parent 8dfb2ec commit 39b40de
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/Illuminate/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ class Application extends Container implements ApplicationContract, HttpKernelIn
*/
protected $deferredServices = [];

/**
* The custom app path defined by the developer.
*
* @var string
*/
protected $path;

/**
* The custom database path defined by the developer.
*
Expand Down Expand Up @@ -295,7 +302,22 @@ protected function bindPathsInContainer()
*/
public function path($path = '')
{
return $this->basePath.DIRECTORY_SEPARATOR.'app'.($path ? DIRECTORY_SEPARATOR.$path : $path);
return ($this->path ?: $this->basePath.DIRECTORY_SEPARATOR.'app').($path ? DIRECTORY_SEPARATOR.$path : $path);
}

/**
* Set the app directory.
*
* @param string $path
* @return $this
*/
public function usePath($path)
{
$this->path = $path;

$this->instance('path', $path);

return $this;
}

/**
Expand Down

0 comments on commit 39b40de

Please sign in to comment.