Differential D15987 Diff 38486 src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php
Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php
Show All 39 Lines | abstract class PhabricatorStorageManagementWorkflow | ||||
} | } | ||||
public function setPatches(array $patches) { | public function setPatches(array $patches) { | ||||
assert_instances_of($patches, 'PhabricatorStoragePatch'); | assert_instances_of($patches, 'PhabricatorStoragePatch'); | ||||
$this->patches = $patches; | $this->patches = $patches; | ||||
return $this; | return $this; | ||||
} | } | ||||
protected function isReadOnlyWorkflow() { | |||||
return false; | |||||
} | |||||
public function execute(PhutilArgumentParser $args) { | public function execute(PhutilArgumentParser $args) { | ||||
$this->setDryRun($args->getArg('dryrun')); | $this->setDryRun($args->getArg('dryrun')); | ||||
$this->setForce($args->getArg('force')); | $this->setForce($args->getArg('force')); | ||||
if (!$this->isReadOnlyWorkflow()) { | |||||
if (PhabricatorEnv::isReadOnly()) { | if (PhabricatorEnv::isReadOnly()) { | ||||
if ($this->isForce()) { | if ($this->isForce()) { | ||||
PhabricatorEnv::setReadOnly(false, null); | PhabricatorEnv::setReadOnly(false, null); | ||||
} else { | } else { | ||||
throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
pht( | pht( | ||||
'Phabricator is currently in read-only mode. Use --force to '. | 'Phabricator is currently in read-only mode. Use --force to '. | ||||
'override this mode.')); | 'override this mode.')); | ||||
} | } | ||||
} | } | ||||
} | |||||
return $this->didExecute($args); | return $this->didExecute($args); | ||||
} | } | ||||
public function didExecute(PhutilArgumentParser $args) {} | public function didExecute(PhutilArgumentParser $args) {} | ||||
private function loadSchemata() { | private function loadSchemata() { | ||||
$query = id(new PhabricatorConfigSchemaQuery()) | $query = id(new PhabricatorConfigSchemaQuery()) | ||||
▲ Show 20 Lines • Show All 878 Lines • Show Last 20 Lines |