Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/aphront/AphrontController.php b/src/aphront/AphrontController.php
index a70e905128..c626e0e5b8 100644
--- a/src/aphront/AphrontController.php
+++ b/src/aphront/AphrontController.php
@@ -1,48 +1,61 @@
<?php
/*
- * Copyright 2011 Facebook, Inc.
+ * Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @group aphront
*/
abstract class AphrontController {
private $request;
+ private $currentApplication;
public function willBeginExecution() {
return;
}
public function willProcessRequest(array $uri_data) {
return;
}
abstract public function processRequest();
final public function __construct(AphrontRequest $request) {
$this->request = $request;
}
final public function getRequest() {
return $this->request;
}
final public function delegateToController(AphrontController $controller) {
return $controller->processRequest();
}
+
+ final public function setCurrentApplication(
+ PhabricatorApplication $current_application) {
+
+ $this->currentApplication = $current_application;
+ return $this;
+ }
+
+ final public function getCurrentApplication() {
+ return $this->currentApplication;
+ }
+
}
diff --git a/src/aphront/configuration/AphrontApplicationConfiguration.php b/src/aphront/configuration/AphrontApplicationConfiguration.php
index aa78186021..863a26070a 100644
--- a/src/aphront/configuration/AphrontApplicationConfiguration.php
+++ b/src/aphront/configuration/AphrontApplicationConfiguration.php
@@ -1,115 +1,138 @@
<?php
/*
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @group aphront
*/
abstract class AphrontApplicationConfiguration {
private $request;
private $host;
private $path;
private $console;
abstract public function getApplicationName();
abstract public function getURIMap();
abstract public function buildRequest();
abstract public function build404Controller();
abstract public function buildRedirectController($uri);
final public function setRequest(AphrontRequest $request) {
$this->request = $request;
return $this;
}
final public function getRequest() {
return $this->request;
}
final public function getConsole() {
return $this->console;
}
final public function setConsole($console) {
$this->console = $console;
return $this;
}
final public function buildController() {
- $map = $this->getURIMap();
- $mapper = new AphrontURIMapper($map);
$request = $this->getRequest();
$path = $request->getPath();
- list($controller_class, $uri_data) = $mapper->mapPath($path);
+
+ $maps = array();
+ $maps[] = array(null, $this->getURIMap());
+
+ $applications = PhabricatorApplication::getAllInstalledApplications();
+ foreach ($applications as $application) {
+ $maps[] = array($application, $application->getRoutes());
+ }
+
+ $current_application = null;
+ foreach ($maps as $map_info) {
+ list($application, $map) = $map_info;
+
+ $mapper = new AphrontURIMapper($map);
+ list($controller_class, $uri_data) = $mapper->mapPath($path);
+
+ if ($controller_class) {
+ if ($application) {
+ $current_application = $application;
+ }
+ break;
+ }
+ }
if (!$controller_class) {
if (!preg_match('@/$@', $path)) {
// If we failed to match anything but don't have a trailing slash, try
// to add a trailing slash and issue a redirect if that resolves.
list($controller_class, $uri_data) = $mapper->mapPath($path.'/');
// NOTE: For POST, just 404 instead of redirecting, since the redirect
// will be a GET without parameters.
if ($controller_class && !$request->isHTTPPost()) {
$uri = $request->getRequestURI()->setPath($path.'/');
return $this->buildRedirectController($uri);
}
}
return $this->build404Controller();
}
$controller = newv($controller_class, array($request));
+ if ($current_application) {
+ $controller->setCurrentApplication($current_application);
+ }
return array($controller, $uri_data);
}
final public function setHost($host) {
$this->host = $host;
return $this;
}
final public function getHost() {
return $this->host;
}
final public function setPath($path) {
$this->path = $path;
return $this;
}
final public function getPath() {
return $this->path;
}
final public function willBuildRequest() {
}
/**
* Hook for synchronizing account information from OAuth workflows.
*
* @task hook
*/
public function willAuthenticateUserWithOAuth(
PhabricatorUser $user,
PhabricatorUserOAuthInfo $oauth_info,
PhabricatorOAuthProvider $provider) {
return;
}
}
diff --git a/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php b/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php
index f4a931223d..459d5b9321 100644
--- a/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php
+++ b/src/aphront/configuration/AphrontDefaultApplicationConfiguration.php
@@ -1,772 +1,640 @@
<?php
/*
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @group aphront
*/
class AphrontDefaultApplicationConfiguration
extends AphrontApplicationConfiguration {
public function __construct() {
}
public function getApplicationName() {
return 'aphront-default';
}
public function getURIMap() {
return $this->getResourceURIMapRules() + array(
'/(?:(?P<filter>(?:jump|apps))/)?' =>
'PhabricatorDirectoryMainController',
'/(?:(?P<filter>feed)/)' => array(
'public/' => 'PhabricatorFeedPublicStreamController',
'(?:(?P<subfilter>[^/]+)/)?' =>
'PhabricatorDirectoryMainController',
),
'/F(?P<id>\d+)' => 'PhabricatorFileShortcutController',
'/file/' => array(
'' => 'PhabricatorFileListController',
'filter/(?P<filter>\w+)/' => 'PhabricatorFileListController',
'upload/' => 'PhabricatorFileUploadController',
'dropupload/' => 'PhabricatorFileDropUploadController',
'delete/(?P<id>\d+)/' => 'PhabricatorFileDeleteController',
'info/(?P<phid>[^/]+)/' => 'PhabricatorFileInfoController',
'data/(?P<key>[^/]+)/(?P<phid>[^/]+)/.*'
=> 'PhabricatorFileDataController',
// TODO: This is a deprecated version of /data/. Remove it after
// old links have had a chance to rot.
'alt/(?P<key>[^/]+)/(?P<phid>[^/]+)/'
=> 'PhabricatorFileDataController',
'macro/' => array(
'' => 'PhabricatorFileMacroListController',
'edit/(?:(?P<id>\d+)/)?' => 'PhabricatorFileMacroEditController',
'delete/(?P<id>\d+)/' => 'PhabricatorFileMacroDeleteController',
),
'proxy/' => 'PhabricatorFileProxyController',
'xform/(?P<transform>[^/]+)/(?P<phid>[^/]+)/'
=> 'PhabricatorFileTransformController',
),
'/phid/' => array(
'' => 'PhabricatorPHIDLookupController',
),
'/people/' => array(
'' => 'PhabricatorPeopleListController',
'logs/' => 'PhabricatorPeopleLogsController',
'edit/(?:(?P<id>\d+)/(?:(?P<view>\w+)/)?)?'
=> 'PhabricatorPeopleEditController',
'ldap/' => 'PhabricatorPeopleLdapController',
),
'/p/(?P<username>[\w._-]+)/(?:(?P<page>\w+)/)?'
=> 'PhabricatorPeopleProfileController',
'/conduit/' => array(
'' => 'PhabricatorConduitListController',
'method/(?P<method>[^/]+)/' => 'PhabricatorConduitConsoleController',
'log/' => 'PhabricatorConduitLogController',
'log/view/(?P<view>[^/]+)/' => 'PhabricatorConduitLogController',
'token/' => 'PhabricatorConduitTokenController',
),
'/api/(?P<method>[^/]+)' => 'PhabricatorConduitAPIController',
- '/D(?P<id>\d+)' => 'DifferentialRevisionViewController',
- '/differential/' => array(
- '' => 'DifferentialRevisionListController',
- 'filter/(?P<filter>\w+)/(?:(?P<username>\w+)/)?' =>
- 'DifferentialRevisionListController',
- 'stats/(?P<filter>\w+)/' => 'DifferentialRevisionStatsController',
- 'diff/' => array(
- '(?P<id>\d+)/' => 'DifferentialDiffViewController',
- 'create/' => 'DifferentialDiffCreateController',
- ),
- 'changeset/' => 'DifferentialChangesetViewController',
- 'revision/edit/(?:(?P<id>\d+)/)?'
- => 'DifferentialRevisionEditController',
- 'comment/' => array(
- 'preview/(?P<id>\d+)/' => 'DifferentialCommentPreviewController',
- 'save/' => 'DifferentialCommentSaveController',
- 'inline/' => array(
- 'preview/(?P<id>\d+)/' =>
- 'DifferentialInlineCommentPreviewController',
- 'edit/(?P<id>\d+)/' => 'DifferentialInlineCommentEditController',
- ),
- ),
- 'subscribe/(?P<action>add|rem)/(?P<id>\d+)/'
- => 'DifferentialSubscribeController',
- ),
-
'/typeahead/' => array(
'common/(?P<type>\w+)/'
=> 'PhabricatorTypeaheadCommonDatasourceController',
),
'/mail/' => array(
'' => 'PhabricatorMetaMTAListController',
'send/' => 'PhabricatorMetaMTASendController',
'view/(?P<id>\d+)/' => 'PhabricatorMetaMTAViewController',
'lists/' => 'PhabricatorMetaMTAMailingListsController',
'lists/edit/(?:(?P<id>\d+)/)?'
=> 'PhabricatorMetaMTAMailingListEditController',
'receive/' => 'PhabricatorMetaMTAReceiveController',
'received/' => 'PhabricatorMetaMTAReceivedListController',
'sendgrid/' => 'PhabricatorMetaMTASendGridReceiveController',
),
'/login/' => array(
'' => 'PhabricatorLoginController',
'email/' => 'PhabricatorEmailLoginController',
'etoken/(?P<token>\w+)/' => 'PhabricatorEmailTokenController',
'refresh/' => 'PhabricatorRefreshCSRFController',
'validate/' => 'PhabricatorLoginValidateController',
'mustverify/' => 'PhabricatorMustVerifyEmailController',
),
'/logout/' => 'PhabricatorLogoutController',
'/oauth/' => array(
'(?P<provider>\w+)/' => array(
'login/' => 'PhabricatorOAuthLoginController',
'diagnose/' => 'PhabricatorOAuthDiagnosticsController',
'unlink/' => 'PhabricatorOAuthUnlinkController',
),
),
'/ldap/' => array(
'login/' => 'PhabricatorLDAPLoginController',
'unlink/' => 'PhabricatorLDAPUnlinkController',
),
'/oauthserver/' => array(
'auth/' => 'PhabricatorOAuthServerAuthController',
'test/' => 'PhabricatorOAuthServerTestController',
'token/' => 'PhabricatorOAuthServerTokenController',
'clientauthorization/' => array(
'' => 'PhabricatorOAuthClientAuthorizationListController',
'delete/(?P<phid>[^/]+)/' =>
'PhabricatorOAuthClientAuthorizationDeleteController',
'edit/(?P<phid>[^/]+)/' =>
'PhabricatorOAuthClientAuthorizationEditController',
),
'client/' => array(
'' => 'PhabricatorOAuthClientListController',
'create/' => 'PhabricatorOAuthClientEditController',
'delete/(?P<phid>[^/]+)/' => 'PhabricatorOAuthClientDeleteController',
'edit/(?P<phid>[^/]+)/' => 'PhabricatorOAuthClientEditController',
'view/(?P<phid>[^/]+)/' => 'PhabricatorOAuthClientViewController',
),
),
'/xhprof/' => array(
'profile/(?P<phid>[^/]+)/' => 'PhabricatorXHProfProfileController',
),
'/~/' => 'DarkConsoleController',
'/settings/' => array(
'(?:page/(?P<page>[^/]+)/)?' => 'PhabricatorUserSettingsController',
),
- '/maniphest/' => array(
- '' => 'ManiphestTaskListController',
- 'view/(?P<view>\w+)/' => 'ManiphestTaskListController',
- 'report/(?:(?P<view>\w+)/)?' => 'ManiphestReportController',
- 'batch/' => 'ManiphestBatchEditController',
- 'task/' => array(
- 'create/' => 'ManiphestTaskEditController',
- 'edit/(?P<id>\d+)/' => 'ManiphestTaskEditController',
- 'descriptionchange/(?:(?P<id>\d+)/)?' =>
- 'ManiphestTaskDescriptionChangeController',
- 'descriptionpreview/' =>
- 'ManiphestTaskDescriptionPreviewController',
- ),
- 'transaction/' => array(
- 'save/' => 'ManiphestTransactionSaveController',
- 'preview/(?P<id>\d+)/' => 'ManiphestTransactionPreviewController',
- ),
- 'export/(?P<key>[^/]+)/' => 'ManiphestExportController',
- 'subpriority/' => 'ManiphestSubpriorityController',
- 'custom/' => array(
- '' => 'ManiphestSavedQueryListController',
- 'edit/(?:(?P<id>\d+)/)?' => 'ManiphestSavedQueryEditController',
- 'delete/(?P<id>\d+)/' => 'ManiphestSavedQueryDeleteController',
- ),
- ),
-
- '/T(?P<id>\d+)' => 'ManiphestTaskDetailController',
-
'/repository/' => array(
'' => 'PhabricatorRepositoryListController',
'create/' => 'PhabricatorRepositoryCreateController',
'edit/(?P<id>\d+)/(?:(?P<view>\w+)?/)?' =>
'PhabricatorRepositoryEditController',
'delete/(?P<id>\d+)/' => 'PhabricatorRepositoryDeleteController',
'project/(?P<id>\d+)/' =>
'PhabricatorRepositoryArcanistProjectEditController',
),
'/search/' => array(
'' => 'PhabricatorSearchController',
'(?P<key>[^/]+)/' => 'PhabricatorSearchController',
'attach/(?P<phid>[^/]+)/(?P<type>\w+)/(?:(?P<action>\w+)/)?'
=> 'PhabricatorSearchAttachController',
'select/(?P<type>\w+)/'
=> 'PhabricatorSearchSelectController',
'index/(?P<phid>[^/]+)/' => 'PhabricatorSearchIndexController',
),
'/project/' => array(
'' => 'PhabricatorProjectListController',
'filter/(?P<filter>[^/]+)/' => 'PhabricatorProjectListController',
'edit/(?P<id>\d+)/' => 'PhabricatorProjectProfileEditController',
'view/(?P<id>\d+)/(?:(?P<page>\w+)/)?'
=> 'PhabricatorProjectProfileController',
'create/' => 'PhabricatorProjectCreateController',
'update/(?P<id>\d+)/(?P<action>[^/]+)/'
=> 'PhabricatorProjectUpdateController',
),
- '/r(?P<callsign>[A-Z]+)(?P<commit>[a-z0-9]+)'
- => 'DiffusionCommitController',
- '/diffusion/' => array(
- '' => 'DiffusionHomeController',
- '(?P<callsign>[A-Z]+)/' => array(
- '' => 'DiffusionRepositoryController',
-
- 'repository/(?P<dblob>.*)' => 'DiffusionRepositoryController',
- 'change/(?P<dblob>.*)' => 'DiffusionChangeController',
- 'history/(?P<dblob>.*)' => 'DiffusionHistoryController',
- 'browse/(?P<dblob>.*)' => 'DiffusionBrowseController',
- 'lastmodified/(?P<dblob>.*)' => 'DiffusionLastModifiedController',
- 'diff/' => 'DiffusionDiffController',
- 'tags/(?P<dblob>.*)' => 'DiffusionTagListController',
- 'branches/(?P<dblob>.*)' => 'DiffusionBranchTableController',
-
- 'commit/(?P<commit>[a-z0-9]+)/branches/'
- => 'DiffusionCommitBranchesController',
- 'commit/(?P<commit>[a-z0-9]+)/tags/'
- => 'DiffusionCommitTagsController',
- ),
- 'inline/' => array(
- 'edit/(?P<phid>[^/]+)/' => 'DiffusionInlineCommentController',
- 'preview/(?P<phid>[^/]+)/' =>
- 'DiffusionInlineCommentPreviewController',
- ),
- 'services/' => array(
- 'path/' => array(
- 'complete/' => 'DiffusionPathCompleteController',
- 'validate/' => 'DiffusionPathValidateController',
- ),
- ),
- 'symbol/(?P<name>[^/]+)/' => 'DiffusionSymbolController',
- 'external/' => 'DiffusionExternalController',
- ),
'/daemon/' => array(
'task/(?P<id>\d+)/' => 'PhabricatorWorkerTaskDetailController',
'task/(?P<id>\d+)/(?P<action>[^/]+)/'
=> 'PhabricatorWorkerTaskUpdateController',
'log/' => array(
'' => 'PhabricatorDaemonLogListController',
'combined/' => 'PhabricatorDaemonCombinedLogController',
'(?P<id>\d+)/' => 'PhabricatorDaemonLogViewController',
),
'timeline/' => 'PhabricatorDaemonTimelineConsoleController',
'timeline/(?P<id>\d+)/' => 'PhabricatorDaemonTimelineEventController',
'' => 'PhabricatorDaemonConsoleController',
),
'/herald/' => array(
'' => 'HeraldHomeController',
'view/(?P<content_type>[^/]+)/(?:(?P<rule_type>[^/]+)/)?'
=> 'HeraldHomeController',
'new/(?:(?P<type>[^/]+)/(?:(?P<rule_type>[^/]+)/)?)?'
=> 'HeraldNewController',
'rule/(?:(?P<id>\d+)/)?' => 'HeraldRuleController',
'history/(?:(?P<id>\d+)/)?' => 'HeraldRuleEditHistoryController',
'delete/(?P<id>\d+)/' => 'HeraldDeleteController',
'test/' => 'HeraldTestConsoleController',
'transcript/' => 'HeraldTranscriptListController',
'transcript/(?P<id>\d+)/(?:(?P<filter>\w+)/)?'
=> 'HeraldTranscriptController',
),
'/uiexample/' => array(
'' => 'PhabricatorUIExampleRenderController',
'view/(?P<class>[^/]+)/' => 'PhabricatorUIExampleRenderController',
),
'/owners/' => array(
'' => 'PhabricatorOwnersListController',
'view/(?P<view>[^/]+)/' => 'PhabricatorOwnersListController',
'edit/(?P<id>\d+)/' => 'PhabricatorOwnersEditController',
'new/' => 'PhabricatorOwnersEditController',
'package/(?P<id>\d+)/' => 'PhabricatorOwnersDetailController',
'delete/(?P<id>\d+)/' => 'PhabricatorOwnersDeleteController',
),
- '/audit/' => array(
- '' => 'PhabricatorAuditListController',
- 'view/(?P<filter>[^/]+)/(?:(?P<name>[^/]+)/)?'
- => 'PhabricatorAuditListController',
- 'addcomment/' => 'PhabricatorAuditAddCommentController',
- 'preview/(?P<id>\d+)/' => 'PhabricatorAuditPreviewController',
- ),
-
'/xhpast/' => array(
'' => 'PhabricatorXHPASTViewRunController',
'view/(?P<id>\d+)/'
=> 'PhabricatorXHPASTViewFrameController',
'frameset/(?P<id>\d+)/'
=> 'PhabricatorXHPASTViewFramesetController',
'input/(?P<id>\d+)/'
=> 'PhabricatorXHPASTViewInputController',
'tree/(?P<id>\d+)/'
=> 'PhabricatorXHPASTViewTreeController',
'stream/(?P<id>\d+)/'
=> 'PhabricatorXHPASTViewStreamController',
),
'/status/' => 'PhabricatorStatusController',
'/paste/' => array(
'' => 'PhabricatorPasteListController',
'filter/(?P<filter>\w+)/' => 'PhabricatorPasteListController',
),
'/P(?P<id>\d+)' => 'PhabricatorPasteViewController',
'/help/' => array(
'keyboardshortcut/' => 'PhabricatorHelpKeyboardShortcutController',
),
'/countdown/' => array(
''
=> 'PhabricatorCountdownListController',
'(?P<id>\d+)/'
=> 'PhabricatorCountdownViewController',
'edit/(?:(?P<id>\d+)/)?'
=> 'PhabricatorCountdownEditController',
'delete/(?P<id>\d+)/'
=> 'PhabricatorCountdownDeleteController'
),
'/V(?P<id>\d+)' => 'PhabricatorSlowvotePollController',
'/vote/' => array(
'(?:view/(?P<view>\w+)/)?' => 'PhabricatorSlowvoteListController',
'create/' => 'PhabricatorSlowvoteCreateController',
),
- // Match "/w/" with slug "/".
- '/w(?P<slug>/)' => 'PhrictionDocumentController',
- // Match "/w/x/y/z/" with slug "x/y/z/".
- '/w/(?P<slug>.+/)' => 'PhrictionDocumentController',
-
- '/phriction/' => array(
- '' => 'PhrictionListController',
- 'list/(?P<view>[^/]+)/' => 'PhrictionListController',
-
- 'history(?P<slug>/)' => 'PhrictionHistoryController',
- 'history/(?P<slug>.+/)' => 'PhrictionHistoryController',
-
- 'edit/(?:(?P<id>\d+)/)?' => 'PhrictionEditController',
- 'delete/(?P<id>\d+)/' => 'PhrictionDeleteController',
-
- 'preview/' => 'PhrictionDocumentPreviewController',
- 'diff/(?P<id>\d+)/' => 'PhrictionDiffController',
- ),
-
'/phame/' => array(
'' => 'PhameAllPostListController',
'post/' => array(
'' => 'PhameUserPostListController',
'delete/(?P<phid>[^/]+)/' => 'PhamePostDeleteController',
'edit/(?P<phid>[^/]+)/' => 'PhamePostEditController',
'new/' => 'PhamePostEditController',
'preview/' => 'PhamePostPreviewController',
'view/(?P<phid>[^/]+)/' => 'PhamePostViewController',
),
'draft/' => array(
'' => 'PhameDraftListController',
'new/' => 'PhamePostEditController',
),
'blog/' => array(
'' => 'PhameUserBlogListController',
'all/' => 'PhameAllBlogListController',
'new/' => 'PhameBlogEditController',
'delete/(?P<phid>[^/]+)/' => 'PhameBlogDeleteController',
'edit/(?P<phid>[^/]+)/' => 'PhameBlogEditController',
'view/(?P<phid>[^/]+)/' => 'PhameBlogViewController',
),
'posts/' => array(
'' => 'PhameUserPostListController',
'(?P<bloggername>\w+)/' => 'PhameBloggerPostListController',
'(?P<bloggername>\w+)/(?P<phametitle>.+/)'
=> 'PhamePostViewController',
),
),
'/calendar/' => array(
'' => 'PhabricatorCalendarBrowseController',
),
'/drydock/' => array(
'' => 'DrydockResourceListController',
'resource/' => 'DrydockResourceListController',
'resource/allocate/' => 'DrydockResourceAllocateController',
'host/' => array(
'' => 'DrydockHostListController',
'edit/' => 'DrydockHostEditController',
'edit/(?P<id>\d+)/' => 'DrydockhostEditController',
),
'lease/' => 'DrydockLeaseListController',
'log/' => 'DrydockLogController',
),
'/chatlog/' => array(
'' =>
'PhabricatorChatLogChannelListController',
'channel/(?P<channel>[^/]+)/' =>
'PhabricatorChatLogChannelLogController',
),
'/notification/' => array(
'(?:(?P<filter>all|unread)/)?'
=> 'PhabricatorNotificationListController',
'panel/' => 'PhabricatorNotificationPanelController',
'individual/' => 'PhabricatorNotificationIndividualController',
'status/' => 'PhabricatorNotificationStatusController',
'clear/' => 'PhabricatorNotificationClearController',
),
- '/flag/' => array(
- '' => 'PhabricatorFlagListController',
- 'view/(?P<view>[^/]+)/' => 'PhabricatorFlagListController',
- 'edit/(?P<phid>[^/]+)/' => 'PhabricatorFlagEditController',
- 'delete/(?P<id>\d+)/' => 'PhabricatorFlagDeleteController',
- ),
-
'/phortune/' => array(
'stripe/' => array(
'testpaymentform/' => 'PhortuneStripeTestPaymentFormController',
),
),
'/emailverify/(?P<code>[^/]+)/' =>
'PhabricatorEmailVerificationController',
- ) + $this->getApplicationRoutes();
+ );
}
protected function getResourceURIMapRules() {
return array(
'/res/' => array(
'(?P<package>pkg/)?'.
'(?P<hash>[a-f0-9]{8})/'.
'(?P<path>.+\.(?:css|js|jpg|png|swf|gif))'
=> 'CelerityResourceController',
),
);
}
- private function getApplicationRoutes() {
- $applications = PhabricatorApplication::getAllInstalledApplications();
- $routes = array();
- foreach ($applications as $application) {
- $routes += $application->getRoutes();
- }
- return $routes;
- }
-
public function buildRequest() {
$request = new AphrontRequest($this->getHost(), $this->getPath());
$request->setRequestData($_GET + $_POST);
$request->setApplicationConfiguration($this);
return $request;
}
public function handleException(Exception $ex) {
$request = $this->getRequest();
// For Conduit requests, return a Conduit response.
if ($request->isConduit()) {
$response = new ConduitAPIResponse();
$response->setErrorCode(get_class($ex));
$response->setErrorInfo($ex->getMessage());
return id(new AphrontJSONResponse())
->setContent($response->toDictionary());
}
// For non-workflow requests, return a Ajax response.
if ($request->isAjax() && !$request->isJavelinWorkflow()) {
$response = new AphrontAjaxResponse();
$response->setError(
array(
'code' => get_class($ex),
'info' => $ex->getMessage(),
));
return $response;
}
$is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business');
$user = $request->getUser();
if (!$user) {
// If we hit an exception very early, we won't have a user.
$user = new PhabricatorUser();
}
if ($ex instanceof PhabricatorPolicyException) {
$content =
'<div class="aphront-policy-exception">'.
phutil_escape_html($ex->getMessage()).
'</div>';
$dialog = new AphrontDialogView();
$dialog
->setTitle(
$is_serious
? 'Access Denied'
: "You Shall Not Pass")
->setClass('aphront-access-dialog')
->setUser($user)
->appendChild($content);
if ($this->getRequest()->isAjax()) {
$dialog->addCancelButton('/', 'Close');
} else {
$dialog->addCancelButton('/', $is_serious ? 'OK' : 'Away With Thee');
}
$response = new AphrontDialogResponse();
$response->setDialog($dialog);
return $response;
}
if ($ex instanceof AphrontUsageException) {
$error = new AphrontErrorView();
$error->setTitle(phutil_escape_html($ex->getTitle()));
$error->appendChild(phutil_escape_html($ex->getMessage()));
$view = new PhabricatorStandardPageView();
$view->setRequest($this->getRequest());
$view->appendChild($error);
$response = new AphrontWebpageResponse();
$response->setContent($view->render());
return $response;
}
// Always log the unhandled exception.
phlog($ex);
$class = phutil_escape_html(get_class($ex));
$message = phutil_escape_html($ex->getMessage());
if ($ex instanceof AphrontQuerySchemaException) {
$message .=
"\n\n".
"NOTE: This usually indicates that the MySQL schema has not been ".
"properly upgraded. Run 'bin/storage upgrade' to ensure your ".
"schema is up to date.";
}
if (PhabricatorEnv::getEnvConfig('phabricator.show-stack-traces')) {
$trace = $this->renderStackTrace($ex->getTrace(), $user);
} else {
$trace = null;
}
$content =
'<div class="aphront-unhandled-exception">'.
'<div class="exception-message">'.$message.'</div>'.
$trace.
'</div>';
$dialog = new AphrontDialogView();
$dialog
->setTitle('Unhandled Exception ("'.$class.'")')
->setClass('aphront-exception-dialog')
->setUser($user)
->appendChild($content);
if ($this->getRequest()->isAjax()) {
$dialog->addCancelButton('/', 'Close');
}
$response = new AphrontDialogResponse();
$response->setDialog($dialog);
return $response;
}
public function willSendResponse(AphrontResponse $response) {
$request = $this->getRequest();
$response->setRequest($request);
if ($response instanceof AphrontDialogResponse) {
if (!$request->isAjax()) {
$view = new PhabricatorStandardPageView();
$view->setRequest($request);
$view->appendChild(
'<div style="padding: 2em 0;">'.
$response->buildResponseString().
'</div>');
$response = new AphrontWebpageResponse();
$response->setContent($view->render());
return $response;
} else {
return id(new AphrontAjaxResponse())
->setContent(array(
'dialog' => $response->buildResponseString(),
));
}
} else if ($response instanceof AphrontRedirectResponse) {
if ($request->isAjax()) {
return id(new AphrontAjaxResponse())
->setContent(
array(
'redirect' => $response->getURI(),
));
}
}
return $response;
}
public function build404Controller() {
return array(new Phabricator404Controller($this->getRequest()), array());
}
public function buildRedirectController($uri) {
return array(
new PhabricatorRedirectController($this->getRequest()),
array(
'uri' => $uri,
));
}
private function renderStackTrace($trace, PhabricatorUser $user) {
$libraries = PhutilBootloader::getInstance()->getAllLibraries();
$version = PhabricatorEnv::getEnvConfig('phabricator.version');
if (preg_match('/[^a-f0-9]/i', $version)) {
$version = '';
}
// TODO: Make this configurable?
$path = 'https://secure.phabricator.com/diffusion/%s/browse/master/src/';
$callsigns = array(
'arcanist' => 'ARC',
'phutil' => 'PHU',
'phabricator' => 'P',
);
$rows = array();
$depth = count($trace);
foreach ($trace as $part) {
$lib = null;
$file = idx($part, 'file');
$relative = $file;
foreach ($libraries as $library) {
$root = phutil_get_library_root($library);
if (Filesystem::isDescendant($file, $root)) {
$lib = $library;
$relative = Filesystem::readablePath($file, $root);
break;
}
}
$where = '';
if (isset($part['class'])) {
$where .= $part['class'].'::';
}
if (isset($part['function'])) {
$where .= $part['function'].'()';
}
if ($file) {
if (isset($callsigns[$lib])) {
$attrs = array('title' => $file);
try {
$attrs['href'] = $user->loadEditorLink(
'/src/'.$relative,
$part['line'],
$callsigns[$lib]);
} catch (Exception $ex) {
// The database can be inaccessible.
}
if (empty($attrs['href'])) {
$attrs['href'] = sprintf($path, $callsigns[$lib]).
str_replace(DIRECTORY_SEPARATOR, '/', $relative).
($version && $lib == 'phabricator' ? ';'.$version : '').
'$'.$part['line'];
$attrs['target'] = '_blank';
}
$file_name = phutil_render_tag(
'a',
$attrs,
phutil_escape_html($relative));
} else {
$file_name = phutil_render_tag(
'span',
array(
'title' => $file,
),
phutil_escape_html($relative));
}
$file_name = $file_name.' : '.(int)$part['line'];
} else {
$file_name = '<em>(Internal)</em>';
}
$rows[] = array(
$depth--,
phutil_escape_html($lib),
$file_name,
phutil_escape_html($where),
);
}
$table = new AphrontTableView($rows);
$table->setHeaders(
array(
'Depth',
'Library',
'File',
'Where',
));
$table->setColumnClasses(
array(
'n',
'',
'',
'wide',
));
return
'<div class="exception-trace">'.
'<div class="exception-trace-header">Stack Trace</div>'.
$table->render().
'</div>';
}
}
diff --git a/src/applications/audit/application/PhabricatorApplicationAudit.php b/src/applications/audit/application/PhabricatorApplicationAudit.php
index 6bfd190515..02b15ab5e9 100644
--- a/src/applications/audit/application/PhabricatorApplicationAudit.php
+++ b/src/applications/audit/application/PhabricatorApplicationAudit.php
@@ -1,73 +1,84 @@
<?php
/*
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
final class PhabricatorApplicationAudit extends PhabricatorApplication {
public function getShortDescription() {
return 'Audit Code';
}
public function getBaseURI() {
return '/audit/';
}
-
public function getIconURI() {
return celerity_get_resource_uri('/rsrc/image/app/app_audit.png');
}
+ public function getRoutes() {
+ return array(
+ '/audit/' => array(
+ '' => 'PhabricatorAuditListController',
+ 'view/(?P<filter>[^/]+)/(?:(?P<name>[^/]+)/)?'
+ => 'PhabricatorAuditListController',
+ 'addcomment/' => 'PhabricatorAuditAddCommentController',
+ 'preview/(?P<id>\d+)/' => 'PhabricatorAuditPreviewController',
+ ),
+ );
+ }
+
public function loadStatus(PhabricatorUser $user) {
$status = array();
$phids = PhabricatorAuditCommentEditor::loadAuditPHIDsForUser($user);
$audits = id(new PhabricatorAuditQuery())
->withAuditorPHIDs($phids)
->withStatus(PhabricatorAuditQuery::STATUS_OPEN)
->withAwaitingUser($user)
->execute();
$count = count($audits);
$type = $count
? PhabricatorApplicationStatusView::TYPE_INFO
: PhabricatorApplicationStatusView::TYPE_EMPTY;
$status[] = id(new PhabricatorApplicationStatusView())
->setType($type)
->setText(pht('%d Commit(s) Awaiting Audit', $count))
->setCount($count);
$commits = id(new PhabricatorAuditCommitQuery())
->withAuthorPHIDs($phids)
->withStatus(PhabricatorAuditQuery::STATUS_OPEN)
->execute();
$count = count($commits);
$type = $count
? PhabricatorApplicationStatusView::TYPE_NEEDS_ATTENTION
: PhabricatorApplicationStatusView::TYPE_EMPTY;
$status[] = id(new PhabricatorApplicationStatusView())
->setType($type)
->setText(pht('%d Problem Commit(s)', $count))
->setCount($count);
return $status;
}
}
diff --git a/src/applications/differential/application/PhabricatorApplicationDifferential.php b/src/applications/differential/application/PhabricatorApplicationDifferential.php
index 7f22c36a7b..72de852a8d 100644
--- a/src/applications/differential/application/PhabricatorApplicationDifferential.php
+++ b/src/applications/differential/application/PhabricatorApplicationDifferential.php
@@ -1,72 +1,102 @@
<?php
/*
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
final class PhabricatorApplicationDifferential extends PhabricatorApplication {
public function getBaseURI() {
return '/differential/';
}
public function getShortDescription() {
return 'Review Code';
}
public function getIconURI() {
return celerity_get_resource_uri('/rsrc/image/app/app_differential.png');
}
public function getFactObjectsForAnalysis() {
return array(
new DifferentialRevision(),
);
}
+ public function getRoutes() {
+ return array(
+ '/D(?P<id>\d+)' => 'DifferentialRevisionViewController',
+ '/differential/' => array(
+ '' => 'DifferentialRevisionListController',
+ 'filter/(?P<filter>\w+)/(?:(?P<username>\w+)/)?' =>
+ 'DifferentialRevisionListController',
+ 'stats/(?P<filter>\w+)/' => 'DifferentialRevisionStatsController',
+ 'diff/' => array(
+ '(?P<id>\d+)/' => 'DifferentialDiffViewController',
+ 'create/' => 'DifferentialDiffCreateController',
+ ),
+ 'changeset/' => 'DifferentialChangesetViewController',
+ 'revision/edit/(?:(?P<id>\d+)/)?'
+ => 'DifferentialRevisionEditController',
+ 'comment/' => array(
+ 'preview/(?P<id>\d+)/' => 'DifferentialCommentPreviewController',
+ 'save/' => 'DifferentialCommentSaveController',
+ 'inline/' => array(
+ 'preview/(?P<id>\d+)/' =>
+ 'DifferentialInlineCommentPreviewController',
+ 'edit/(?P<id>\d+)/' => 'DifferentialInlineCommentEditController',
+ ),
+ ),
+ 'subscribe/(?P<action>add|rem)/(?P<id>\d+)/'
+ => 'DifferentialSubscribeController',
+ ),
+ );
+ }
+
public function loadStatus(PhabricatorUser $user) {
$revisions = id(new DifferentialRevisionQuery())
->withResponsibleUsers(array($user->getPHID()))
->withStatus(DifferentialRevisionQuery::STATUS_OPEN)
->execute();
list($active, $waiting) = DifferentialRevisionQuery::splitResponsible(
$revisions,
$user->getPHID());
$status = array();
$active = count($active);
$type = $active
? PhabricatorApplicationStatusView::TYPE_NEEDS_ATTENTION
: PhabricatorApplicationStatusView::TYPE_EMPTY;
$status[] = id(new PhabricatorApplicationStatusView())
->setType($type)
->setText(pht('%d Review(s) Need Attention', $active))
->setCount($active);
$waiting = count($waiting);
$type = $waiting
? PhabricatorApplicationStatusView::TYPE_INFO
: PhabricatorApplicationStatusView::TYPE_EMPTY;
$status[] = id(new PhabricatorApplicationStatusView())
->setType($type)
->setText(pht('%d Review(s) Waiting on Others', $waiting));
return $status;
}
}
diff --git a/src/applications/diffusion/application/PhabricatorApplicationDiffusion.php b/src/applications/diffusion/application/PhabricatorApplicationDiffusion.php
index da1924d46c..8182a4d0ab 100644
--- a/src/applications/diffusion/application/PhabricatorApplicationDiffusion.php
+++ b/src/applications/diffusion/application/PhabricatorApplicationDiffusion.php
@@ -1,34 +1,74 @@
<?php
/*
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
final class PhabricatorApplicationDiffusion extends PhabricatorApplication {
public function getShortDescription() {
return 'Repository Browser';
}
public function getBaseURI() {
return '/diffusion/';
}
public function getIconURI() {
return celerity_get_resource_uri('/rsrc/image/app/app_diffusion.png');
}
+ public function getRoutes() {
+ return array(
+ '/r(?P<callsign>[A-Z]+)(?P<commit>[a-z0-9]+)'
+ => 'DiffusionCommitController',
+ '/diffusion/' => array(
+ '' => 'DiffusionHomeController',
+ '(?P<callsign>[A-Z]+)/' => array(
+ '' => 'DiffusionRepositoryController',
+
+ 'repository/(?P<dblob>.*)' => 'DiffusionRepositoryController',
+ 'change/(?P<dblob>.*)' => 'DiffusionChangeController',
+ 'history/(?P<dblob>.*)' => 'DiffusionHistoryController',
+ 'browse/(?P<dblob>.*)' => 'DiffusionBrowseController',
+ 'lastmodified/(?P<dblob>.*)' => 'DiffusionLastModifiedController',
+ 'diff/' => 'DiffusionDiffController',
+ 'tags/(?P<dblob>.*)' => 'DiffusionTagListController',
+ 'branches/(?P<dblob>.*)' => 'DiffusionBranchTableController',
+
+ 'commit/(?P<commit>[a-z0-9]+)/branches/'
+ => 'DiffusionCommitBranchesController',
+ 'commit/(?P<commit>[a-z0-9]+)/tags/'
+ => 'DiffusionCommitTagsController',
+ ),
+ 'inline/' => array(
+ 'edit/(?P<phid>[^/]+)/' => 'DiffusionInlineCommentController',
+ 'preview/(?P<phid>[^/]+)/' =>
+ 'DiffusionInlineCommentPreviewController',
+ ),
+ 'services/' => array(
+ 'path/' => array(
+ 'complete/' => 'DiffusionPathCompleteController',
+ 'validate/' => 'DiffusionPathValidateController',
+ ),
+ ),
+ 'symbol/(?P<name>[^/]+)/' => 'DiffusionSymbolController',
+ 'external/' => 'DiffusionExternalController',
+ ),
+ );
+ }
+
}
diff --git a/src/applications/flag/application/PhabricatorApplicationFlags.php b/src/applications/flag/application/PhabricatorApplicationFlags.php
index b60f441c8e..029666c80a 100644
--- a/src/applications/flag/application/PhabricatorApplicationFlags.php
+++ b/src/applications/flag/application/PhabricatorApplicationFlags.php
@@ -1,53 +1,64 @@
<?php
/*
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
final class PhabricatorApplicationFlags extends PhabricatorApplication {
public function getShortDescription() {
return 'Reminders';
}
public function getBaseURI() {
return '/flag/';
}
public function getIconURI() {
return celerity_get_resource_uri('/rsrc/image/app/app_flags.png');
}
public function loadStatus(PhabricatorUser $user) {
$status = array();
$flags = id(new PhabricatorFlagQuery())
->withOwnerPHIDs(array($user->getPHID()))
->execute();
$count = count($flags);
$type = $count
? PhabricatorApplicationStatusView::TYPE_INFO
: PhabricatorApplicationStatusView::TYPE_EMPTY;
$status[] = id(new PhabricatorApplicationStatusView())
->setType($type)
->setText(pht('%d Flagged Object(s)', $count))
->setCount($count);
return $status;
}
+ public function getRoutes() {
+ return array(
+ '/flag/' => array(
+ '' => 'PhabricatorFlagListController',
+ 'view/(?P<view>[^/]+)/' => 'PhabricatorFlagListController',
+ 'edit/(?P<phid>[^/]+)/' => 'PhabricatorFlagEditController',
+ 'delete/(?P<id>\d+)/' => 'PhabricatorFlagDeleteController',
+ ),
+ );
+ }
+
}
diff --git a/src/applications/maniphest/application/PhabricatorApplicationManiphest.php b/src/applications/maniphest/application/PhabricatorApplicationManiphest.php
index 98c0035d32..5982b69a60 100644
--- a/src/applications/maniphest/application/PhabricatorApplicationManiphest.php
+++ b/src/applications/maniphest/application/PhabricatorApplicationManiphest.php
@@ -1,81 +1,112 @@
<?php
/*
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
final class PhabricatorApplicationManiphest extends PhabricatorApplication {
public function getShortDescription() {
return 'Tasks and Bugs';
}
public function getBaseURI() {
return '/maniphest/';
}
public function isEnabled() {
return PhabricatorEnv::getEnvConfig('maniphest.enabled');
}
public function getIconURI() {
return celerity_get_resource_uri('/rsrc/image/app/app_maniphest.png');
}
public function getFactObjectsForAnalysis() {
return array(
new ManiphestTask(),
);
}
+ public function getRoutes() {
+ return array(
+ '/T(?P<id>\d+)' => 'ManiphestTaskDetailController',
+ '/maniphest/' => array(
+ '' => 'ManiphestTaskListController',
+ 'view/(?P<view>\w+)/' => 'ManiphestTaskListController',
+ 'report/(?:(?P<view>\w+)/)?' => 'ManiphestReportController',
+ 'batch/' => 'ManiphestBatchEditController',
+ 'task/' => array(
+ 'create/' => 'ManiphestTaskEditController',
+ 'edit/(?P<id>\d+)/' => 'ManiphestTaskEditController',
+ 'descriptionchange/(?:(?P<id>\d+)/)?' =>
+ 'ManiphestTaskDescriptionChangeController',
+ 'descriptionpreview/' =>
+ 'ManiphestTaskDescriptionPreviewController',
+ ),
+ 'transaction/' => array(
+ 'save/' => 'ManiphestTransactionSaveController',
+ 'preview/(?P<id>\d+)/' => 'ManiphestTransactionPreviewController',
+ ),
+ 'export/(?P<key>[^/]+)/' => 'ManiphestExportController',
+ 'subpriority/' => 'ManiphestSubpriorityController',
+ 'custom/' => array(
+ '' => 'ManiphestSavedQueryListController',
+ 'edit/(?:(?P<id>\d+)/)?' => 'ManiphestSavedQueryEditController',
+ 'delete/(?P<id>\d+)/' => 'ManiphestSavedQueryDeleteController',
+ ),
+ ),
+ );
+ }
+
public function loadStatus(PhabricatorUser $user) {
$status = array();
$query = id(new ManiphestTaskQuery())
->withStatus(ManiphestTaskQuery::STATUS_OPEN)
->withPriority(ManiphestTaskPriority::PRIORITY_UNBREAK_NOW)
->setLimit(1)
->setCalculateRows(true);
$query->execute();
$count = $query->getRowCount();
$type = $count
? PhabricatorApplicationStatusView::TYPE_NEEDS_ATTENTION
: PhabricatorApplicationStatusView::TYPE_EMPTY;
$status[] = id(new PhabricatorApplicationStatusView())
->setType($type)
->setText(pht('%d Unbreak Now Task(s)!', $count))
->setCount($count);
$query = id(new ManiphestTaskQuery())
->withStatus(ManiphestTaskQuery::STATUS_OPEN)
->withOwners(array($user->getPHID()))
->setLimit(1)
->setCalculateRows(true);
$query->execute();
$count = $query->getRowCount();
$type = $count
? PhabricatorApplicationStatusView::TYPE_INFO
: PhabricatorApplicationStatusView::TYPE_EMPTY;
$status[] = id(new PhabricatorApplicationStatusView())
->setType($type)
->setText(pht('%d Assigned Task(s)', $count));
return $status;
}
}
diff --git a/src/applications/phriction/application/PhabricatorApplicationPhriction.php b/src/applications/phriction/application/PhabricatorApplicationPhriction.php
index 80e94b29db..02c0d67a41 100644
--- a/src/applications/phriction/application/PhabricatorApplicationPhriction.php
+++ b/src/applications/phriction/application/PhabricatorApplicationPhriction.php
@@ -1,35 +1,57 @@
<?php
/*
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
final class PhabricatorApplicationPhriction extends PhabricatorApplication {
public function getShortDescription() {
return 'Wiki';
}
public function getBaseURI() {
return '/w/';
}
public function getIconURI() {
return celerity_get_resource_uri('/rsrc/image/app/app_phriction.png');
}
+ public function getRoutes() {
+ return array(
+ // Match "/w/" with slug "/".
+ '/w(?P<slug>/)' => 'PhrictionDocumentController',
+ // Match "/w/x/y/z/" with slug "x/y/z/".
+ '/w/(?P<slug>.+/)' => 'PhrictionDocumentController',
+
+ '/phriction/' => array(
+ '' => 'PhrictionListController',
+ 'list/(?P<view>[^/]+)/' => 'PhrictionListController',
+
+ 'history(?P<slug>/)' => 'PhrictionHistoryController',
+ 'history/(?P<slug>.+/)' => 'PhrictionHistoryController',
+
+ 'edit/(?:(?P<id>\d+)/)?' => 'PhrictionEditController',
+ 'delete/(?P<id>\d+)/' => 'PhrictionDeleteController',
+
+ 'preview/' => 'PhrictionDocumentPreviewController',
+ 'diff/(?P<id>\d+)/' => 'PhrictionDiffController',
+ ),
+ );
+ }
}

File Metadata

Mime Type
text/x-diff
Expires
Fri, Nov 14, 5:27 AM (1 d, 1 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
336794
Default Alt Text
(51 KB)

Event Timeline