Improve resolution process for nonfatal setup issues

Summary:
  - When a setup issue is nonfatal (i.e., a warning), instruct the user to edit the value from the web UI instead of using `bin/config`.
  - When the user edits configuration in response to a setup issue, send them back to the issue when they're done.
  - When an issue relates to PHP configuration, link to the PHP documentation on configuration.
  - Add new-style setup check for timezone issues.

Test Plan: Mucked with my timezone config, resolved the issues I created.

Reviewers: codeblock, btrahan, vrana

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2221, T2228

Differential Revision: https://secure.phabricator.com/D4298
This commit is contained in:
epriestley
2012-12-30 17:04:38 -08:00
parent b852f213c3
commit c32295aab6
9 changed files with 121 additions and 77 deletions

View File

@@ -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;
}
}

View File

@@ -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;
}