From 2888d580343138075279336cd45f8eae2efb4e53 Mon Sep 17 00:00:00 2001 From: Debarghya Das Date: Sat, 19 Jan 2013 10:24:46 -0800 Subject: [PATCH] Moved Version Footer from Footer to /config/all Summary: Fixed T2349 Test Plan: Could not visibly see version at footer any more. Appeared in the top of /config. Does not appear as a config option in /config. Reviewers: epriestley CC: aran, Korvin Maniphest Tasks: T2349 Differential Revision: https://secure.phabricator.com/D4539 --- conf/default.conf.php | 10 ---------- .../AphrontDefaultApplicationConfiguration.php | 6 ------ .../PhabricatorConfigAllController.php | 16 ++++++++++++++++ .../option/PhabricatorCoreConfigOptions.php | 3 --- src/view/page/PhabricatorStandardPageView.php | 5 ----- 5 files changed, 16 insertions(+), 24 deletions(-) diff --git a/conf/default.conf.php b/conf/default.conf.php index c2441686dc..647e97863b 100644 --- a/conf/default.conf.php +++ b/conf/default.conf.php @@ -790,16 +790,6 @@ return array( // addresses. 'phabricator.mail-key' => '5ce3e7e8787f6e40dfae861da315a5cdf1018f12', - // Version string displayed in the footer. You can generate this value from - // Git log or from the current date in the deploy with a script like this: - // - // git log -n1 --pretty=%h > version.txt - // - // You can then use this generated value like this: - // - // 'phabricator.version' => - // file_get_contents(dirname(__FILE__).'/version.txt'), - 'phabricator.version' => 'UNSTABLE', // PHP requires that you set a timezone in your php.ini before using date // functions, or it will emit a warning. If this isn't possible (for instance, diff --git a/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php b/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php index 0d7f3a3b7d..e91884ef58 100644 --- a/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php +++ b/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php @@ -284,11 +284,6 @@ class AphrontDefaultApplicationConfiguration $libraries = PhutilBootloader::getInstance()->getAllLibraries(); - $version = PhabricatorEnv::getEnvConfig('phabricator.version'); - if (preg_match('/[^a-f0-9]/i', $version)) { - $version = ''; - } - // TODO: Make this configurable? $path = 'https://secure.phabricator.com/diffusion/%s/browse/master/src/'; @@ -335,7 +330,6 @@ class AphrontDefaultApplicationConfiguration if (empty($attrs['href'])) { $attrs['href'] = sprintf($path, $callsigns[$lib]). str_replace(DIRECTORY_SEPARATOR, '/', $relative). - ($version && $lib == 'phabricator' ? ';'.$version : ''). '$'.$part['line']; $attrs['target'] = '_blank'; } diff --git a/src/applications/config/controller/PhabricatorConfigAllController.php b/src/applications/config/controller/PhabricatorConfigAllController.php index 1ed9b2b799..6fd2fd9bb7 100644 --- a/src/applications/config/controller/PhabricatorConfigAllController.php +++ b/src/applications/config/controller/PhabricatorConfigAllController.php @@ -58,11 +58,27 @@ final class PhabricatorConfigAllController $panel->appendChild($table); $panel->setNoBackground(); + $phabricator_root = dirname(phutil_get_library_root('phabricator')); + $future = id(new ExecFuture('git log --format=%%H -n 1 --')) + ->setCWD($phabricator_root); + list($err, $stdout) = $future->resolve(); + if (!$err) { + $display_version = trim($stdout); + } else { + $display_version = pht('Unknown'); + } + $version_property_list = id(new PhabricatorPropertyListView()); + $version_property_list->addProperty('Version', $display_version); + + $nav = $this->buildSideNavView(); $nav->selectFilter('all/'); $nav->setCrumbs($crumbs); + $nav->appendChild($version_property_list); $nav->appendChild($panel); + + return $this->buildApplicationPage( $nav, array( diff --git a/src/applications/config/option/PhabricatorCoreConfigOptions.php b/src/applications/config/option/PhabricatorCoreConfigOptions.php index 148d6e0dee..a80de1b154 100644 --- a/src/applications/config/option/PhabricatorCoreConfigOptions.php +++ b/src/applications/config/option/PhabricatorCoreConfigOptions.php @@ -118,9 +118,6 @@ final class PhabricatorCoreConfigOptions $this->newOption('phabricator.env', 'string', null) ->setLocked(true) ->setDescription(pht('Internal.')), - $this->newOption('phabricator.version', 'string', null) - ->setLocked(true) - ->setDescription(pht('Internal / deprecated.')), $this->newOption('phabricator.setup', 'bool', false) ->setLocked(true) ->setDescription(pht('Internal / deprecated.')), diff --git a/src/view/page/PhabricatorStandardPageView.php b/src/view/page/PhabricatorStandardPageView.php index dc037e2276..5691136c45 100644 --- a/src/view/page/PhabricatorStandardPageView.php +++ b/src/view/page/PhabricatorStandardPageView.php @@ -370,11 +370,6 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView { $foot_links = array(); - $version = PhabricatorEnv::getEnvConfig('phabricator.version'); - $foot_links[] = - 'Phabricator '. - phutil_escape_html($version); - if (PhabricatorEnv::getEnvConfig('darkconsole.enabled') && !PhabricatorEnv::getEnvConfig('darkconsole.always-on')) { if ($console) {