Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/check/PhabricatorDaemonsSetupCheck.php
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | if ($no_daemons) { | ||||
->setShortName(pht('Daemons Not Running')) | ->setShortName(pht('Daemons Not Running')) | ||||
->setName(pht('Daemons Are Not Running')) | ->setName(pht('Daemons Are Not Running')) | ||||
->setSummary($summary) | ->setSummary($summary) | ||||
->setMessage($message) | ->setMessage($message) | ||||
->addCommand('$ ./bin/phd start'); | ->addCommand('$ ./bin/phd start'); | ||||
} | } | ||||
$expect_user = PhabricatorEnv::getEnvConfig('phd.user'); | $expect_user = PhabricatorEnv::getEnvConfig('phd.user'); | ||||
if (strlen($expect_user)) { | if (phutil_nonempty_string($expect_user)) { | ||||
valerio.bozzolan: ✅ OK since the expected input domain is **NULL** (default) or a **string**. The phutil will… | |||||
try { | try { | ||||
$all_daemons = id(new PhabricatorDaemonLogQuery()) | $all_daemons = id(new PhabricatorDaemonLogQuery()) | ||||
->setViewer(PhabricatorUser::getOmnipotentUser()) | ->setViewer(PhabricatorUser::getOmnipotentUser()) | ||||
->withStatus(PhabricatorDaemonLogQuery::STATUS_ALIVE) | ->withStatus(PhabricatorDaemonLogQuery::STATUS_ALIVE) | ||||
->execute(); | ->execute(); | ||||
} catch (Exception $ex) { | } catch (Exception $ex) { | ||||
// If this query fails for some reason, just skip this check. | // If this query fails for some reason, just skip this check. | ||||
Show All 36 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0
✅ OK since the expected input domain is NULL (default) or a string. The phutil will throw for alien types, and it's OK.