mirror of
https://we.phorge.it/source/phorge.git
synced 2025-03-24 02:01:01 +01:00
Add a config setting for storing application settings
Summary: I'm just going to store application policy settings (like view/edit policy, and default policies for content) in config, because: 1) We'll need access to it on every page, and Config is "free" since we already pull it. 2) Building separate storage and transactions seems like overkill, we get less-nice but pretty-reasonable transactions for free with config. 3) We could easily move it later if this is a bad call. Also fix some formatting. Test Plan: See future revisions. Reviewers: btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D7202
This commit is contained in:
parent
461fc3dadf
commit
516116e229
3 changed files with 18 additions and 11 deletions
|
@ -105,14 +105,17 @@ final class PhabricatorConfigEditor
|
|||
}
|
||||
|
||||
public static function storeNewValue(
|
||||
PhabricatorConfigEntry $config_entry, $value, AphrontRequest $request) {
|
||||
PhabricatorConfigEntry $config_entry,
|
||||
$value,
|
||||
AphrontRequest $request) {
|
||||
|
||||
$xaction = id(new PhabricatorConfigTransaction())
|
||||
->setTransactionType(PhabricatorConfigTransaction::TYPE_EDIT)
|
||||
->setNewValue(
|
||||
array(
|
||||
'deleted' => false,
|
||||
'value' => $value
|
||||
));
|
||||
->setTransactionType(PhabricatorConfigTransaction::TYPE_EDIT)
|
||||
->setNewValue(
|
||||
array(
|
||||
'deleted' => false,
|
||||
'value' => $value
|
||||
));
|
||||
|
||||
$editor = id(new PhabricatorConfigEditor())
|
||||
->setActor($request->getUser())
|
||||
|
|
|
@ -175,6 +175,10 @@ final class PhabricatorCoreConfigOptions
|
|||
->setLocked(true)
|
||||
->setDescription(
|
||||
pht('Array containing list of Uninstalled applications.')),
|
||||
$this->newOption('phabricator.application-settings', 'wild', array())
|
||||
->setLocked(true)
|
||||
->setDescription(
|
||||
pht('Customized settings for Phabricator applications.')),
|
||||
$this->newOption('welcome.html', 'string', null)
|
||||
->setLocked(true)
|
||||
->setDescription(
|
||||
|
|
|
@ -26,10 +26,10 @@ final class PhabricatorConfigEntry extends PhabricatorConfigEntryDAO
|
|||
|
||||
public static function loadConfigEntry($key) {
|
||||
$config_entry = id(new PhabricatorConfigEntry())
|
||||
->loadOneWhere(
|
||||
'configKey = %s AND namespace = %s',
|
||||
$key,
|
||||
'default');
|
||||
->loadOneWhere(
|
||||
'configKey = %s AND namespace = %s',
|
||||
$key,
|
||||
'default');
|
||||
|
||||
if (!$config_entry) {
|
||||
$config_entry = id(new PhabricatorConfigEntry())
|
||||
|
|
Loading…
Add table
Reference in a new issue