Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13988058
D11301.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D11301.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D11301: Config - fix management scripts with --database parameter
Attached
Detach File
Event Timeline
Log In to Comment