Page MenuHomePhabricator

D11301.diff
No OneTemporary

D11301.diff

diff --git a/src/applications/config/management/PhabricatorConfigManagementDeleteWorkflow.php b/src/applications/config/management/PhabricatorConfigManagementDeleteWorkflow.php
--- a/src/applications/config/management/PhabricatorConfigManagementDeleteWorkflow.php
+++ b/src/applications/config/management/PhabricatorConfigManagementDeleteWorkflow.php
@@ -56,15 +56,9 @@
}
if ($use_database) {
- $config_entry = id(new PhabricatorConfigOption())
- ->loadOneWhere(
- 'namespace = %s and key = %s',
- 'default',
- $key);
- PhabricatorConfigEditor::deleteConfig(
- $this->getViewer(),
- $config_entry,
- PhabricatorContentSource::newConsoleSource());
+ $config_entry = PhabricatorConfigEntry::loadConfigEntry($key);
+ $config_entry->setIsDeleted(1);
+ $config_entry->save();
} else {
$config->deleteKeys(array($key));
}
diff --git a/src/applications/config/management/PhabricatorConfigManagementMigrateWorkflow.php b/src/applications/config/management/PhabricatorConfigManagementMigrateWorkflow.php
--- a/src/applications/config/management/PhabricatorConfigManagementMigrateWorkflow.php
+++ b/src/applications/config/management/PhabricatorConfigManagementMigrateWorkflow.php
@@ -55,11 +55,9 @@
'Skipping option "%s"; already in database config.', $key)."\n");
continue;
} else {
- PhabricatorConfigEditor::storeNewValue(
- $this->getViewer(),
- id(new PhabricatorConfigEntry())
- ->loadOneWhere('namespace = %s AND key = %s', 'default', $key),
- PhabricatorContentSource::newConsoleSource());
+ $config_entry = PhabricatorConfigEntry::loadConfigEntry($key);
+ $config_entry->setValue($value);
+ $config_entry->save();
$key_count++;
$console->writeOut(pht(
'Migrated option "%s" from file to database config.', $key)."\n");
diff --git a/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php b/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php
--- a/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php
+++ b/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php
@@ -111,12 +111,9 @@
if ($use_database) {
$config_type = 'database';
- PhabricatorConfigEditor::storeNewValue(
- $this->getViewer(),
- id(new PhabricatorConfigEntry())
- ->loadOneWhere('namespace = %s AND key = %s', 'default', $key),
- $value,
- PhabricatorContentSource::newConsoleSource());
+ $config_entry = PhabricatorConfigEntry::loadConfigEntry($key);
+ $config_entry->setValue($value);
+ $config_entry->save();
} else {
$config_type = 'local';
id(new PhabricatorConfigLocalSource())
diff --git a/src/applications/config/storage/PhabricatorConfigEntry.php b/src/applications/config/storage/PhabricatorConfigEntry.php
--- a/src/applications/config/storage/PhabricatorConfigEntry.php
+++ b/src/applications/config/storage/PhabricatorConfigEntry.php
@@ -46,7 +46,8 @@
if (!$config_entry) {
$config_entry = id(new PhabricatorConfigEntry())
->setConfigKey($key)
- ->setNamespace('default');
+ ->setNamespace('default')
+ ->setIsDeleted(0);
}
return $config_entry;

File Metadata

Mime Type
text/plain
Expires
Tue, Oct 22, 12:53 PM (3 w, 12 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6741815
Default Alt Text
D11301.diff (3 KB)

Event Timeline