diff --git a/src/__celerity_resource_map__.php b/src/__celerity_resource_map__.php index 0e9a0c2f02..e53c17ac09 100644 --- a/src/__celerity_resource_map__.php +++ b/src/__celerity_resource_map__.php @@ -3141,7 +3141,7 @@ celerity_register_resource_map(array( ), 'setup-issue-css' => array( - 'uri' => '/res/4214704f/rsrc/css/application/config/setup-issue.css', + 'uri' => '/res/d642d4e5/rsrc/css/application/config/setup-issue.css', 'type' => 'css', 'requires' => array( diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 16be2465c8..83ff936e39 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1143,6 +1143,7 @@ phutil_register_library_map(array( 'PhabricatorSetup' => 'infrastructure/PhabricatorSetup.php', 'PhabricatorSetupCheck' => 'applications/config/check/PhabricatorSetupCheck.php', 'PhabricatorSetupCheckAPC' => 'applications/config/check/PhabricatorSetupCheckAPC.php', + 'PhabricatorSetupCheckTimezone' => 'applications/config/check/PhabricatorSetupCheckTimezone.php', 'PhabricatorSetupIssue' => 'applications/config/issue/PhabricatorSetupIssue.php', 'PhabricatorSetupIssueView' => 'applications/config/view/PhabricatorSetupIssueView.php', 'PhabricatorSlowvoteChoice' => 'applications/slowvote/storage/PhabricatorSlowvoteChoice.php', @@ -2426,6 +2427,7 @@ phutil_register_library_map(array( 'PhabricatorSettingsPanelSSHKeys' => 'PhabricatorSettingsPanel', 'PhabricatorSettingsPanelSearchPreferences' => 'PhabricatorSettingsPanel', 'PhabricatorSetupCheckAPC' => 'PhabricatorSetupCheck', + 'PhabricatorSetupCheckTimezone' => 'PhabricatorSetupCheck', 'PhabricatorSetupIssueView' => 'AphrontView', 'PhabricatorSlowvoteChoice' => 'PhabricatorSlowvoteDAO', 'PhabricatorSlowvoteComment' => 'PhabricatorSlowvoteDAO', diff --git a/src/applications/cache/PhabricatorCaches.php b/src/applications/cache/PhabricatorCaches.php index b00836756f..88fdf5bc4d 100644 --- a/src/applications/cache/PhabricatorCaches.php +++ b/src/applications/cache/PhabricatorCaches.php @@ -28,9 +28,9 @@ final class PhabricatorCaches { static $cache; if (!$cache) { $caches = self::buildSetupCaches(); + $caches = self::addProfilerToCaches($caches); $cache = id(new PhutilKeyValueCacheStack()) - ->setCaches($caches) - ->setProfiler(PhutilServiceProfiler::getInstance()); + ->setCaches($caches); } return $cache; } @@ -160,4 +160,13 @@ final class PhabricatorCaches { return true; } + private static function addProfilerToCaches(array $caches) { + foreach ($caches as $key => $cache) { + $pcache = new PhutilKeyValueCacheProfiler($cache); + $pcache->setProfiler(PhutilServiceProfiler::getInstance()); + $caches[$key] = $pcache; + } + return $caches; + } + } diff --git a/src/applications/cache/PhabricatorKeyValueDatabaseCache.php b/src/applications/cache/PhabricatorKeyValueDatabaseCache.php index 314a86a70a..675edee1f1 100644 --- a/src/applications/cache/PhabricatorKeyValueDatabaseCache.php +++ b/src/applications/cache/PhabricatorKeyValueDatabaseCache.php @@ -7,17 +7,6 @@ final class PhabricatorKeyValueDatabaseCache const CACHE_FORMAT_DEFLATE = 'deflate'; public function setKeys(array $keys, $ttl = null) { - $call_id = null; - if ($this->getProfiler()) { - $call_id = $this->getProfiler()->beginServiceCall( - array( - 'type' => 'kvcache-set', - 'name' => 'phabricator-db', - 'keys' => array_keys($keys), - 'ttl' => $ttl, - )); - } - if ($keys) { $map = $this->digestKeys(array_keys($keys)); $conn_w = $this->establishConnection('w'); @@ -58,24 +47,10 @@ final class PhabricatorKeyValueDatabaseCache unset($guard); } - if ($call_id) { - $this->getProfiler()->endServiceCall($call_id, array()); - } - return $this; } public function getKeys(array $keys) { - $call_id = null; - if ($this->getProfiler()) { - $call_id = $this->getProfiler()->beginServiceCall( - array( - 'type' => 'kvcache-get', - 'name' => 'phabricator-db', - 'keys' => $keys, - )); - } - $results = array(); if ($keys) { $map = $this->digestKeys($keys); @@ -109,28 +84,10 @@ final class PhabricatorKeyValueDatabaseCache } } - if ($call_id) { - $this->getProfiler()->endServiceCall( - $call_id, - array( - 'hits' => array_keys($results), - )); - } - return $results; } public function deleteKeys(array $keys) { - $call_id = null; - if ($this->getProfiler()) { - $call_id = $this->getProfiler()->beginServiceCall( - array( - 'type' => 'kvcache-del', - 'name' => 'phabricator-db', - 'keys' => $keys, - )); - } - if ($keys) { $map = $this->digestKeys($keys); queryfx( @@ -140,10 +97,6 @@ final class PhabricatorKeyValueDatabaseCache $keys); } - if ($call_id) { - $this->getProfiler()->endServiceCall($call_id, array()); - } - return $this; } diff --git a/src/applications/config/check/PhabricatorSetupCheckTimezone.php b/src/applications/config/check/PhabricatorSetupCheckTimezone.php new file mode 100644 index 0000000000..834afb14b1 --- /dev/null +++ b/src/applications/config/check/PhabricatorSetupCheckTimezone.php @@ -0,0 +1,31 @@ +newIssue('config.timezone') + ->setShortName(pht('Timezone')) + ->setName(pht('Server Timezone Not Configured')) + ->setSummary($summary) + ->setMessage($message) + ->addPHPConfig('date.timezone') + ->addPhabricatorConfig('phabricator.timezone'); + } +} diff --git a/src/applications/config/controller/PhabricatorConfigEditController.php b/src/applications/config/controller/PhabricatorConfigEditController.php index 59463c5aa4..3f13ab2a15 100644 --- a/src/applications/config/controller/PhabricatorConfigEditController.php +++ b/src/applications/config/controller/PhabricatorConfigEditController.php @@ -22,6 +22,14 @@ final class PhabricatorConfigEditController $group = $option->getGroup(); $group_uri = $this->getApplicationURI('group/'.$group->getKey().'/'); + $issue = $request->getStr('issue'); + if ($issue) { + // If the user came here from an open setup issue, send them back. + $done_uri = $this->getApplicationURI('issue/'.$issue.'/'); + } else { + $done_uri = $group_uri; + } + // TODO: This isn't quite correct -- we should read from the entire // configuration stack, ignoring database configuration. For now, though, // it's a reasonable approximation. @@ -62,7 +70,7 @@ final class PhabricatorConfigEditController } else { // TODO: When we do Transactions, make this just set isDeleted = 1 $config_entry->delete(); - return id(new AphrontRedirectResponse())->setURI($group_uri); + return id(new AphrontRedirectResponse())->setURI($done_uri); } $config_entry->setValue($value); @@ -70,7 +78,7 @@ final class PhabricatorConfigEditController if (!$errors) { $config_entry->save(); - return id(new AphrontRedirectResponse())->setURI($group_uri); + return id(new AphrontRedirectResponse())->setURI($done_uri); } } @@ -88,6 +96,7 @@ final class PhabricatorConfigEditController $form ->setUser($user) + ->addHiddenInput('issue', $request->getStr('issue')) ->appendChild( id(new AphrontFormTextAreaControl()) ->setLabel('JSON Value') @@ -98,7 +107,7 @@ final class PhabricatorConfigEditController ->setName('value')) ->appendChild( id(new AphrontFormSubmitControl()) - ->addCancelButton($group_uri) + ->addCancelButton($done_uri) ->setValue(pht('Save Config Entry'))) ->appendChild( phutil_render_tag( diff --git a/src/applications/config/view/PhabricatorSetupIssueView.php b/src/applications/config/view/PhabricatorSetupIssueView.php index 738d34ae6e..2c9c8c1d14 100644 --- a/src/applications/config/view/PhabricatorSetupIssueView.php +++ b/src/applications/config/view/PhabricatorSetupIssueView.php @@ -23,16 +23,16 @@ final class PhabricatorSetupIssueView extends AphrontView { ), nl2br(phutil_escape_html($issue->getMessage()))); - $configs = $issue->getPhabricatorConfig(); - if ($configs) { - $description .= $this->renderPhabricatorConfig($configs); - } - $configs = $issue->getPHPConfig(); if ($configs) { $description .= $this->renderPHPConfig($configs); } + $configs = $issue->getPhabricatorConfig(); + if ($configs) { + $description .= $this->renderPhabricatorConfig($configs); + } + $commands = $issue->getCommands(); if ($commands) { $run_these = pht("Run these %d command(s):", count($commands)); @@ -111,6 +111,8 @@ final class PhabricatorSetupIssueView extends AphrontView { } private function renderPhabricatorConfig(array $configs) { + $issue = $this->getIssue(); + $table_info = phutil_render_tag( 'p', array(), @@ -141,26 +143,43 @@ final class PhabricatorSetupIssueView extends AphrontView { $table = phutil_render_tag( 'table', array( - ), implode("\n", $table)); - $update_info = phutil_render_tag( - 'p', - array(), - pht( - "To update these %d value(s), run these command(s) from the command ". - "line:", - count($configs))); + if ($this->getIssue()->getIsFatal()) { + $update_info = phutil_render_tag( + 'p', + array(), + pht( + "To update these %d value(s), run these command(s) from the command ". + "line:", + count($configs))); - $update = array(); - foreach ($configs as $key) { - $cmd = 'phabricator/ $ ./bin/config set '. - phutil_escape_html($key).' '. - 'value'; - $update[] = $cmd; + $update = array(); + foreach ($configs as $key) { + $cmd = 'phabricator/ $ ./bin/config set '. + phutil_escape_html($key).' '. + 'value'; + $update[] = $cmd; + } + $update = phutil_render_tag('pre', array(), implode("\n", $update)); + } else { + $update_info = phutil_render_tag( + 'p', + array(), + pht("You can update these %d value(s) here:", count($configs))); + $update = array(); + foreach ($configs as $config) { + $link = phutil_render_tag( + 'a', + array( + 'href' => '/config/edit/'.$config.'/?issue='.$issue->getIssueKey(), + ), + pht('Edit %s', phutil_escape_html($config))); + $update[] = '