Update Phabricator for split syntax highlighting API

Summary: I'll clean some of this stuff up in a followup too, but update the
callers to use the new explicit filename-based API.
Test Plan: Looked at paste, Diffusion and Differential.
Reviewed By: tuomaspelkonen
Reviewers: tuomaspelkonen, codeblock, jungejason, aran
CC: aran, tuomaspelkonen
Differential Revision: 600
This commit is contained in:
epriestley
2011-07-06 11:10:40 -07:00
parent f123abcc5a
commit 70cd8b1b34
3 changed files with 21 additions and 14 deletions

View File

@@ -179,13 +179,16 @@ class DiffusionBrowseFileController extends DiffusionController {
list($text_list, $rev_list, $blame_dict) = $file_query->getBlameData();
$highlightEngine = new PhutilDefaultSyntaxHighlighterEngine();
$highlightEngine->setConfig(
$highlight_engine = new PhutilDefaultSyntaxHighlighterEngine();
$highlight_engine->setConfig(
'pygments.enabled',
PhabricatorEnv::getEnvConfig('pygments.enabled'));
$text_list = explode("\n", $highlightEngine->highlightSource($path,
implode("\n", $text_list)));
$text_list = explode(
"\n",
$highlight_engine->highlightSource(
$highlight_engine->getLanguageFromFilename($path),
implode("\n", $text_list)));
$rows = $this->buildDisplayRows($text_list, $rev_list, $blame_dict,
$needs_blame, $drequest, $file_query, $selected);