Page MenuHomePhabricator

D15987.diff
No OneTemporary

D15987.diff

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

Mime Type
text/plain
Expires
Tue, Oct 22, 9:45 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)

Event Timeline