Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13987448
D15987.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Referenced Files
None
Subscribers
None
D15987.diff
View Options
diff --git a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDatabasesWorkflow.php b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDatabasesWorkflow.php
--- a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDatabasesWorkflow.php
+++ b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDatabasesWorkflow.php
@@ -10,6 +10,10 @@
->setSynopsis(pht('List Phabricator databases.'));
}
+ protected function isReadOnlyWorkflow() {
+ return true;
+ }
+
public function didExecute(PhutilArgumentParser $args) {
$api = $this->getAPI();
$patches = $this->getPatches();
diff --git a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDumpWorkflow.php b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDumpWorkflow.php
--- a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDumpWorkflow.php
+++ b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDumpWorkflow.php
@@ -19,6 +19,10 @@
));
}
+ protected function isReadOnlyWorkflow() {
+ return true;
+ }
+
public function didExecute(PhutilArgumentParser $args) {
$api = $this->getAPI();
$patches = $this->getPatches();
diff --git a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementProbeWorkflow.php b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementProbeWorkflow.php
--- a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementProbeWorkflow.php
+++ b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementProbeWorkflow.php
@@ -10,6 +10,10 @@
->setSynopsis(pht('Show approximate table sizes.'));
}
+ protected function isReadOnlyWorkflow() {
+ return true;
+ }
+
public function didExecute(PhutilArgumentParser $args) {
$console = PhutilConsole::getConsole();
$console->writeErr(
diff --git a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementRenamespaceWorkflow.php b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementRenamespaceWorkflow.php
--- a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementRenamespaceWorkflow.php
+++ b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementRenamespaceWorkflow.php
@@ -30,6 +30,10 @@
));
}
+ protected function isReadOnlyWorkflow() {
+ return true;
+ }
+
public function didExecute(PhutilArgumentParser $args) {
$console = PhutilConsole::getConsole();
diff --git a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementShellWorkflow.php b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementShellWorkflow.php
--- a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementShellWorkflow.php
+++ b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementShellWorkflow.php
@@ -10,9 +10,11 @@
->setSynopsis(pht('Launch an interactive shell.'));
}
- public function execute(PhutilArgumentParser $args) {
-
+ protected function isReadOnlyWorkflow() {
+ return true;
+ }
+ public function execute(PhutilArgumentParser $args) {
$api = $this->getAPI();
list($host, $port) = $this->getBareHostAndPort($api->getHost());
diff --git a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementStatusWorkflow.php b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementStatusWorkflow.php
--- a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementStatusWorkflow.php
+++ b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementStatusWorkflow.php
@@ -10,6 +10,10 @@
->setSynopsis(pht('Show patch application status.'));
}
+ protected function isReadOnlyWorkflow() {
+ return true;
+ }
+
public function didExecute(PhutilArgumentParser $args) {
$api = $this->getAPI();
$patches = $this->getPatches();
diff --git a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php
--- a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php
+++ b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php
@@ -45,19 +45,24 @@
return $this;
}
+ protected function isReadOnlyWorkflow() {
+ return false;
+ }
public function execute(PhutilArgumentParser $args) {
$this->setDryRun($args->getArg('dryrun'));
$this->setForce($args->getArg('force'));
- if (PhabricatorEnv::isReadOnly()) {
- if ($this->isForce()) {
- PhabricatorEnv::setReadOnly(false, null);
- } else {
- throw new PhutilArgumentUsageException(
- pht(
- 'Phabricator is currently in read-only mode. Use --force to '.
- 'override this mode.'));
+ if (!$this->isReadOnlyWorkflow()) {
+ if (PhabricatorEnv::isReadOnly()) {
+ if ($this->isForce()) {
+ PhabricatorEnv::setReadOnly(false, null);
+ } else {
+ throw new PhutilArgumentUsageException(
+ pht(
+ 'Phabricator is currently in read-only mode. Use --force to '.
+ 'override this mode.'));
+ }
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Oct 22, 9:31 AM (3 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6741338
Default Alt Text
D15987.diff (5 KB)
Attached To
Mode
D15987: Don't stop on read-only mode for read-only storage workflows
Attached
Detach File
Event Timeline
Log In to Comment