diff --git a/src/Foundation/AbstractServer.php b/src/Foundation/AbstractServer.php index 66ef7e4bf..091166eb6 100644 --- a/src/Foundation/AbstractServer.php +++ b/src/Foundation/AbstractServer.php @@ -32,13 +32,19 @@ abstract class AbstractServer */ protected $publicPath; + /** + * @var string + */ + protected $storagePath; + /** * @var array */ protected $config; /** - * @param string $path + * @param null $basePath + * @param null $publicPath */ public function __construct($basePath = null, $publicPath = null) { @@ -77,7 +83,15 @@ abstract class AbstractServer } /** - * @param string $base_path + * @return string + */ + public function getStoragePath() + { + return $this->storagePath; + } + + /** + * @param $basePath */ public function setBasePath($basePath) { @@ -85,13 +99,21 @@ abstract class AbstractServer } /** - * @param string $public_path + * @param $publicPath */ public function setPublicPath($publicPath) { $this->publicPath = $publicPath; } + /** + * @param $storagePath + */ + public function setStoragePath($storagePath) + { + $this->storagePath = $storagePath; + } + /** * @return array */ @@ -117,6 +139,10 @@ abstract class AbstractServer $app = new Application($this->basePath, $this->publicPath); + if ($this->storagePath) { + $app->useStoragePath($this->storagePath); + } + $app->instance('env', 'production'); $app->instance('flarum.config', $this->config); $app->instance('config', $config = $this->getIlluminateConfig($app)); diff --git a/src/Foundation/Application.php b/src/Foundation/Application.php index 797ada8eb..6ecaf1be9 100644 --- a/src/Foundation/Application.php +++ b/src/Foundation/Application.php @@ -93,6 +93,7 @@ class Application extends Container implements ApplicationContract * Create a new Flarum application instance. * * @param string|null $basePath + * @param string|null $publicPath */ public function __construct($basePath = null, $publicPath = null) { @@ -214,7 +215,6 @@ class Application extends Container implements ApplicationContract * Set the base path for the application. * * @param string $basePath - * @param string $publicPath * @return $this */ public function setBasePath($basePath) @@ -229,7 +229,6 @@ class Application extends Container implements ApplicationContract /** * Set the public path for the application. * - * @param string $basePath * @param string $publicPath * @return $this */