Use the unified markup cache for Maniphest

Summary:
  - See D2945.
  - Drop `cache` field from ManiphestTransaction.
  - Render task descriptions and transactions through PhabricatorMarkupEngine.
  - Also pull the list of macros more lazily.

Test Plan:
  - Verified transactions and transaction preview work correctly and interact with cache correctly.
  - Verified tasks descriptions and task preview work correctly.
  - Verified we don't hit the imagemacro table when we're rendering everything from cache anymore.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D2946
This commit is contained in:
epriestley
2012-07-11 11:40:10 -07:00
parent eac8e0e7f3
commit 5d8b75b4da
11 changed files with 150 additions and 54 deletions

View File

@@ -22,7 +22,6 @@ require_once $root.'/scripts/__init_script__.php';
$purge_changesets = false;
$purge_differential = false;
$purge_maniphest = false;
$args = array_slice($argv, 1);
if (!$args) {
@@ -36,7 +35,6 @@ for ($ii = 0; $ii < $len; $ii++) {
case '--all':
$purge_changesets = true;
$purge_differential = true;
$purge_maniphest = true;
break;
case '--changesets':
$purge_changesets = true;
@@ -52,9 +50,6 @@ for ($ii = 0; $ii < $len; $ii++) {
case '--differential':
$purge_differential = true;
break;
case '--maniphest':
$purge_maniphest = true;
break;
case '--help':
return help();
default:
@@ -98,16 +93,6 @@ if ($purge_differential) {
echo "Done.\n";
}
if ($purge_maniphest) {
echo "Purging Maniphest comment cache...\n";
$table = new ManiphestTransaction();
queryfx(
$table->establishConnection('w'),
'UPDATE %T SET cache = NULL',
$table->getTableName());
echo "Done.\n";
}
echo "Ok, caches purged.\n";
function usage($message) {
@@ -122,7 +107,6 @@ function help() {
**SUMMARY**
**purge_cache.php**
[--maniphest]
[--differential]
[--changesets [changeset_id ...]]
**purge_cache.php** --all
@@ -136,9 +120,8 @@ function help() {
syntax highlighting, you may want to purge the changeset cache (with
"--changesets") so your changes are reflected in older diffs.
If you change Remarkup rules, you may want to purge the Maniphest or
Differential comment caches ("--maniphest", "--differential") so older
comments pick up the new rules.
If you change Remarkup rules, you may want to purge the Differential
comment caches ("--differential") so older comments pick up the new rules.
__--all__
Purge all long-lived caches.
@@ -151,9 +134,6 @@ function help() {
__--differential__
Purge Differential comment formatting cache.
__--maniphest__: show this help
Purge Maniphest comment formatting cache.
__--help__: show this help