mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 07:38:08 +08:00
Allow setting storage path, clean up docblocks
This commit is contained in:
parent
777579e146
commit
7bd3fa82b1
@ -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));
|
||||
|
@ -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
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user