Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/check/PhabricatorPathSetupCheck.php
<?php | <?php | ||||
final class PhabricatorPathSetupCheck extends PhabricatorSetupCheck { | final class PhabricatorPathSetupCheck extends PhabricatorSetupCheck { | ||||
public function getDefaultGroup() { | public function getDefaultGroup() { | ||||
return self::GROUP_OTHER; | return self::GROUP_OTHER; | ||||
} | } | ||||
protected function executeChecks() { | protected function executeChecks() { | ||||
// NOTE: We've already appended `environment.append-paths`, so we don't | // NOTE: We've already appended `environment.append-paths`, so we don't | ||||
// need to explicitly check for it. | // need to explicitly check for it. | ||||
$path = getenv('PATH'); | $path = getenv('PATH'); | ||||
if (!$path) { | if (!$path) { | ||||
$summary = pht( | $summary = pht( | ||||
'The environmental variable %s is empty. Phabricator will not '. | 'The environmental variable %s is empty. %s will not '. | ||||
'be able to execute some commands.', | 'be able to execute some commands.', | ||||
'$PATH'); | '$PATH', | ||||
PhabricatorPlatformSite::getName()); | |||||
$message = pht( | $message = pht( | ||||
"The environmental variable %s is empty. Phabricator needs to execute ". | "The environmental variable %s is empty. %s needs to execute ". | ||||
"some system commands, like `%s`, `%s`, `%s`, and `%s`. To execute ". | "some system commands, like `%s`, `%s`, `%s`, and `%s`. To execute ". | ||||
"these commands, the binaries must be available in the webserver's ". | "these commands, the binaries must be available in the webserver's ". | ||||
"%s. You can set additional paths in Phabricator configuration.", | "%s. You can set additional paths in %s configuration.", | ||||
'$PATH', | '$PATH', | ||||
PhabricatorPlatformSite::getName(), | |||||
'svn', | 'svn', | ||||
'git', | 'git', | ||||
'hg', | 'hg', | ||||
'diff', | 'diff', | ||||
'$PATH'); | '$PATH', | ||||
PhabricatorPlatformSite::getName()); | |||||
$this | $this | ||||
->newIssue('config.environment.append-paths') | ->newIssue('config.environment.append-paths') | ||||
->setName(pht('%s Not Set', '$PATH')) | ->setName(pht('%s Not Set', '$PATH')) | ||||
->setSummary($summary) | ->setSummary($summary) | ||||
->setMessage($message) | ->setMessage($message) | ||||
->addPhabricatorConfig('environment.append-paths'); | ->addPhabricatorConfig('environment.append-paths'); | ||||
▲ Show 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | if ($bad_paths) { | ||||
->setSummary( | ->setSummary( | ||||
pht( | pht( | ||||
'A component of the configured PATH can not be used by '. | 'A component of the configured PATH can not be used by '. | ||||
'the webserver: %s', | 'the webserver: %s', | ||||
$path_part)) | $path_part)) | ||||
->setMessage( | ->setMessage( | ||||
pht( | pht( | ||||
"The configured PATH includes a component which is not usable. ". | "The configured PATH includes a component which is not usable. ". | ||||
"Phabricator will be unable to find or execute binaries located ". | "%s will be unable to find or execute binaries located ". | ||||
"here:". | "here:". | ||||
"\n\n". | "\n\n". | ||||
"%s". | "%s". | ||||
"\n\n". | "\n\n". | ||||
"The user that the webserver runs as must be able to read all ". | "The user that the webserver runs as must be able to read all ". | ||||
"the directories in PATH in order to make use of them.", | "the directories in PATH in order to make use of them.", | ||||
PhabricatorPlatformSite::getName(), | |||||
$message)) | $message)) | ||||
->addPhabricatorConfig('environment.append-paths'); | ->addPhabricatorConfig('environment.append-paths'); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } |
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