protected function executeChecks()
 {
     $refs = PhabricatorDatabaseRef::getActiveDatabaseRefs();
     foreach ($refs as $ref) {
         $this->executeRefChecks($ref);
     }
 }
예제 #2
0
    $args->printUsageException($ex);
    exit(77);
}
// First, test that the Phabricator configuration is set up correctly. After
// we know this works we'll test any administrative credentials specifically.
$refs = PhabricatorDatabaseRef::getActiveDatabaseRefs();
if (!$refs) {
    throw new PhutilArgumentUsageException(pht('No databases are configured.'));
}
$host = $args->getArg('host');
$ref_key = $args->getArg('ref');
if (strlen($host) || strlen($ref_key)) {
    if ($host && $ref_key) {
        throw new PhutilArgumentUsageException(pht('Use "--host" or "--ref" to select a database, but not both.'));
    }
    $refs = PhabricatorDatabaseRef::getActiveDatabaseRefs();
    $possible_refs = array();
    foreach ($refs as $possible_ref) {
        if ($host && $possible_ref->getHost() == $host) {
            $possible_refs[] = $possible_ref;
            break;
        }
        if ($ref_key && $possible_ref->getRefKey() == $ref_key) {
            $possible_refs[] = $possible_ref;
            break;
        }
    }
    if (!$possible_refs) {
        if ($host) {
            throw new PhutilArgumentUsageException(pht('There is no configured database on host "%s". This command can ' . 'only interact with configured databases.', $host));
        } else {