[ Index ] |
PHP Cross Reference of Phabricator |
[Summary view] [Print] [Text view]
1 <?php 2 3 final class DiffusionBrowseMainController extends DiffusionBrowseController { 4 5 public function processRequest() { 6 $drequest = $this->diffusionRequest; 7 $request = $this->getRequest(); 8 9 // Figure out if we're browsing a directory, a file, or a search result 10 // list. Then delegate to the appropriate controller. 11 12 $grep = $request->getStr('grep'); 13 $find = $request->getStr('find'); 14 if (strlen($grep) || strlen($find)) { 15 $controller = new DiffusionBrowseSearchController(); 16 } else { 17 $results = DiffusionBrowseResultSet::newFromConduit( 18 $this->callConduitWithDiffusionRequest( 19 'diffusion.browsequery', 20 array( 21 'path' => $drequest->getPath(), 22 'commit' => $drequest->getStableCommit(), 23 ))); 24 $reason = $results->getReasonForEmptyResultSet(); 25 $is_file = ($reason == DiffusionBrowseResultSet::REASON_IS_FILE); 26 27 if ($is_file) { 28 $controller = new DiffusionBrowseFileController($request); 29 } else { 30 $controller = new DiffusionBrowseDirectoryController($request); 31 $controller->setBrowseQueryResults($results); 32 } 33 } 34 35 $controller->setDiffusionRequest($drequest); 36 $controller->setCurrentApplication($this->getCurrentApplication()); 37 return $this->delegateToController($controller); 38 } 39 40 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Sun Nov 30 09:20:46 2014 | Cross-referenced by PHPXref 0.7.1 |