forked from GNUsocial/gnu-social
[DEFAULTS] Small fixes and add check of SOCIAL_NO_RELOAD_DEFAULTS from the environment, to override the reloading of default values
This commit is contained in:
parent
26c966084a
commit
6c0c84c284
3
DOCUMENTATION/DEVELOPERS/defaults.md
Normal file
3
DOCUMENTATION/DEVELOPERS/defaults.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
In the `dev` environment, the default values for the config table are reloaded on each HTTP request
|
||||||
|
|
||||||
|
In case you want to override this, add `SOCIAL_NO_RELOAD_DEFAULTS=1` to your .env.local file
|
@ -274,7 +274,7 @@ abstract class DefaultSettings
|
|||||||
'login_command' => ['enabled' => false],
|
'login_command' => ['enabled' => false],
|
||||||
];
|
];
|
||||||
|
|
||||||
self::loadDefaults(!$_ENV['APP_DEBUG']);
|
self::loadDefaults($_ENV['APP_ENV'] == 'prod');
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function loadDefaults(bool $optimize = false)
|
public static function loadDefaults(bool $optimize = false)
|
||||||
@ -283,9 +283,9 @@ abstract class DefaultSettings
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// In debug mode, delete everything and reinsert, in case
|
// In dev mode, delete everything and reinsert, in case
|
||||||
// defaults changed
|
// defaults changed
|
||||||
if ($_ENV['APP_DEBUG']) {
|
if ($_ENV['APP_ENV'] === 'dev' && !isset($_ENV['SOCIAL_NO_RELOAD_DEFAULTS'])) {
|
||||||
DB::getConnection()->executeQuery('delete from config;');
|
DB::getConnection()->executeQuery('delete from config;');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user