Differential D15746 Diff 37946 src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php
Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/storage/management/workflow/PhabricatorStorageManagementWorkflow.php
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | if (PhabricatorEnv::isReadOnly()) { | ||||
} 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.')); | ||||
} | } | ||||
} | } | ||||
$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()) | ||||
->setAPI($this->getAPI()); | ->setAPI($this->getAPI()); | ||||
$actual = $query->loadActualSchema(); | $actual = $query->loadActualSchema(); | ||||
$expect = $query->loadExpectedSchema(); | $expect = $query->loadExpectedSchema(); | ||||
$comp = $query->buildComparisonSchema($expect, $actual); | $comp = $query->buildComparisonSchema($expect, $actual); | ||||
return array($comp, $expect, $actual); | return array($comp, $expect, $actual); | ||||
} | } | ||||
final protected function adjustSchemata($unsafe) { | final protected function adjustSchemata($unsafe) { | ||||
$lock = $this->lock(); | $lock = $this->lock(); | ||||
try { | try { | ||||
$this->doAdjustSchemata($unsafe); | $err = $this->doAdjustSchemata($unsafe); | ||||
} catch (Exception $ex) { | } catch (Exception $ex) { | ||||
$lock->unlock(); | $lock->unlock(); | ||||
throw $ex; | throw $ex; | ||||
} | } | ||||
$lock->unlock(); | $lock->unlock(); | ||||
return $err; | |||||
} | } | ||||
final private function doAdjustSchemata($unsafe) { | final private function doAdjustSchemata($unsafe) { | ||||
$console = PhutilConsole::getConsole(); | $console = PhutilConsole::getConsole(); | ||||
$console->writeOut( | $console->writeOut( | ||||
"%s\n", | "%s\n", | ||||
pht('Verifying database schemata...')); | pht('Verifying database schemata...')); | ||||
▲ Show 20 Lines • Show All 848 Lines • Show Last 20 Lines |