Page MenuHomePhabricator

D14327.id.diff
No OneTemporary

D14327.id.diff

diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -1914,6 +1914,7 @@
'PhabricatorConfigTransaction' => 'applications/config/storage/PhabricatorConfigTransaction.php',
'PhabricatorConfigTransactionQuery' => 'applications/config/query/PhabricatorConfigTransactionQuery.php',
'PhabricatorConfigValidationException' => 'applications/config/exception/PhabricatorConfigValidationException.php',
+ 'PhabricatorConfigVersionsModule' => 'applications/config/module/PhabricatorConfigVersionsModule.php',
'PhabricatorConfigWelcomeController' => 'applications/config/controller/PhabricatorConfigWelcomeController.php',
'PhabricatorConpherenceApplication' => 'applications/conpherence/application/PhabricatorConpherenceApplication.php',
'PhabricatorConpherencePreferencesSettingsPanel' => 'applications/settings/panel/PhabricatorConpherencePreferencesSettingsPanel.php',
@@ -5893,6 +5894,7 @@
'PhabricatorConfigTransaction' => 'PhabricatorApplicationTransaction',
'PhabricatorConfigTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
'PhabricatorConfigValidationException' => 'Exception',
+ 'PhabricatorConfigVersionsModule' => 'PhabricatorConfigModule',
'PhabricatorConfigWelcomeController' => 'PhabricatorConfigController',
'PhabricatorConpherenceApplication' => 'PhabricatorApplication',
'PhabricatorConpherencePreferencesSettingsPanel' => 'PhabricatorSettingsPanel',
diff --git a/src/applications/config/controller/PhabricatorConfigAllController.php b/src/applications/config/controller/PhabricatorConfigAllController.php
--- a/src/applications/config/controller/PhabricatorConfigAllController.php
+++ b/src/applications/config/controller/PhabricatorConfigAllController.php
@@ -58,31 +58,10 @@
$panel->setHeaderText(pht('Current Settings'));
$panel->setTable($table);
- $versions = $this->loadVersions();
-
- $version_property_list = id(new PHUIPropertyListView());
- foreach ($versions as $version) {
- list($name, $hash) = $version;
- $version_property_list->addProperty($name, $hash);
- }
-
- $object_box = id(new PHUIObjectBoxView())
- ->setHeaderText(pht('Current Version'))
- ->addPropertyList($version_property_list);
-
- $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);
- }
$nav = $this->buildSideNavView();
$nav->selectFilter('all/');
$nav->setCrumbs($crumbs);
- $nav->appendChild($object_box);
$nav->appendChild($panel);
@@ -93,42 +72,4 @@
));
}
- private function loadVersions() {
- $specs = array(
- array(
- 'name' => pht('Phabricator Version'),
- 'root' => 'phabricator',
- ),
- array(
- 'name' => pht('Arcanist Version'),
- 'root' => 'arcanist',
- ),
- array(
- 'name' => pht('libphutil Version'),
- 'root' => 'phutil',
- ),
- );
-
- $futures = array();
- foreach ($specs as $key => $spec) {
- $root = dirname(phutil_get_library_root($spec['root']));
- $futures[$key] = id(new ExecFuture('git log --format=%%H -n 1 --'))
- ->setCWD($root);
- }
-
- $results = array();
- foreach ($futures as $key => $future) {
- list($err, $stdout) = $future->resolve();
- if (!$err) {
- $name = trim($stdout);
- } else {
- $name = pht('Unknown');
- }
- $results[$key] = array($specs[$key]['name'], $name);
- }
-
- return array_select_keys($results, array_keys($specs));
- }
-
-
}
diff --git a/src/applications/config/module/PhabricatorConfigVersionsModule.php b/src/applications/config/module/PhabricatorConfigVersionsModule.php
new file mode 100644
--- /dev/null
+++ b/src/applications/config/module/PhabricatorConfigVersionsModule.php
@@ -0,0 +1,79 @@
+<?php
+
+final class PhabricatorConfigVersionsModule
+ extends PhabricatorConfigModule {
+
+ public function getModuleKey() {
+ return 'versions';
+ }
+
+ public function getModuleName() {
+ return pht('Versions');
+ }
+
+ public function renderModuleStatus(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+
+
+ $versions = $this->loadVersions();
+
+ $version_property_list = id(new PHUIPropertyListView());
+ foreach ($versions as $version) {
+ list($name, $hash) = $version;
+ $version_property_list->addProperty($name, $hash);
+ }
+
+ $object_box = id(new PHUIObjectBoxView())
+ ->setHeaderText(pht('Current Versions'))
+ ->addPropertyList($version_property_list);
+
+ $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);
+ }
+
+ return $object_box;
+ }
+
+ private function loadVersions() {
+ $specs = array(
+ array(
+ 'name' => pht('Phabricator Version'),
+ 'root' => 'phabricator',
+ ),
+ array(
+ 'name' => pht('Arcanist Version'),
+ 'root' => 'arcanist',
+ ),
+ array(
+ 'name' => pht('libphutil Version'),
+ 'root' => 'phutil',
+ ),
+ );
+
+ $futures = array();
+ foreach ($specs as $key => $spec) {
+ $root = dirname(phutil_get_library_root($spec['root']));
+ $futures[$key] = id(new ExecFuture('git log --format=%%H -n 1 --'))
+ ->setCWD($root);
+ }
+
+ $results = array();
+ foreach ($futures as $key => $future) {
+ list($err, $stdout) = $future->resolve();
+ if (!$err) {
+ $name = trim($stdout);
+ } else {
+ $name = pht('Unknown');
+ }
+ $results[$key] = array($specs[$key]['name'], $name);
+ }
+
+ return array_select_keys($results, array_keys($specs));
+ }
+
+}
diff --git a/src/docs/contributor/bug_reports.diviner b/src/docs/contributor/bug_reports.diviner
--- a/src/docs/contributor/bug_reports.diviner
+++ b/src/docs/contributor/bug_reports.diviner
@@ -69,11 +69,12 @@
@{article:Upgrading Phabricator}.
**If you can not update** for some reason, please include the version of
-Phabricator you are running in your report. The version is just the Git hash
-of your local HEAD. You can find the version by running `git show` in
-`phabricator/` and copy/pasting the first line of output, or by browsing to
-{nav Config > All Settings} in the web UI and copy/pasting the information
-at the top.
+Phabricator you are running when you file a report. You can find the version in
+{nav Config > Versions} in the web UI.
+
+(The version is just the Git hash of your local HEAD, so you can also find it
+by running `git show` in `phabricator/` and looking at the first line of
+output.)
Supported Issues

File Metadata

Mime Type
text/plain
Expires
Sun, May 12, 3:46 PM (3 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6289266
Default Alt Text
D14327.id.diff (7 KB)

Event Timeline