array( '$' => 'RepositoryListController', 'new/$' => 'RepositoryEditController', 'edit/(?\d+)/$' => 'RepositoryEditController', 'delete/(?\d+)/$' => 'RepositoryDeleteController', ), '/' => array( '$' => 'AphrontDirectoryMainController', ), '/directory/' => array( 'item/$' => 'AphrontDirectoryItemListController', 'item/edit/(?:(?\d+)/)?$' => 'AphrontDirectoryItemEditController', 'item/delete/(?\d+)/' => 'AphrontDirectoryItemDeleteController', 'category/$' => 'AphrontDirectoryCategoryListController', 'category/edit/(?:(?\d+)/)?$' => 'AphrontDirectoryCategoryEditController', 'category/delete/(?\d+)/' => 'AphrontDirectoryCategoryDeleteController', ), '.*' => 'AphrontDefaultApplicationController', ); } public function buildRequest() { $request = new AphrontRequest($this->getHost(), $this->getPath()); $request->setRequestData($_GET + $_POST); return $request; } public function handleException(Exception $ex) { $class = phutil_escape_html(get_class($ex)); $message = phutil_escape_html($ex->getMessage()); $content = '
'. '

Unhandled Exception "'.$class.'": '.$message.'

'. ''.phutil_escape_html((string)$ex).''. '
'; $view = new PhabricatorStandardPageView(); $view->appendChild($content); $response = new AphrontWebpageResponse(); $response->setContent($view->render()); return $response; } public function willSendResponse(AphrontResponse $response) { $request = $this->getRequest(); if ($response instanceof AphrontDialogResponse) { if (!$request->isAjax()) { $view = new PhabricatorStandardPageView(); $view->appendChild( '
'. $response->buildResponseString(). '
'); $response = new AphrontWebpageResponse(); $response->setContent($view->render()); return $response; } } return $response; } }