@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fail more softly if we can't execute "ps"

Summary: If, e.g., $PATH is broken we may not be able to run "ps". We'll explode pretty hard, currently. Instead, just show a harsher warning.

Test Plan: Changed "ps auxwww" to "psq", which doesn't exist on my system. Loaded page, got warning instead of explosion.

Reviewers: nathanws, vrana, btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D2624

+26 -11
+26 -11
src/applications/repository/controller/PhabricatorRepositoryController.php
··· 46 46 } 47 47 48 48 protected function renderDaemonNotice() { 49 - $daemon_running = $this->isPullDaemonRunningOnThisMachine(); 50 - if ($daemon_running) { 51 - return null; 52 - } 53 - 54 49 $documentation = phutil_render_tag( 55 50 'a', 56 51 array( ··· 59 54 ), 60 55 'Diffusion User Guide'); 61 56 57 + $common = 58 + "Without this daemon, Phabricator will not be able to import or update ". 59 + "repositories. For instructions on starting the daemon, see ". 60 + "<strong>{$documentation}</strong>."; 61 + 62 + try { 63 + $daemon_running = $this->isPullDaemonRunningOnThisMachine(); 64 + if ($daemon_running) { 65 + return null; 66 + } 67 + $title = "Repository Daemon Not Running"; 68 + $message = 69 + "<p>The repository daemon is not running on this machine. ". 70 + "{$common}</p>"; 71 + } catch (CommandException $ex) { 72 + $title = "Unable To Verify Repository Daemon"; 73 + $message = 74 + "<p>Unable to determine if the repository daemon is running on this ". 75 + "machine. {$common}</p>". 76 + "<p><strong>Exception:</strong> ". 77 + phutil_escape_html($ex->getMessage()). 78 + "</p>"; 79 + } 80 + 62 81 $view = new AphrontErrorView(); 63 82 $view->setSeverity(AphrontErrorView::SEVERITY_WARNING); 64 - $view->setTitle('Repository Daemon Not Running'); 65 - $view->appendChild( 66 - "<p>The repository daemon is not running on this machine. Without this ". 67 - "daemon, Phabricator will not be able to import or update repositories. ". 68 - "For instructions on starting the daemon, see ". 69 - "<strong>{$documentation}</strong>.</p>"); 83 + $view->setTitle($title); 84 + $view->appendChild($message); 70 85 71 86 return $view; 72 87 }