Commit 530145ba authored by epriestley's avatar epriestley
Browse files

Give "Config" a full-width, hierarchical layout

Summary:
Depends on D20933. Ref T13362. This reorganizes Config a bit and attempts to simplify it.

Subsections are now in a landing page console and groupings have been removed. We "only" have 75 values you can edit from the web UI nowadays, which is still a lot, but less overwhelming than it was in the past. And the trend is generally downward, as config is removed/simplified or moved into application settings.

This also gets rid of the "gigantic blobs of JSON in the UI".

Test Plan: Browsed all Config sections.

Maniphest Tasks: T13362

Differential Revision: https://secure.phabricator.com/D20934
parent 26c2a1ba
......@@ -2799,9 +2799,7 @@ phutil_register_library_map(array(
'PhabricatorConduitTokenQuery' => 'applications/conduit/query/PhabricatorConduitTokenQuery.php',
'PhabricatorConduitTokenTerminateController' => 'applications/conduit/controller/PhabricatorConduitTokenTerminateController.php',
'PhabricatorConduitTokensSettingsPanel' => 'applications/conduit/settings/PhabricatorConduitTokensSettingsPanel.php',
'PhabricatorConfigAllController' => 'applications/config/controller/PhabricatorConfigAllController.php',
'PhabricatorConfigApplication' => 'applications/config/application/PhabricatorConfigApplication.php',
'PhabricatorConfigApplicationController' => 'applications/config/controller/PhabricatorConfigApplicationController.php',
'PhabricatorConfigCacheController' => 'applications/config/controller/services/PhabricatorConfigCacheController.php',
'PhabricatorConfigClusterDatabasesController' => 'applications/config/controller/services/PhabricatorConfigClusterDatabasesController.php',
'PhabricatorConfigClusterNotificationsController' => 'applications/config/controller/services/PhabricatorConfigClusterNotificationsController.php',
......@@ -2810,6 +2808,7 @@ phutil_register_library_map(array(
'PhabricatorConfigCollectorsModule' => 'applications/config/module/PhabricatorConfigCollectorsModule.php',
'PhabricatorConfigColumnSchema' => 'applications/config/schema/PhabricatorConfigColumnSchema.php',
'PhabricatorConfigConfigPHIDType' => 'applications/config/phid/PhabricatorConfigConfigPHIDType.php',
'PhabricatorConfigConsoleController' => 'applications/config/controller/PhabricatorConfigConsoleController.php',
'PhabricatorConfigConstants' => 'applications/config/constants/PhabricatorConfigConstants.php',
'PhabricatorConfigController' => 'applications/config/controller/PhabricatorConfigController.php',
'PhabricatorConfigCoreSchemaSpec' => 'applications/config/schema/PhabricatorConfigCoreSchemaSpec.php',
......@@ -2821,24 +2820,21 @@ phutil_register_library_map(array(
'PhabricatorConfigDefaultSource' => 'infrastructure/env/PhabricatorConfigDefaultSource.php',
'PhabricatorConfigDictionarySource' => 'infrastructure/env/PhabricatorConfigDictionarySource.php',
'PhabricatorConfigEdgeModule' => 'applications/config/module/PhabricatorConfigEdgeModule.php',
'PhabricatorConfigEditController' => 'applications/config/controller/PhabricatorConfigEditController.php',
'PhabricatorConfigEditController' => 'applications/config/controller/settings/PhabricatorConfigEditController.php',
'PhabricatorConfigEditor' => 'applications/config/editor/PhabricatorConfigEditor.php',
'PhabricatorConfigEntry' => 'applications/config/storage/PhabricatorConfigEntry.php',
'PhabricatorConfigEntryDAO' => 'applications/config/storage/PhabricatorConfigEntryDAO.php',
'PhabricatorConfigEntryQuery' => 'applications/config/query/PhabricatorConfigEntryQuery.php',
'PhabricatorConfigFileSource' => 'infrastructure/env/PhabricatorConfigFileSource.php',
'PhabricatorConfigGroupConstants' => 'applications/config/constants/PhabricatorConfigGroupConstants.php',
'PhabricatorConfigGroupController' => 'applications/config/controller/PhabricatorConfigGroupController.php',
'PhabricatorConfigHTTPParameterTypesModule' => 'applications/config/module/PhabricatorConfigHTTPParameterTypesModule.php',
'PhabricatorConfigHistoryController' => 'applications/config/controller/PhabricatorConfigHistoryController.php',
'PhabricatorConfigIgnoreController' => 'applications/config/controller/PhabricatorConfigIgnoreController.php',
'PhabricatorConfigIssueListController' => 'applications/config/controller/PhabricatorConfigIssueListController.php',
'PhabricatorConfigIssuePanelController' => 'applications/config/controller/PhabricatorConfigIssuePanelController.php',
'PhabricatorConfigIssueViewController' => 'applications/config/controller/PhabricatorConfigIssueViewController.php',
'PhabricatorConfigIgnoreController' => 'applications/config/controller/issue/PhabricatorConfigIgnoreController.php',
'PhabricatorConfigIssueListController' => 'applications/config/controller/issue/PhabricatorConfigIssueListController.php',
'PhabricatorConfigIssuePanelController' => 'applications/config/controller/issue/PhabricatorConfigIssuePanelController.php',
'PhabricatorConfigIssueViewController' => 'applications/config/controller/issue/PhabricatorConfigIssueViewController.php',
'PhabricatorConfigJSON' => 'applications/config/json/PhabricatorConfigJSON.php',
'PhabricatorConfigJSONOptionType' => 'applications/config/custom/PhabricatorConfigJSONOptionType.php',
'PhabricatorConfigKeySchema' => 'applications/config/schema/PhabricatorConfigKeySchema.php',
'PhabricatorConfigListController' => 'applications/config/controller/PhabricatorConfigListController.php',
'PhabricatorConfigLocalSource' => 'infrastructure/env/PhabricatorConfigLocalSource.php',
'PhabricatorConfigManagementDeleteWorkflow' => 'applications/config/management/PhabricatorConfigManagementDeleteWorkflow.php',
'PhabricatorConfigManagementDoneWorkflow' => 'applications/config/management/PhabricatorConfigManagementDoneWorkflow.php',
......@@ -2849,12 +2845,12 @@ phutil_register_library_map(array(
'PhabricatorConfigManagementWorkflow' => 'applications/config/management/PhabricatorConfigManagementWorkflow.php',
'PhabricatorConfigManualActivity' => 'applications/config/storage/PhabricatorConfigManualActivity.php',
'PhabricatorConfigModule' => 'applications/config/module/PhabricatorConfigModule.php',
'PhabricatorConfigModuleController' => 'applications/config/controller/PhabricatorConfigModuleController.php',
'PhabricatorConfigModuleController' => 'applications/config/controller/module/PhabricatorConfigModuleController.php',
'PhabricatorConfigOption' => 'applications/config/option/PhabricatorConfigOption.php',
'PhabricatorConfigOptionType' => 'applications/config/custom/PhabricatorConfigOptionType.php',
'PhabricatorConfigPHIDModule' => 'applications/config/module/PhabricatorConfigPHIDModule.php',
'PhabricatorConfigProxySource' => 'infrastructure/env/PhabricatorConfigProxySource.php',
'PhabricatorConfigPurgeCacheController' => 'applications/config/controller/PhabricatorConfigPurgeCacheController.php',
'PhabricatorConfigPurgeCacheController' => 'applications/config/controller/services/PhabricatorConfigPurgeCacheController.php',
'PhabricatorConfigRegexOptionType' => 'applications/config/custom/PhabricatorConfigRegexOptionType.php',
'PhabricatorConfigRemarkupRule' => 'infrastructure/markup/rule/PhabricatorConfigRemarkupRule.php',
'PhabricatorConfigRequestExceptionHandlerModule' => 'applications/config/module/PhabricatorConfigRequestExceptionHandlerModule.php',
......@@ -2863,6 +2859,9 @@ phutil_register_library_map(array(
'PhabricatorConfigSchemaSpec' => 'applications/config/schema/PhabricatorConfigSchemaSpec.php',
'PhabricatorConfigServerSchema' => 'applications/config/schema/PhabricatorConfigServerSchema.php',
'PhabricatorConfigServicesController' => 'applications/config/controller/services/PhabricatorConfigServicesController.php',
'PhabricatorConfigSettingsController' => 'applications/config/controller/settings/PhabricatorConfigSettingsController.php',
'PhabricatorConfigSettingsHistoryController' => 'applications/config/controller/settings/PhabricatorConfigSettingsHistoryController.php',
'PhabricatorConfigSettingsListController' => 'applications/config/controller/settings/PhabricatorConfigSettingsListController.php',
'PhabricatorConfigSetupCheckModule' => 'applications/config/module/PhabricatorConfigSetupCheckModule.php',
'PhabricatorConfigSiteModule' => 'applications/config/module/PhabricatorConfigSiteModule.php',
'PhabricatorConfigSiteSource' => 'infrastructure/env/PhabricatorConfigSiteSource.php',
......@@ -2874,7 +2873,6 @@ phutil_register_library_map(array(
'PhabricatorConfigTransactionQuery' => 'applications/config/query/PhabricatorConfigTransactionQuery.php',
'PhabricatorConfigType' => 'applications/config/type/PhabricatorConfigType.php',
'PhabricatorConfigValidationException' => 'applications/config/exception/PhabricatorConfigValidationException.php',
'PhabricatorConfigVersionController' => 'applications/config/controller/PhabricatorConfigVersionController.php',
'PhabricatorConpherenceApplication' => 'applications/conpherence/application/PhabricatorConpherenceApplication.php',
'PhabricatorConpherenceColumnMinimizeSetting' => 'applications/settings/setting/PhabricatorConpherenceColumnMinimizeSetting.php',
'PhabricatorConpherenceColumnVisibleSetting' => 'applications/settings/setting/PhabricatorConpherenceColumnVisibleSetting.php',
......@@ -9134,9 +9132,7 @@ phutil_register_library_map(array(
'PhabricatorConduitTokenQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorConduitTokenTerminateController' => 'PhabricatorConduitController',
'PhabricatorConduitTokensSettingsPanel' => 'PhabricatorSettingsPanel',
'PhabricatorConfigAllController' => 'PhabricatorConfigController',
'PhabricatorConfigApplication' => 'PhabricatorApplication',
'PhabricatorConfigApplicationController' => 'PhabricatorConfigController',
'PhabricatorConfigCacheController' => 'PhabricatorConfigServicesController',
'PhabricatorConfigClusterDatabasesController' => 'PhabricatorConfigServicesController',
'PhabricatorConfigClusterNotificationsController' => 'PhabricatorConfigServicesController',
......@@ -9145,6 +9141,7 @@ phutil_register_library_map(array(
'PhabricatorConfigCollectorsModule' => 'PhabricatorConfigModule',
'PhabricatorConfigColumnSchema' => 'PhabricatorConfigStorageSchema',
'PhabricatorConfigConfigPHIDType' => 'PhabricatorPHIDType',
'PhabricatorConfigConsoleController' => 'PhabricatorConfigController',
'PhabricatorConfigConstants' => 'Phobject',
'PhabricatorConfigController' => 'PhabricatorController',
'PhabricatorConfigCoreSchemaSpec' => 'PhabricatorConfigSchemaSpec',
......@@ -9156,7 +9153,7 @@ phutil_register_library_map(array(
'PhabricatorConfigDefaultSource' => 'PhabricatorConfigProxySource',
'PhabricatorConfigDictionarySource' => 'PhabricatorConfigSource',
'PhabricatorConfigEdgeModule' => 'PhabricatorConfigModule',
'PhabricatorConfigEditController' => 'PhabricatorConfigController',
'PhabricatorConfigEditController' => 'PhabricatorConfigSettingsController',
'PhabricatorConfigEditor' => 'PhabricatorApplicationTransactionEditor',
'PhabricatorConfigEntry' => array(
'PhabricatorConfigEntryDAO',
......@@ -9167,9 +9164,7 @@ phutil_register_library_map(array(
'PhabricatorConfigEntryQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorConfigFileSource' => 'PhabricatorConfigProxySource',
'PhabricatorConfigGroupConstants' => 'PhabricatorConfigConstants',
'PhabricatorConfigGroupController' => 'PhabricatorConfigController',
'PhabricatorConfigHTTPParameterTypesModule' => 'PhabricatorConfigModule',
'PhabricatorConfigHistoryController' => 'PhabricatorConfigController',
'PhabricatorConfigIgnoreController' => 'PhabricatorConfigController',
'PhabricatorConfigIssueListController' => 'PhabricatorConfigController',
'PhabricatorConfigIssuePanelController' => 'PhabricatorConfigController',
......@@ -9177,7 +9172,6 @@ phutil_register_library_map(array(
'PhabricatorConfigJSON' => 'Phobject',
'PhabricatorConfigJSONOptionType' => 'PhabricatorConfigOptionType',
'PhabricatorConfigKeySchema' => 'PhabricatorConfigStorageSchema',
'PhabricatorConfigListController' => 'PhabricatorConfigController',
'PhabricatorConfigLocalSource' => 'PhabricatorConfigProxySource',
'PhabricatorConfigManagementDeleteWorkflow' => 'PhabricatorConfigManagementWorkflow',
'PhabricatorConfigManagementDoneWorkflow' => 'PhabricatorConfigManagementWorkflow',
......@@ -9202,6 +9196,9 @@ phutil_register_library_map(array(
'PhabricatorConfigSchemaSpec' => 'Phobject',
'PhabricatorConfigServerSchema' => 'PhabricatorConfigStorageSchema',
'PhabricatorConfigServicesController' => 'PhabricatorConfigController',
'PhabricatorConfigSettingsController' => 'PhabricatorConfigController',
'PhabricatorConfigSettingsHistoryController' => 'PhabricatorConfigSettingsController',
'PhabricatorConfigSettingsListController' => 'PhabricatorConfigSettingsController',
'PhabricatorConfigSetupCheckModule' => 'PhabricatorConfigModule',
'PhabricatorConfigSiteModule' => 'PhabricatorConfigModule',
'PhabricatorConfigSiteSource' => 'PhabricatorConfigProxySource',
......@@ -9213,7 +9210,6 @@ phutil_register_library_map(array(
'PhabricatorConfigTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
'PhabricatorConfigType' => 'Phobject',
'PhabricatorConfigValidationException' => 'Exception',
'PhabricatorConfigVersionController' => 'PhabricatorConfigController',
'PhabricatorConpherenceApplication' => 'PhabricatorApplication',
'PhabricatorConpherenceColumnMinimizeSetting' => 'PhabricatorInternalSetting',
'PhabricatorConpherenceColumnVisibleSetting' => 'PhabricatorInternalSetting',
......@@ -10,7 +10,7 @@ final class AlmanacConsoleController extends AlmanacController {
$viewer = $request->getViewer();
$menu = id(new PHUIObjectItemListView())
->setUser($viewer)
->setViewer($viewer)
->setBig(true);
$menu->addItem(
......@@ -84,7 +84,6 @@ final class AlmanacConsoleController extends AlmanacController {
->setTitle(pht('Almanac Console'))
->setCrumbs($crumbs)
->appendChild($view);
}
}
......@@ -37,13 +37,12 @@ final class PhabricatorConfigApplication extends PhabricatorApplication {
public function getRoutes() {
return array(
'/config/' => array(
'' => 'PhabricatorConfigListController',
'' => 'PhabricatorConfigConsoleController',
'application/' => 'PhabricatorConfigApplicationController',
'all/' => 'PhabricatorConfigAllController',
'history/' => 'PhabricatorConfigHistoryController',
'edit/(?P<key>[\w\.\-]+)/' => 'PhabricatorConfigEditController',
'group/(?P<key>[^/]+)/' => 'PhabricatorConfigGroupController',
'version/' => 'PhabricatorConfigVersionController',
'database/'.
'(?:(?P<ref>[^/]+)/'.
'(?:(?P<database>[^/]+)/'.
......@@ -71,6 +70,12 @@ final class PhabricatorConfigApplication extends PhabricatorApplication {
'repositories/' => 'PhabricatorConfigClusterRepositoriesController',
'search/' => 'PhabricatorConfigClusterSearchController',
),
'settings/' => array(
'' => 'PhabricatorConfigSettingsListController',
'(?P<filter>advanced|all)/'
=> 'PhabricatorConfigSettingsListController',
'history/' => 'PhabricatorConfigSettingsHistoryController',
),
),
);
}
......
......@@ -53,20 +53,23 @@ final class PhabricatorAuthSetupCheck extends PhabricatorSetupCheck {
"\n\n".
'Leaving your authentication provider configuration unlocked '.
'increases the damage that a compromised administrator account can '.
'do to your install, by, for example, changing the authentication '.
'provider to a server they control and intercepting usernames and '.
'do to your install. For example, an attacker who compromises an '.
'administrator account can change authentication providers to point '.
'at a server they control and attempt to intercept usernames and '.
'passwords.'.
"\n\n".
'To prevent this attack, you should configure your authentication '.
'providers, and then lock the configuration by doing `%s` '.
'from the command line. This will prevent changing the '.
'authentication provider config without first doing `%s`.',
'bin/auth lock',
'bin/auth unlock');
'To prevent this attack, you should configure authentication, and '.
'then lock the configuration by running "bin/auth lock" from the '.
'command line. This will prevent changing the authentication config '.
'without first running "bin/auth unlock".');
$this
->newIssue('auth.config-unlocked')
->setShortName(pht('Auth Config Unlocked'))
->setName(pht('Authenticaton Provider Configuration Unlocked'))
->setName(pht('Authenticaton Configuration Unlocked'))
->setSummary(
pht(
'Authentication configuration is currently unlocked. Once you '.
'finish configuring authentication, you should lock it.'))
->setMessage($message)
->addRelatedPhabricatorConfig('auth.lock-config')
->addCommand(
......
......@@ -58,8 +58,7 @@ final class PhabricatorSecuritySetupCheck extends PhabricatorSetupCheck {
->setName(pht('Alternate File Domain Not Configured'))
->setSummary(
pht(
'Increase security (and improve performance) by configuring '.
'a CDN or alternate file domain.'))
'Improve security by configuring an alternate file domain.'))
->setMessage(
pht(
'Phabricator is currently configured to serve user uploads '.
......
<?php
final class PhabricatorConfigAllController
extends PhabricatorConfigController {
public function handleRequest(AphrontRequest $request) {
$viewer = $request->getViewer();
$db_values = id(new PhabricatorConfigEntry())
->loadAllWhere('namespace = %s', 'default');
$db_values = mpull($db_values, null, 'getConfigKey');
$rows = array();
$options = PhabricatorApplicationConfigOptions::loadAllOptions();
ksort($options);
foreach ($options as $option) {
$key = $option->getKey();
if ($option->getHidden()) {
$value = phutil_tag('em', array(), pht('Hidden'));
} else {
$value = PhabricatorEnv::getEnvConfig($key);
$value = PhabricatorConfigJSON::prettyPrintJSON($value);
}
$db_value = idx($db_values, $key);
$rows[] = array(
phutil_tag(
'a',
array(
'href' => $this->getApplicationURI('edit/'.$key.'/'),
),
$key),
$value,
$db_value && !$db_value->getIsDeleted() ? pht('Customized') : '',
);
}
$table = id(new AphrontTableView($rows))
->setColumnClasses(
array(
'',
'wide',
))
->setHeaders(
array(
pht('Key'),
pht('Value'),
pht('Customized'),
));
$title = pht('Current Settings');
$header = $this->buildHeaderView($title);
$nav = $this->buildSideNavView();
$nav->selectFilter('all/');
$view = $this->buildConfigBoxView(
pht('All Settings'),
$table);
$crumbs = $this->buildApplicationCrumbs()
->addTextCrumb($title)
->setBorder(true);
$content = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter($view);
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
->setNavigation($nav)
->appendChild($content);
}
}
<?php
final class PhabricatorConfigApplicationController
extends PhabricatorConfigController {
public function handleRequest(AphrontRequest $request) {
$viewer = $request->getViewer();
$nav = $this->buildSideNavView();
$nav->selectFilter('application/');
$groups = PhabricatorApplicationConfigOptions::loadAll();
$apps_list = $this->buildConfigOptionsList($groups, 'apps');
$apps_list = $this->buildConfigBoxView(pht('Applications'), $apps_list);
$title = pht('Application Settings');
$header = $this->buildHeaderView($title);
$content = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter($apps_list);
$crumbs = $this->buildApplicationCrumbs()
->addTextCrumb($title)
->setBorder(true);
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
->setNavigation($nav)
->appendChild($content);
}
private function buildConfigOptionsList(array $groups, $type) {
assert_instances_of($groups, 'PhabricatorApplicationConfigOptions');
$list = new PHUIObjectItemListView();
$list->setBig(true);
$groups = msort($groups, 'getName');
foreach ($groups as $group) {
if ($group->getGroup() == $type) {
$icon = id(new PHUIIconView())
->setIcon($group->getIcon())
->setBackground('bg-violet');
$item = id(new PHUIObjectItemView())
->setHeader($group->getName())
->setHref('/config/group/'.$group->getKey().'/')
->addAttribute($group->getDescription())
->setImageIcon($icon);
$list->addItem($item);
}
}
return $list;
}
}
<?php
final class PhabricatorConfigVersionController
final class PhabricatorConfigConsoleController
extends PhabricatorConfigController {
public function handleRequest(AphrontRequest $request) {
$viewer = $request->getViewer();
$title = pht('Version Information');
$versions = $this->renderModuleStatus($viewer);
$nav = $this->buildSideNavView();
$nav->selectFilter('version/');
$header = $this->buildHeaderView($title);
$view = $this->buildConfigBoxView(
pht('Installed Versions'),
$versions);
$menu = id(new PHUIObjectItemListView())
->setViewer($viewer)
->setBig(true);
$menu->addItem(
id(new PHUIObjectItemView())
->setHeader(pht('Settings'))
->setHref($this->getApplicationURI('settings/'))
->setImageIcon('fa-wrench')
->setClickable(true)
->addAttribute(
pht(
'Review and modify configuration settings.')));
$menu->addItem(
id(new PHUIObjectItemView())
->setHeader(pht('Setup Issues'))
->setHref($this->getApplicationURI('issue/'))
->setImageIcon('fa-exclamation-triangle')
->setClickable(true)
->addAttribute(
pht(
'Show unresolved issues with setup and configuration.')));
$menu->addItem(
id(new PHUIObjectItemView())
->setHeader(pht('Services'))
->setHref($this->getApplicationURI('cluster/databases/'))
->setImageIcon('fa-server')
->setClickable(true)
->addAttribute(
pht(
'View status information for databases, caches, repositories, '.
'and other services.')));
$menu->addItem(
id(new PHUIObjectItemView())
->setHeader(pht('Extensions/Modules'))
->setHref($this->getApplicationURI('module/'))
->setImageIcon('fa-gear')
->setClickable(true)
->addAttribute(
pht(
'Show installed extensions and modules.')));
$crumbs = $this->buildApplicationCrumbs()
->addTextCrumb($title)
->addTextCrumb(pht('Console'))
->setBorder(true);
$content = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter($view);
$box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Phabricator Configuation'))
->setBackground(PHUIObjectBoxView::WHITE_CONFIG)
->setObjectList($menu);
$versions = $this->newLibraryVersionTable($viewer);
$binary_versions = $this->newBinaryVersionTable();
$launcher_view = id(new PHUILauncherView())
->appendChild($box)
->appendChild($versions)
->appendChild($binary_versions);
$view = id(new PHUITwoColumnView())
->setFooter($launcher_view);
return $this->newPage()
->setTitle($title)
->setTitle(pht('Phabricator Configuation'))
->setCrumbs($crumbs)
->setNavigation($nav)
->appendChild($content);
->appendChild($view);
}
public function renderModuleStatus($viewer) {
public function newLibraryVersionTable() {
$viewer = $this->getViewer();
$versions = $this->loadVersions($viewer);
$version_property_list = id(new PHUIPropertyListView());
$rows = array();
foreach ($versions as $name => $info) {
$version = $info['version'];
if ($info['branchpoint']) {
$display = pht(
'%s (branched from %s on %s)',
$version,
$info['branchpoint'],
$info['upstream']);
$branchpoint = $info['branchpoint'];
if (strlen($branchpoint)) {
$branchpoint = substr($branchpoint, 0, 12);
} else {
$display = $version;
$branchpoint = null;
}
$version_property_list->addProperty($name, $display);
}
$phabricator_root = dirname(phutil_get_library_root('phabricator'));
$version_path = $phabricator_root.'/conf/local/VERSION';
if (Filesystem::pathExists($version_path)) {
$version_from_file = Filesystem::readFile($version_path);
$version_property_list->addProperty(
pht('Local Version'),
$version_from_file);
}
$version = $info['hash'];
if (strlen($version)) {
$version = substr($version, 0, 12);
} else {
$version = pht('Unknown');
}
$version_property_list->addProperty('php', phpversion());
$binaries = PhutilBinaryAnalyzer::getAllBinaries();
foreach ($binaries as $binary) {
if (!$binary->isBinaryAvailable()) {
$binary_info = pht('Not Available');
$epoch = $info['epoch'];
if ($epoch) {
$epoch = phabricator_date($epoch, $viewer);
} else {
$version = $binary->getBinaryVersion();
$path = $binary->getBinaryPath();
if ($path === null && $version === null) {
$binary_info = pht('-');
} else if ($path === null) {
$binary_info = $version;
} else if ($version === null) {
$binary_info = pht('- at %s', $path);
} else {
$binary_info = pht('%s at %s', $version, $path);
}
$epoch = null;
}
$version_property_list->addProperty(
$binary->getBinaryName(),
$binary_info);
$rows[] = array(
$name,
$version,
$epoch,
$branchpoint,
);
}
return $version_property_list;
$table_view = id(new AphrontTableView($rows))
->setHeaders(
array(
pht('Library'),
pht('Version'),
pht('Date'),
pht('Branchpoint'),
))
->setColumnClasses(
array(
'pri',
null,
null,
'wide',
));
return id(new PHUIObjectBoxView())
->setHeaderText(pht('Phabricator Version Information'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->appendChild($table_view);
}
private function loadVersions(PhabricatorUser $viewer) {
......@@ -207,13 +254,14 @@ final class PhabricatorConfigVersionController
list($err, $stdout) = $future->resolve();
if (!$err) {
list($hash, $epoch) = explode(' ', $stdout);
$version = pht('%s (%s)', $hash, phabricator_date($epoch, $viewer));
} else {
$version = pht('Unknown');
$hash = null;
$epoch = null;
}
$result = array(
'version' => $version,
'hash' => $hash,
'epoch' => $epoch,
'upstream' => null,
'branchpoint' => null,
);
......@@ -239,4 +287,51 @@ final class PhabricatorConfigVersionController
return $results;
}