3 final class DiffusionPathTreeController
extends DiffusionController
{
5 public function handleRequest(AphrontRequest
$request) {
6 $response = $this->loadDiffusionContext();
11 $drequest = $this->getDiffusionRequest();
12 $repository = $drequest->getRepository();
14 if (!$repository->canUsePathTree()) {
15 return new Aphront404Response();
18 $paths = $this->callConduitWithDiffusionRequest(
19 'diffusion.querypaths',
21 'path' => $drequest->getPath(),
22 'commit' => $drequest->getCommit(),
26 foreach ($paths as $path) {
27 $parts = preg_split('((?<=/))', $path);
29 foreach ($parts as $part) {
30 if (!is_array($cursor)) {
33 if (!isset($cursor[$part])) {
36 $cursor = &$cursor[$part];
40 return id(new AphrontAjaxResponse())->setContent(array('tree' => $tree));