mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-10 12:14:26 +02:00
Add the possibility to use a different configuration directory
This commit is contained in:
parent
c40b3411a7
commit
5702944116
12 changed files with 75 additions and 19 deletions
|
@ -35,6 +35,13 @@ use Friendica\Core\Config\Cache;
|
|||
*/
|
||||
class ConfigFileLoader
|
||||
{
|
||||
/**
|
||||
* The key of the $_SERVER variable to override the config directory
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const CONFIG_DIR_ENV = 'FRIENDICA_CONFIG_DIR';
|
||||
|
||||
/**
|
||||
* The Sub directory of the config-files
|
||||
*
|
||||
|
@ -83,10 +90,14 @@ class ConfigFileLoader
|
|||
*/
|
||||
private $staticDir;
|
||||
|
||||
public function __construct(string $basePath)
|
||||
public function __construct(string $basePath, array $server)
|
||||
{
|
||||
$this->baseDir = $basePath;
|
||||
$this->configDir = $this->baseDir . DIRECTORY_SEPARATOR . self::CONFIG_DIR;
|
||||
$this->baseDir = $basePath;
|
||||
if (!empty($server[self::CONFIG_DIR_ENV]) && is_dir($server[self::CONFIG_DIR_ENV])) {
|
||||
$this->configDir = $server[self::CONFIG_DIR_ENV];
|
||||
} else {
|
||||
$this->configDir = $this->baseDir . DIRECTORY_SEPARATOR . self::CONFIG_DIR;
|
||||
}
|
||||
$this->staticDir = $this->baseDir . DIRECTORY_SEPARATOR . self::STATIC_DIR;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue