mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-29 10:12:41 +01:00
Move PATH checks to post-install
Summary: We no longer need to do PHP CLI checks (D4568) or run `git submodule` (D4581) so we don't need $PATH to be set to complete setup. Move it to post-install. Drop the instructions about PHP-FPM because the Phabricator config is dramatically easier now that we have it. Test Plan: Set environment.append-paths to various things, faked lack of $PATH, verified I got the warning when I expected to setting Phabricator config cleared it. Reviewers: codeblock, btrahan Reviewed By: codeblock CC: aran Maniphest Tasks: T2228 Differential Revision: https://secure.phabricator.com/D4585
This commit is contained in:
parent
47a81aa9c4
commit
5d8ddd888c
3 changed files with 32 additions and 20 deletions
|
@ -1219,6 +1219,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorSetupCheckInvalidConfig' => 'applications/config/check/PhabricatorSetupCheckInvalidConfig.php',
|
||||
'PhabricatorSetupCheckMail' => 'applications/config/check/PhabricatorSetupCheckMail.php',
|
||||
'PhabricatorSetupCheckMySQL' => 'applications/config/check/PhabricatorSetupCheckMySQL.php',
|
||||
'PhabricatorSetupCheckPath' => 'applications/config/check/PhabricatorSetupCheckPath.php',
|
||||
'PhabricatorSetupCheckStorage' => 'applications/config/check/PhabricatorSetupCheckStorage.php',
|
||||
'PhabricatorSetupCheckTimezone' => 'applications/config/check/PhabricatorSetupCheckTimezone.php',
|
||||
'PhabricatorSetupIssue' => 'applications/config/issue/PhabricatorSetupIssue.php',
|
||||
|
@ -2581,6 +2582,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorSetupCheckInvalidConfig' => 'PhabricatorSetupCheck',
|
||||
'PhabricatorSetupCheckMail' => 'PhabricatorSetupCheck',
|
||||
'PhabricatorSetupCheckMySQL' => 'PhabricatorSetupCheck',
|
||||
'PhabricatorSetupCheckPath' => 'PhabricatorSetupCheck',
|
||||
'PhabricatorSetupCheckStorage' => 'PhabricatorSetupCheck',
|
||||
'PhabricatorSetupCheckTimezone' => 'PhabricatorSetupCheck',
|
||||
'PhabricatorSetupIssueView' => 'AphrontView',
|
||||
|
|
30
src/applications/config/check/PhabricatorSetupCheckPath.php
Normal file
30
src/applications/config/check/PhabricatorSetupCheckPath.php
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorSetupCheckPath extends PhabricatorSetupCheck {
|
||||
|
||||
protected function executeChecks() {
|
||||
// NOTE: We've already appended `environment.append-paths`, so we don't
|
||||
// need to explicitly check for it.
|
||||
$path = getenv('PATH');
|
||||
|
||||
if (!$path) {
|
||||
$summary = pht(
|
||||
'The environmental variable $PATH is empty. Phabricator will not '.
|
||||
'be able to execute some commands.');
|
||||
|
||||
$message = pht(
|
||||
'The environmental variable $PATH is empty. Phabricator needs to '.
|
||||
'execute some system commands, like `svn`, `git`, `hg`, and `diff`. '.
|
||||
'To execute these commands, the binaries must be available in the '.
|
||||
'webserver\'s $PATH. You can set additional paths in Phabricator '.
|
||||
'configuration.');
|
||||
|
||||
$this
|
||||
->newIssue('config.environment.append-paths')
|
||||
->setName(pht('$PATH Not Set'))
|
||||
->setSummary($summary)
|
||||
->setMessage($message)
|
||||
->addPhabricatorConfig('environment.append-paths');
|
||||
}
|
||||
}
|
||||
}
|
|
@ -107,26 +107,6 @@ final class PhabricatorSetup {
|
|||
"consequences of leaving it unconfigured.\n");
|
||||
}
|
||||
|
||||
$path = getenv('PATH');
|
||||
if (empty($path)) {
|
||||
self::writeFailure();
|
||||
self::write(
|
||||
"Setup failure! The environmental \$PATH variable is empty. ".
|
||||
"Phabricator needs to execute system commands like 'svn', 'git', ".
|
||||
"'hg', and 'diff'. Set up your webserver so that it passes a valid ".
|
||||
"\$PATH to the PHP process.\n\n");
|
||||
if (php_sapi_name() == 'fpm-fcgi') {
|
||||
self::write(
|
||||
"You're running php-fpm, so the easiest way to do this is to add ".
|
||||
"this line to your php-fpm.conf:\n\n".
|
||||
" env[PATH] = /usr/local/bin:/usr/bin:/bin\n\n".
|
||||
"Then restart php-fpm.\n");
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
self::write(" okay \$PATH is nonempty.\n");
|
||||
}
|
||||
|
||||
self::write("[OKAY] Core configuration OKAY.\n");
|
||||
|
||||
self::writeHeader("REQUIRED PHP EXTENSIONS");
|
||||
|
|
Loading…
Reference in a new issue