3 final class PhabricatorRepositoriesSetupCheck
extends PhabricatorSetupCheck
{
5 public function getDefaultGroup() {
6 return self
::GROUP_OTHER
;
9 protected function executeChecks() {
11 $cluster_services = id(new AlmanacServiceQuery())
12 ->setViewer(PhabricatorUser
::getOmnipotentUser())
15 AlmanacClusterRepositoryServiceType
::SERVICETYPE
,
19 if ($cluster_services) {
20 // If cluster repository services are defined, these checks aren't useful
21 // because some nodes (like web nodes) will usually not have any local
22 // repository information.
24 // Errors with this configuration will still be detected by checks on
25 // individual repositories.
29 $repo_path = PhabricatorEnv
::getEnvConfig('repository.default-local-path');
33 "The configuration option '%s' is not set.",
34 'repository.default-local-path');
35 $this->newIssue('repository.default-local-path.empty')
36 ->setName(pht('Missing Repository Local Path'))
37 ->setSummary($summary)
38 ->addPhabricatorConfig('repository.default-local-path');
42 if (!Filesystem
::pathExists($repo_path)) {
44 'The path for local repositories does not exist, or is not '.
45 'readable by the webserver.');
47 "The directory for local repositories (%s) does not exist, or is not ".
48 "readable by the webserver. Phabricator uses this directory to store ".
49 "information about repositories. If this directory does not exist, ".
52 "If this directory exists, make it readable to the webserver. You ".
53 "can also edit the configuration below to use some other directory.",
54 phutil_tag('tt', array(), $repo_path),
55 phutil_tag('pre', array(), csprintf('$ mkdir -p %s', $repo_path)));
57 $this->newIssue('repository.default-local-path.empty')
58 ->setName(pht('Missing Repository Local Path'))
59 ->setSummary($summary)
60 ->setMessage($message)
61 ->addPhabricatorConfig('repository.default-local-path');