3 final class PhabricatorGuideInstallModule
extends PhabricatorGuideModule
{
5 public function getModuleKey() {
9 public function getModuleName() {
10 return pht('Install Phabricator');
13 public function getModulePosition() {
17 public function getIsModuleEnabled() {
18 if (PhabricatorEnv
::getEnvConfig('cluster.instance')) {
24 public function renderModuleStatus(AphrontRequest
$request) {
25 $viewer = $request->getViewer();
27 $guide_items = new PhabricatorGuideListView();
29 $title = pht('Resolve Setup Issues');
30 $issues_resolved = !PhabricatorSetupCheck
::getOpenSetupIssueKeys();
31 $href = PhabricatorEnv
::getURI('/config/issue/');
32 if ($issues_resolved) {
34 $icon_bg = 'bg-green';
36 "You've resolved (or ignored) all outstanding setup issues.");
41 pht('You have some unresolved setup issues to take care of.');
44 $item = id(new PhabricatorGuideItemView())
48 ->setIconBackground($icon_bg)
49 ->setDescription($description);
50 $guide_items->addItem($item);
52 $configs = id(new PhabricatorAuthProviderConfigQuery())
53 ->setViewer(PhabricatorUser
::getOmnipotentUser())
56 $title = pht('Login and Registration');
57 $href = PhabricatorEnv
::getURI('/auth/');
58 $have_auth = (bool)$configs;
61 $icon_bg = 'bg-green';
63 "You've configured at least one authentication provider.");
68 'Authentication providers allow users to register accounts and '.
69 'log in to Phabricator.');
72 $item = id(new PhabricatorGuideItemView())
76 ->setIconBackground($icon_bg)
77 ->setDescription($description);
78 $guide_items->addItem($item);
81 $title = pht('Configure Phabricator');
82 $href = PhabricatorEnv
::getURI('/config/');
84 // Just load any config value at all; if one exists the install has figured
85 // out how to configure things.
86 $have_config = (bool)id(new PhabricatorConfigEntry())->loadAllWhere(
91 $icon_bg = 'bg-green';
93 "You've configured at least one setting from the web interface.");
98 'Learn how to configure mail and other options in Phabricator.');
101 $item = id(new PhabricatorGuideItemView())
105 ->setIconBackground($icon_bg)
106 ->setDescription($description);
107 $guide_items->addItem($item);
110 $title = pht('User Account Settings');
111 $href = PhabricatorEnv
::getURI('/settings/');
112 $preferences = id(new PhabricatorUserPreferencesQuery())
114 ->withUsers(array($viewer))
117 $have_settings = ($preferences && $preferences->getPreferences());
118 if ($have_settings) {
120 $icon_bg = 'bg-green';
122 "You've adjusted at least one setting on your account.");
127 'Configure account settings for all users, or just yourself');
130 $item = id(new PhabricatorGuideItemView())
134 ->setIconBackground($icon_bg)
135 ->setDescription($description);
136 $guide_items->addItem($item);
139 $title = pht('Notification Server');
140 $href = PhabricatorEnv
::getURI('/config/edit/notification.servers/');
141 $have_notifications = PhabricatorEnv
::getEnvConfig('notification.servers');
142 if ($have_notifications) {
144 $icon_bg = 'bg-green';
146 "You've set up a real-time notification server.");
151 'Phabricator can deliver notifications in real-time with WebSockets.');
154 $item = id(new PhabricatorGuideItemView())
158 ->setIconBackground($icon_bg)
159 ->setDescription($description);
161 $guide_items->addItem($item);
164 'Phabricator has been successfully installed. These next guides will '.
165 'take you through configuration and new user orientation. '.
166 'These steps are optional, and you can go through them in any order. '.
167 'If you want to get back to this guide later on, you can find it in '.
168 '{icon globe} **Applications** under {icon map-o} **Guides**.');
170 $intro = new PHUIRemarkupView($viewer, $intro);
172 $intro = id(new PHUIDocumentView())
173 ->appendChild($intro);
175 return array($intro, $guide_items);