@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.

Move version numbers to a dedicated "Versions" panel

Summary:
Currently, Version numbers are sort of randomly shown on "All Settings" beacuse we didn't have any better place to put them.

Now that we have modules, expose them as a config module.

Test Plan:
{F906426}

Grepped for "all settings" to look for other references to the old location, but didn't get any relevant hits.

Reviewers: chad

Reviewed By: chad

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

+87 -64
+2
src/__phutil_library_map__.php
··· 1914 1914 'PhabricatorConfigTransaction' => 'applications/config/storage/PhabricatorConfigTransaction.php', 1915 1915 'PhabricatorConfigTransactionQuery' => 'applications/config/query/PhabricatorConfigTransactionQuery.php', 1916 1916 'PhabricatorConfigValidationException' => 'applications/config/exception/PhabricatorConfigValidationException.php', 1917 + 'PhabricatorConfigVersionsModule' => 'applications/config/module/PhabricatorConfigVersionsModule.php', 1917 1918 'PhabricatorConfigWelcomeController' => 'applications/config/controller/PhabricatorConfigWelcomeController.php', 1918 1919 'PhabricatorConpherenceApplication' => 'applications/conpherence/application/PhabricatorConpherenceApplication.php', 1919 1920 'PhabricatorConpherencePreferencesSettingsPanel' => 'applications/settings/panel/PhabricatorConpherencePreferencesSettingsPanel.php', ··· 5893 5894 'PhabricatorConfigTransaction' => 'PhabricatorApplicationTransaction', 5894 5895 'PhabricatorConfigTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 5895 5896 'PhabricatorConfigValidationException' => 'Exception', 5897 + 'PhabricatorConfigVersionsModule' => 'PhabricatorConfigModule', 5896 5898 'PhabricatorConfigWelcomeController' => 'PhabricatorConfigController', 5897 5899 'PhabricatorConpherenceApplication' => 'PhabricatorApplication', 5898 5900 'PhabricatorConpherencePreferencesSettingsPanel' => 'PhabricatorSettingsPanel',
-59
src/applications/config/controller/PhabricatorConfigAllController.php
··· 58 58 $panel->setHeaderText(pht('Current Settings')); 59 59 $panel->setTable($table); 60 60 61 - $versions = $this->loadVersions(); 62 - 63 - $version_property_list = id(new PHUIPropertyListView()); 64 - foreach ($versions as $version) { 65 - list($name, $hash) = $version; 66 - $version_property_list->addProperty($name, $hash); 67 - } 68 - 69 - $object_box = id(new PHUIObjectBoxView()) 70 - ->setHeaderText(pht('Current Version')) 71 - ->addPropertyList($version_property_list); 72 - 73 - $phabricator_root = dirname(phutil_get_library_root('phabricator')); 74 - $version_path = $phabricator_root.'/conf/local/VERSION'; 75 - if (Filesystem::pathExists($version_path)) { 76 - $version_from_file = Filesystem::readFile($version_path); 77 - $version_property_list->addProperty( 78 - pht('Local Version'), 79 - $version_from_file); 80 - } 81 61 82 62 $nav = $this->buildSideNavView(); 83 63 $nav->selectFilter('all/'); 84 64 $nav->setCrumbs($crumbs); 85 - $nav->appendChild($object_box); 86 65 $nav->appendChild($panel); 87 66 88 67 ··· 92 71 'title' => $title, 93 72 )); 94 73 } 95 - 96 - private function loadVersions() { 97 - $specs = array( 98 - array( 99 - 'name' => pht('Phabricator Version'), 100 - 'root' => 'phabricator', 101 - ), 102 - array( 103 - 'name' => pht('Arcanist Version'), 104 - 'root' => 'arcanist', 105 - ), 106 - array( 107 - 'name' => pht('libphutil Version'), 108 - 'root' => 'phutil', 109 - ), 110 - ); 111 - 112 - $futures = array(); 113 - foreach ($specs as $key => $spec) { 114 - $root = dirname(phutil_get_library_root($spec['root'])); 115 - $futures[$key] = id(new ExecFuture('git log --format=%%H -n 1 --')) 116 - ->setCWD($root); 117 - } 118 - 119 - $results = array(); 120 - foreach ($futures as $key => $future) { 121 - list($err, $stdout) = $future->resolve(); 122 - if (!$err) { 123 - $name = trim($stdout); 124 - } else { 125 - $name = pht('Unknown'); 126 - } 127 - $results[$key] = array($specs[$key]['name'], $name); 128 - } 129 - 130 - return array_select_keys($results, array_keys($specs)); 131 - } 132 - 133 74 134 75 }
+79
src/applications/config/module/PhabricatorConfigVersionsModule.php
··· 1 + <?php 2 + 3 + final class PhabricatorConfigVersionsModule 4 + extends PhabricatorConfigModule { 5 + 6 + public function getModuleKey() { 7 + return 'versions'; 8 + } 9 + 10 + public function getModuleName() { 11 + return pht('Versions'); 12 + } 13 + 14 + public function renderModuleStatus(AphrontRequest $request) { 15 + $viewer = $request->getViewer(); 16 + 17 + 18 + $versions = $this->loadVersions(); 19 + 20 + $version_property_list = id(new PHUIPropertyListView()); 21 + foreach ($versions as $version) { 22 + list($name, $hash) = $version; 23 + $version_property_list->addProperty($name, $hash); 24 + } 25 + 26 + $object_box = id(new PHUIObjectBoxView()) 27 + ->setHeaderText(pht('Current Versions')) 28 + ->addPropertyList($version_property_list); 29 + 30 + $phabricator_root = dirname(phutil_get_library_root('phabricator')); 31 + $version_path = $phabricator_root.'/conf/local/VERSION'; 32 + if (Filesystem::pathExists($version_path)) { 33 + $version_from_file = Filesystem::readFile($version_path); 34 + $version_property_list->addProperty( 35 + pht('Local Version'), 36 + $version_from_file); 37 + } 38 + 39 + return $object_box; 40 + } 41 + 42 + private function loadVersions() { 43 + $specs = array( 44 + array( 45 + 'name' => pht('Phabricator Version'), 46 + 'root' => 'phabricator', 47 + ), 48 + array( 49 + 'name' => pht('Arcanist Version'), 50 + 'root' => 'arcanist', 51 + ), 52 + array( 53 + 'name' => pht('libphutil Version'), 54 + 'root' => 'phutil', 55 + ), 56 + ); 57 + 58 + $futures = array(); 59 + foreach ($specs as $key => $spec) { 60 + $root = dirname(phutil_get_library_root($spec['root'])); 61 + $futures[$key] = id(new ExecFuture('git log --format=%%H -n 1 --')) 62 + ->setCWD($root); 63 + } 64 + 65 + $results = array(); 66 + foreach ($futures as $key => $future) { 67 + list($err, $stdout) = $future->resolve(); 68 + if (!$err) { 69 + $name = trim($stdout); 70 + } else { 71 + $name = pht('Unknown'); 72 + } 73 + $results[$key] = array($specs[$key]['name'], $name); 74 + } 75 + 76 + return array_select_keys($results, array_keys($specs)); 77 + } 78 + 79 + }
+6 -5
src/docs/contributor/bug_reports.diviner
··· 69 69 @{article:Upgrading Phabricator}. 70 70 71 71 **If you can not update** for some reason, please include the version of 72 - Phabricator you are running in your report. The version is just the Git hash 73 - of your local HEAD. You can find the version by running `git show` in 74 - `phabricator/` and copy/pasting the first line of output, or by browsing to 75 - {nav Config > All Settings} in the web UI and copy/pasting the information 76 - at the top. 72 + Phabricator you are running when you file a report. You can find the version in 73 + {nav Config > Versions} in the web UI. 74 + 75 + (The version is just the Git hash of your local HEAD, so you can also find it 76 + by running `git show` in `phabricator/` and looking at the first line of 77 + output.) 77 78 78 79 79 80 Supported Issues