3 final class DiffusionPathCompleteController
extends DiffusionController
{
5 protected function getRepositoryIdentifierFromRequest(
6 AphrontRequest
$request) {
7 return $request->getStr('repositoryPHID');
10 public function handleRequest(AphrontRequest
$request) {
11 $response = $this->loadDiffusionContext();
16 $viewer = $this->getViewer();
17 $drequest = $this->getDiffusionRequest();
19 $query_path = $request->getStr('q');
20 if (preg_match('@/$@', $query_path)) {
21 $query_dir = $query_path;
23 $query_dir = dirname($query_path).'/';
25 $query_dir = ltrim($query_dir, '/');
27 $browse_results = DiffusionBrowseResultSet
::newFromConduit(
28 $this->callConduitWithDiffusionRequest(
29 'diffusion.browsequery',
32 'commit' => $drequest->getCommit(),
34 $paths = $browse_results->getPaths();
37 foreach ($paths as $path) {
38 $full_path = $query_dir.$path->getPath();
39 if ($path->getFileType() == DifferentialChangeType
::FILE_DIRECTORY
) {
42 $output[] = array('/'.$full_path, null, substr(md5($full_path), 0, 7));
45 return id(new AphrontAjaxResponse())->setContent($output);