3 final class DiffusionPathValidateController
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();
18 $repository = $drequest->getRepository();
20 $path = $request->getStr('path');
21 $path = ltrim($path, '/');
23 $browse_results = DiffusionBrowseResultSet
::newFromConduit(
24 $this->callConduitWithDiffusionRequest(
25 'diffusion.browsequery',
28 'commit' => $drequest->getCommit(),
29 'needValidityOnly' => true,
31 $valid = $browse_results->isValidResults();
34 switch ($browse_results->getReasonForEmptyResultSet()) {
35 case DiffusionBrowseResultSet
::REASON_IS_FILE
:
38 case DiffusionBrowseResultSet
::REASON_IS_EMPTY
:
45 'valid' => (bool)$valid,
48 return id(new AphrontAjaxResponse())->setContent($output);