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. This server will not '. | ||||
'be able to execute some commands.', | 'be able to execute some commands.', | ||||
'$PATH'); | '$PATH'); | ||||
$message = pht( | $message = pht( | ||||
"The environmental variable %s is empty. Phabricator needs to execute ". | "The environmental variable %s is empty. This server 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 configuration.", | ||||
'$PATH', | '$PATH', | ||||
'svn', | 'svn', | ||||
'git', | 'git', | ||||
'hg', | 'hg', | ||||
'diff', | 'diff', | ||||
'$PATH'); | '$PATH'); | ||||
$this | $this | ||||
▲ Show 20 Lines • Show All 82 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 ". | "This server 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.", | ||||
$message)) | $message)) | ||||
->addPhabricatorConfig('environment.append-paths'); | ->addPhabricatorConfig('environment.append-paths'); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } |