Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/differential/application/PhabricatorDifferentialApplication.php
12256 views
1
<?php
2
3
final class PhabricatorDifferentialApplication
4
extends PhabricatorApplication {
5
6
public function getBaseURI() {
7
return '/differential/';
8
}
9
10
public function getName() {
11
return pht('Differential');
12
}
13
14
public function getShortDescription() {
15
return pht('Pre-Commit Review');
16
}
17
18
public function getIcon() {
19
return 'fa-cog';
20
}
21
22
public function isPinnedByDefault(PhabricatorUser $viewer) {
23
return true;
24
}
25
26
public function getHelpDocumentationArticles(PhabricatorUser $viewer) {
27
return array(
28
array(
29
'name' => pht('Differential User Guide'),
30
'href' => PhabricatorEnv::getDoclink('Differential User Guide'),
31
),
32
);
33
}
34
35
public function getTitleGlyph() {
36
return "\xE2\x9A\x99";
37
}
38
39
public function getOverview() {
40
return pht(
41
'Differential is a **code review application** which allows '.
42
'engineers to review, discuss and approve changes to software.');
43
}
44
45
public function getRoutes() {
46
return array(
47
'/D(?P<id>[1-9]\d*)' => array(
48
'' => 'DifferentialRevisionViewController',
49
'/(?P<filter>new)/' => 'DifferentialRevisionViewController',
50
),
51
'/differential/' => array(
52
$this->getQueryRoutePattern() => 'DifferentialRevisionListController',
53
'diff/' => array(
54
'(?P<id>[1-9]\d*)/' => array(
55
'' => 'DifferentialDiffViewController',
56
'changesets/' => array(
57
$this->getQueryRoutePattern()
58
=> 'DifferentialChangesetListController',
59
),
60
),
61
'create/' => 'DifferentialDiffCreateController',
62
),
63
'changeset/' => 'DifferentialChangesetViewController',
64
'revision/' => array(
65
$this->getEditRoutePattern('edit/')
66
=> 'DifferentialRevisionEditController',
67
$this->getEditRoutePattern('attach/(?P<diffID>[^/]+)/to/')
68
=> 'DifferentialRevisionEditController',
69
'closedetails/(?P<phid>[^/]+)/'
70
=> 'DifferentialRevisionCloseDetailsController',
71
'update/(?P<revisionID>[1-9]\d*)/'
72
=> 'DifferentialDiffCreateController',
73
'operation/(?P<id>[1-9]\d*)/'
74
=> 'DifferentialRevisionOperationController',
75
'inlines/(?P<id>[1-9]\d*)/'
76
=> 'DifferentialRevisionInlinesController',
77
'paths/(?P<id>[1-9]\d*)/'
78
=> 'DifferentialRevisionAffectedPathsController',
79
),
80
'comment/' => array(
81
'inline/' => array(
82
'edit/(?P<id>[1-9]\d*)/'
83
=> 'DifferentialInlineCommentEditController',
84
),
85
),
86
'preview/' => 'PhabricatorMarkupPreviewController',
87
),
88
);
89
}
90
91
public function getApplicationOrder() {
92
return 0.100;
93
}
94
95
public function getRemarkupRules() {
96
return array(
97
new DifferentialRemarkupRule(),
98
);
99
}
100
101
public function supportsEmailIntegration() {
102
return true;
103
}
104
105
public function getAppEmailBlurb() {
106
return pht(
107
'Send email to these addresses to create revisions. The body of the '.
108
'message and / or one or more attachments should be the output of a '.
109
'"diff" command. %s',
110
phutil_tag(
111
'a',
112
array(
113
'href' => $this->getInboundEmailSupportLink(),
114
),
115
pht('Learn More')));
116
}
117
118
protected function getCustomCapabilities() {
119
return array(
120
DifferentialDefaultViewCapability::CAPABILITY => array(
121
'caption' => pht('Default view policy for newly created revisions.'),
122
'template' => DifferentialRevisionPHIDType::TYPECONST,
123
'capability' => PhabricatorPolicyCapability::CAN_VIEW,
124
),
125
);
126
}
127
128
public function getMailCommandObjects() {
129
return array(
130
'revision' => array(
131
'name' => pht('Email Commands: Revisions'),
132
'header' => pht('Interacting with Differential Revisions'),
133
'object' => new DifferentialRevision(),
134
'summary' => pht(
135
'This page documents the commands you can use to interact with '.
136
'revisions in Differential.'),
137
),
138
);
139
}
140
141
public function getApplicationSearchDocumentTypes() {
142
return array(
143
DifferentialRevisionPHIDType::TYPECONST,
144
);
145
}
146
147
}
148
149