Path: blob/master/src/applications/config/engine/PhabricatorSetupEngine.php
12256 views
<?php12final class PhabricatorSetupEngine3extends Phobject {45private $issues;67public function getIssues() {8if ($this->issues === null) {9throw new PhutilInvalidStateException('execute');10}1112return $this->issues;13}1415public function getUnresolvedIssues() {16$issues = $this->getIssues();17$issues = mpull($issues, null, 'getIssueKey');1819$unresolved_keys = PhabricatorSetupCheck::getUnignoredIssueKeys($issues);2021return array_select_keys($issues, $unresolved_keys);22}2324public function execute() {25$issues = PhabricatorSetupCheck::runNormalChecks();2627$fatal_issue = null;28foreach ($issues as $issue) {29if ($issue->getIsFatal()) {30$fatal_issue = $issue;31break;32}33}3435if ($fatal_issue) {36// If we've discovered a fatal, we reset any in-flight state to push37// web hosts out of service.3839// This can happen if Phabricator starts during a disaster and some40// databases can not be reached. We allow Phabricator to start up in41// this situation, since it may still be able to usefully serve requests42// without risk to data.4344// However, if databases later become reachable and we learn that they45// are fatally misconfigured, we want to tear the world down again46// because data may be at risk.47PhabricatorSetupCheck::resetSetupState();4849return PhabricatorSetupCheck::newIssueResponse($issue);50}5152$issue_keys = PhabricatorSetupCheck::getUnignoredIssueKeys($issues);5354PhabricatorSetupCheck::setOpenSetupIssueKeys(55$issue_keys,56$update_database = true);5758$this->issues = $issues;5960return null;61}6263}646566