Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92653895
PhabricatorRepositoryController.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
Fri, Nov 22, 10:27
Size
2 KB
Mime Type
text/x-php
Expires
Sun, Nov 24, 10:27 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22478484
Attached To
rPH Phabricator
PhabricatorRepositoryController.php
View Options
<?php
abstract
class
PhabricatorRepositoryController
extends
PhabricatorController
{
public
function
shouldRequireAdmin
()
{
// Most of these controllers are admin-only.
return
true
;
}
public
function
buildStandardPageResponse
(
$view
,
array
$data
)
{
$page
=
$this
->
buildStandardPageView
();
$page
->
setApplicationName
(
'Repositories'
);
$page
->
setBaseURI
(
'/repository/'
);
$page
->
setTitle
(
idx
(
$data
,
'title'
));
$page
->
setGlyph
(
"rX"
);
$page
->
appendChild
(
$view
);
$response
=
new
AphrontWebpageResponse
();
return
$response
->
setContent
(
$page
->
render
());
}
private
function
isPullDaemonRunning
()
{
$control
=
new
PhabricatorDaemonControl
();
$daemons
=
$control
->
loadRunningDaemons
();
foreach
(
$daemons
as
$daemon
)
{
if
(
$daemon
->
isRunning
()
&&
$daemon
->
getName
()
==
'PhabricatorRepositoryPullLocalDaemon'
)
return
true
;
}
return
false
;
}
protected
function
renderDaemonNotice
()
{
$documentation
=
phutil_tag
(
'a'
,
array
(
'href'
=>
PhabricatorEnv
::
getDoclink
(
'article/Diffusion_User_Guide.html'
),
),
'Diffusion User Guide'
);
$common
=
"Without this daemon, Phabricator will not be able to import or update "
.
"repositories. For instructions on starting the daemon, see "
.
"<strong>{$documentation}</strong>."
;
try
{
$daemon_running
=
$this
->
isPullDaemonRunning
();
if
(
$daemon_running
)
{
return
null
;
}
$title
=
"Repository Daemon Not Running"
;
$message
=
"<p>The repository daemon is not running on this machine. "
.
"{$common}</p>"
;
}
catch
(
Exception
$ex
)
{
$title
=
"Unable To Verify Repository Daemon"
;
$message
=
"<p>Unable to determine if the repository daemon is running on this "
.
"machine. {$common}</p>"
.
"<p><strong>Exception:</strong> "
.
phutil_escape_html
(
$ex
->
getMessage
()).
"</p>"
;
}
$view
=
new
AphrontErrorView
();
$view
->
setSeverity
(
AphrontErrorView
::
SEVERITY_WARNING
);
$view
->
setTitle
(
$title
);
$view
->
appendChild
(
$message
);
return
$view
;
}
}
Event Timeline
Log In to Comment