pht('Diffusion User Guide'), 'href' => PhabricatorEnv::getDoclink('Diffusion User Guide'), ), array( 'name' => pht('Audit User Guide'), 'href' => PhabricatorEnv::getDoclink('Audit User Guide'), ), ); } public function getRemarkupRules() { return array( new DiffusionCommitRemarkupRule(), new DiffusionRepositoryRemarkupRule(), new DiffusionRepositoryByIDRemarkupRule(), ); } public function getRoutes() { $repository_routes = array( '/' => array( '' => 'DiffusionRepositoryController', 'repository/(?P.*)' => 'DiffusionRepositoryController', 'change/(?P.*)' => 'DiffusionChangeController', 'clone/' => 'DiffusionCloneController', 'history/(?P.*)' => 'DiffusionHistoryController', 'graph/(?P.*)' => 'DiffusionGraphController', 'browse/(?P.*)' => 'DiffusionBrowseController', 'document/(?P.*)' => 'DiffusionDocumentController', 'lastmodified/(?P.*)' => 'DiffusionLastModifiedController', 'diff/' => 'DiffusionDiffController', 'tags/(?P.*)' => 'DiffusionTagListController', 'branches/(?P.*)' => 'DiffusionBranchTableController', 'refs/(?P.*)' => 'DiffusionRefTableController', 'lint/(?P.*)' => 'DiffusionLintController', 'commit/(?P[a-z0-9]+)' => array( '/?' => 'DiffusionCommitController', '/branches/' => 'DiffusionCommitBranchesController', '/tags/' => 'DiffusionCommitTagsController', ), 'compare/' => 'DiffusionCompareController', 'manage/(?:(?P[^/]+)/)?' => 'DiffusionRepositoryManagePanelsController', 'uri/' => array( 'view/(?P[0-9]\d*)/' => 'DiffusionRepositoryURIViewController', 'disable/(?P[0-9]\d*)/' => 'DiffusionRepositoryURIDisableController', $this->getEditRoutePattern('edit/') => 'DiffusionRepositoryURIEditController', 'credential/(?P[0-9]\d*)/(?Pedit|remove)/' => 'DiffusionRepositoryURICredentialController', ), 'edit/' => array( 'activate/' => 'DiffusionRepositoryEditActivateController', 'dangerous/' => 'DiffusionRepositoryEditDangerousController', 'enormous/' => 'DiffusionRepositoryEditEnormousController', 'delete/' => 'DiffusionRepositoryEditDeleteController', 'update/' => 'DiffusionRepositoryEditUpdateController', 'testautomation/' => 'DiffusionRepositoryTestAutomationController', ), 'pathtree/(?P.*)' => 'DiffusionPathTreeController', ), // NOTE: This must come after the rules above; it just gives us a // catch-all for serving repositories over HTTP. We must accept requests // without the trailing "/" because SVN commands don't necessarily // include it. '(?:/.*)?' => 'DiffusionRepositoryDefaultController', ); return array( '/(?:'. 'r(?P[A-Z]+)'. '|'. 'R(?P[1-9]\d*):'. ')(?P[a-f0-9]+)' => 'DiffusionCommitController', '/source/(?P[^/]+)' => $repository_routes, '/diffusion/' => array( $this->getQueryRoutePattern() => 'DiffusionRepositoryListController', $this->getEditRoutePattern('edit/') => 'DiffusionRepositoryEditController', 'pushlog/' => array( $this->getQueryRoutePattern() => 'DiffusionPushLogListController', 'view/(?P\d+)/' => 'DiffusionPushEventViewController', ), 'pulllog/' => array( $this->getQueryRoutePattern() => 'DiffusionPullLogListController', ), '(?P[A-Z]+)' => $repository_routes, '(?P[1-9]\d*)' => $repository_routes, 'inline/' => array( 'edit/(?P[^/]+)/' => 'DiffusionInlineCommentController', 'preview/(?P[^/]+)/' => 'DiffusionInlineCommentPreviewController', ), 'services/' => array( 'path/' => array( 'complete/' => 'DiffusionPathCompleteController', 'validate/' => 'DiffusionPathValidateController', ), ), 'symbol/(?P[^/]+)/' => 'DiffusionSymbolController', 'external/' => 'DiffusionExternalController', 'lint/' => 'DiffusionLintController', 'commit/' => array( $this->getQueryRoutePattern() => 'DiffusionCommitListController', $this->getEditRoutePattern('edit/') => 'DiffusionCommitEditController', ), 'picture/(?P[0-9]\d*)/' => 'DiffusionRepositoryProfilePictureController', ), ); } public function getApplicationOrder() { return 0.120; } protected function getCustomCapabilities() { return array( DiffusionDefaultViewCapability::CAPABILITY => array( 'template' => PhabricatorRepositoryRepositoryPHIDType::TYPECONST, 'capability' => PhabricatorPolicyCapability::CAN_VIEW, ), DiffusionDefaultEditCapability::CAPABILITY => array( 'default' => PhabricatorPolicies::POLICY_ADMIN, 'template' => PhabricatorRepositoryRepositoryPHIDType::TYPECONST, 'capability' => PhabricatorPolicyCapability::CAN_EDIT, ), DiffusionDefaultPushCapability::CAPABILITY => array( 'template' => PhabricatorRepositoryRepositoryPHIDType::TYPECONST, ), DiffusionCreateRepositoriesCapability::CAPABILITY => array( 'default' => PhabricatorPolicies::POLICY_ADMIN, ), ); } public function getMailCommandObjects() { return array( 'commit' => array( 'name' => pht('Email Commands: Commits'), 'header' => pht('Interacting with Commits'), 'object' => new PhabricatorRepositoryCommit(), 'summary' => pht( 'This page documents the commands you can use to interact with '. 'commits and audits in Diffusion.'), ), ); } public function getApplicationSearchDocumentTypes() { return array( PhabricatorRepositoryCommitPHIDType::TYPECONST, ); } }