Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/env/PhabricatorEnv.php
Show First 20 Lines • Show All 214 Lines • ▼ Show 20 Lines | private static function buildConfigurationSourceStack() { | ||||
foreach ($site_sources as $site_source) { | foreach ($site_sources as $site_source) { | ||||
$stack->pushSource($site_source); | $stack->pushSource($site_source); | ||||
} | } | ||||
$master = PhabricatorDatabaseRef::getMasterDatabaseRef(); | $master = PhabricatorDatabaseRef::getMasterDatabaseRef(); | ||||
if (!$master) { | if (!$master) { | ||||
self::setReadOnly(true, self::READONLY_MASTERLESS); | self::setReadOnly(true, self::READONLY_MASTERLESS); | ||||
} else if ($master->isSevered()) { | } else if ($master->isSevered()) { | ||||
$master->checkHealth(); | |||||
if ($master->isSevered()) { | |||||
self::setReadOnly(true, self::READONLY_SEVERED); | self::setReadOnly(true, self::READONLY_SEVERED); | ||||
} | } | ||||
} | |||||
try { | try { | ||||
$stack->pushSource( | $stack->pushSource( | ||||
id(new PhabricatorConfigDatabaseSource('default')) | id(new PhabricatorConfigDatabaseSource('default')) | ||||
->setName(pht('Database'))); | ->setName(pht('Database'))); | ||||
} catch (AphrontQueryException $exception) { | } catch (AphrontQueryException $exception) { | ||||
// If the database is not available, just skip this configuration | // If the database is not available, just skip this configuration | ||||
// source. This happens during `bin/storage upgrade`, `bin/conf` before | // source. This happens during `bin/storage upgrade`, `bin/conf` before | ||||
▲ Show 20 Lines • Show All 626 Lines • Show Last 20 Lines |