Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F108071332
PhabricatorGuideInstallModule.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Apr 13, 22:01
Size
4 KB
Mime Type
text/x-php
Expires
Tue, Apr 15, 22:01 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
25518425
Attached To
rPH Phabricator
PhabricatorGuideInstallModule.php
View Options
<?php
final
class
PhabricatorGuideInstallModule
extends
PhabricatorGuideModule
{
public
function
getModuleKey
()
{
return
'install'
;
}
public
function
getModuleName
()
{
return
pht
(
'Install Phabricator'
);
}
public
function
getModulePosition
()
{
return
20
;
}
public
function
renderModuleStatus
(
AphrontRequest
$request
)
{
$viewer
=
$request
->
getViewer
();
$guide_items
=
new
PhabricatorGuideListView
();
$title
=
pht
(
'Resolve Setup Issues'
);
$issues_resolved
=
!
PhabricatorSetupCheck
::
getOpenSetupIssueKeys
();
$href
=
PhabricatorEnv
::
getURI
(
'/config/issue/'
);
if
(
$issues_resolved
)
{
$icon
=
'fa-check'
;
$icon_bg
=
'bg-green'
;
$skip
=
null
;
$description
=
pht
(
"You've resolved (or ignored) all outstanding setup issues."
);
}
else
{
$icon
=
'fa-warning'
;
$icon_bg
=
'bg-red'
;
$skip
=
'#'
;
$description
=
pht
(
'You have some unresolved setup issues to take care of.'
);
}
$item
=
id
(
new
PhabricatorGuideItemView
())
->
setTitle
(
$title
)
->
setHref
(
$href
)
->
setIcon
(
$icon
)
->
setIconBackground
(
$icon_bg
)
->
setSkipHref
(
$skip
)
->
setDescription
(
$description
);
$guide_items
->
addItem
(
$item
);
$configs
=
id
(
new
PhabricatorAuthProviderConfigQuery
())
->
setViewer
(
PhabricatorUser
::
getOmnipotentUser
())
->
execute
();
$title
=
pht
(
'Login and Registration'
);
$href
=
PhabricatorEnv
::
getURI
(
'/auth/'
);
$have_auth
=
(
bool
)
$configs
;
if
(
$have_auth
)
{
$icon
=
'fa-check'
;
$icon_bg
=
'bg-green'
;
$skip
=
null
;
$description
=
pht
(
"You've configured at least one authentication provider."
);
}
else
{
$icon
=
'fa-key'
;
$icon_bg
=
'bg-sky'
;
$skip
=
'#'
;
$description
=
pht
(
'Authentication providers allow users to register accounts and '
.
'log in to Phabricator.'
);
}
$item
=
id
(
new
PhabricatorGuideItemView
())
->
setTitle
(
$title
)
->
setHref
(
$href
)
->
setIcon
(
$icon
)
->
setIconBackground
(
$icon_bg
)
->
setSkipHref
(
$skip
)
->
setDescription
(
$description
);
$guide_items
->
addItem
(
$item
);
$title
=
pht
(
'Configure Phabricator'
);
$href
=
PhabricatorEnv
::
getURI
(
'/config/'
);
// Just load any config value at all; if one exists the install has figured
// out how to configure things.
$have_config
=
(
bool
)
id
(
new
PhabricatorConfigEntry
())->
loadAllWhere
(
'1 = 1 LIMIT 1'
);
if
(
$have_config
)
{
$icon
=
'fa-check'
;
$icon_bg
=
'bg-green'
;
$skip
=
null
;
$description
=
pht
(
"You've configured at least one setting from the web interface."
);
}
else
{
$icon
=
'fa-sliders'
;
$icon_bg
=
'bg-sky'
;
$skip
=
'#'
;
$description
=
pht
(
'Learn how to configure mail and other options in Phabricator.'
);
}
$item
=
id
(
new
PhabricatorGuideItemView
())
->
setTitle
(
$title
)
->
setHref
(
$href
)
->
setIcon
(
$icon
)
->
setIconBackground
(
$icon_bg
)
->
setSkipHref
(
$skip
)
->
setDescription
(
$description
);
$guide_items
->
addItem
(
$item
);
$title
=
pht
(
'User Account Settings'
);
$href
=
PhabricatorEnv
::
getURI
(
'/settings/'
);
$preferences
=
id
(
new
PhabricatorUserPreferencesQuery
())
->
setViewer
(
$viewer
)
->
withUsers
(
array
(
$viewer
))
->
executeOne
();
$have_settings
=
(
$preferences
&&
$preferences
->
getPreferences
());
if
(
$have_settings
)
{
$icon
=
'fa-check'
;
$icon_bg
=
'bg-green'
;
$skip
=
null
;
$description
=
pht
(
"You've adjusted at least one setting on your account."
);
}
else
{
$icon
=
'fa-wrench'
;
$icon_bg
=
'bg-sky'
;
$skip
=
'#'
;
$description
=
pht
(
'Configure account settings for all users, or just yourself'
);
}
$item
=
id
(
new
PhabricatorGuideItemView
())
->
setTitle
(
$title
)
->
setHref
(
$href
)
->
setIcon
(
$icon
)
->
setIconBackground
(
$icon_bg
)
->
setSkipHref
(
$skip
)
->
setDescription
(
$description
);
$guide_items
->
addItem
(
$item
);
$title
=
pht
(
'Notification Server'
);
$href
=
PhabricatorEnv
::
getURI
(
'/config/notifications/'
);
// TODO: Wire up a notifications check
$have_notifications
=
false
;
if
(
$have_notifications
)
{
$icon
=
'fa-check'
;
$icon_bg
=
'bg-green'
;
$skip
=
null
;
$description
=
pht
(
"You've set up a real-time notification server."
);
}
else
{
$icon
=
'fa-bell'
;
$icon_bg
=
'bg-sky'
;
$skip
=
'#'
;
$description
=
pht
(
'Phabricator can deliver notifications in real-time with WebSockets.'
);
}
$item
=
id
(
new
PhabricatorGuideItemView
())
->
setTitle
(
$title
)
->
setHref
(
$href
)
->
setIcon
(
$icon
)
->
setIconBackground
(
$icon_bg
)
->
setSkipHref
(
$skip
)
->
setDescription
(
$description
);
$guide_items
->
addItem
(
$item
);
return
$guide_items
;
}
}
Event Timeline
Log In to Comment