mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-25 16:22:43 +01:00
Promote 2024.35 to stable
This commit is contained in:
commit
d3c0a7edc3
317 changed files with 5977 additions and 1614 deletions
11
externals/JsShrink/jsShrink.php
vendored
11
externals/JsShrink/jsShrink.php
vendored
|
@ -11,7 +11,8 @@
|
|||
function jsShrink($input) {
|
||||
return preg_replace_callback('(
|
||||
(?:
|
||||
(^|[-+\([{}=,:;!%^&*|?~]|/(?![/*])|return|throw) # context before regexp
|
||||
(`(?:\\\\.|[^`\\\\])*`) # template literal
|
||||
|(^|[-+\([{}=,:;!%^&*|?~]|/(?![/*])|return|throw) # context before regexp
|
||||
(?:\s|//[^\n]*+\n|/\*(?:[^*]|\*(?!/))*+\*/)* # optional space
|
||||
(/(?![/*])(?:
|
||||
\\\\[^\n]
|
||||
|
@ -31,9 +32,11 @@ function jsShrink($input) {
|
|||
|
||||
function jsShrinkCallback($match) {
|
||||
static $last = '';
|
||||
$match += array_fill(1, 5, null); // avoid E_NOTICE
|
||||
list(, $context, $regexp, $result, $word, $operator) = $match;
|
||||
if ($word != '') {
|
||||
$match += array_fill(1, 7, null); // avoid E_NOTICE
|
||||
list(, $template, $context, $regexp, $result, $word, $operator) = $match;
|
||||
if ($template) {
|
||||
$result = $template;
|
||||
} elseif ($word != '') {
|
||||
$result = ($last == 'word' ? "\n" : ($last == 'return' ? " " : "")) . $result;
|
||||
$last = ($word == 'return' || $word == 'throw' || $word == 'break' || $word == 'async' ? 'return' : 'word');
|
||||
} elseif ($operator) {
|
||||
|
|
8
externals/cldr/cldr_windows_timezones.xml
vendored
8
externals/cldr/cldr_windows_timezones.xml
vendored
|
@ -537,7 +537,8 @@ For terms of use, see http://www.unicode.org/copyright.html
|
|||
<!-- (UTC+05:00) Ashgabat, Tashkent -->
|
||||
<mapZone other="West Asia Standard Time" territory="001" type="Asia/Tashkent"/>
|
||||
<mapZone other="West Asia Standard Time" territory="AQ" type="Antarctica/Mawson"/>
|
||||
<mapZone other="West Asia Standard Time" territory="KZ" type="Asia/Oral Asia/Aqtau Asia/Aqtobe Asia/Atyrau"/>
|
||||
<!-- Microsoft may create a new zone dedicated for Almaty and Qostanay. -->
|
||||
<mapZone other="West Asia Standard Time" territory="KZ" type="Asia/Oral Asia/Almaty Asia/Aqtau Asia/Aqtobe Asia/Atyrau Asia/Qostanay"/>
|
||||
<mapZone other="West Asia Standard Time" territory="MV" type="Indian/Maldives"/>
|
||||
<mapZone other="West Asia Standard Time" territory="TF" type="Indian/Kerguelen"/>
|
||||
<mapZone other="West Asia Standard Time" territory="TJ" type="Asia/Dushanbe"/>
|
||||
|
@ -569,13 +570,12 @@ For terms of use, see http://www.unicode.org/copyright.html
|
|||
<mapZone other="Nepal Standard Time" territory="001" type="Asia/Katmandu"/>
|
||||
<mapZone other="Nepal Standard Time" territory="NP" type="Asia/Katmandu"/>
|
||||
|
||||
<!-- (UTC+06:00) Astana -->
|
||||
<mapZone other="Central Asia Standard Time" territory="001" type="Asia/Almaty"/>
|
||||
<!-- (UTC+06:00) Astana --> <!-- Microsoft probably keeps Central Asia Standard Time, but change Astana to something else. -->
|
||||
<mapZone other="Central Asia Standard Time" territory="001" type="Asia/Bishkek"/>
|
||||
<mapZone other="Central Asia Standard Time" territory="AQ" type="Antarctica/Vostok"/>
|
||||
<mapZone other="Central Asia Standard Time" territory="CN" type="Asia/Urumqi"/>
|
||||
<mapZone other="Central Asia Standard Time" territory="IO" type="Indian/Chagos"/>
|
||||
<mapZone other="Central Asia Standard Time" territory="KG" type="Asia/Bishkek"/>
|
||||
<mapZone other="Central Asia Standard Time" territory="KZ" type="Asia/Almaty Asia/Qostanay"/>
|
||||
<mapZone other="Central Asia Standard Time" territory="ZZ" type="Etc/GMT-6"/>
|
||||
|
||||
<!-- (UTC+06:00) Dhaka -->
|
||||
|
|
11
externals/phpmailer/class.phpmailer-lite.php
vendored
11
externals/phpmailer/class.phpmailer-lite.php
vendored
|
@ -1311,11 +1311,6 @@ class PHPMailerLite {
|
|||
if (!is_readable($path)) {
|
||||
throw new phpmailerException($this->Lang('file_open') . $path, self::STOP_CONTINUE);
|
||||
}
|
||||
if (function_exists('get_magic_quotes')) {
|
||||
function get_magic_quotes() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (PHP_VERSION < 6) {
|
||||
$magic_quotes = get_magic_quotes_runtime();
|
||||
set_magic_quotes_runtime(0);
|
||||
|
@ -1492,7 +1487,7 @@ class PHPMailerLite {
|
|||
$eol = "\r\n";
|
||||
$escape = '=';
|
||||
$output = '';
|
||||
while( list(, $line) = each($lines) ) {
|
||||
foreach ($lines as $line) {
|
||||
$linlen = strlen($line);
|
||||
$newline = '';
|
||||
for($i = 0; $i < $linlen; $i++) {
|
||||
|
@ -1523,7 +1518,7 @@ class PHPMailerLite {
|
|||
$newline .= $c;
|
||||
} // end of for
|
||||
$output .= $newline.$eol;
|
||||
} // end of while
|
||||
} // end of foreach
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
@ -1985,7 +1980,6 @@ class PHPMailerLite {
|
|||
'mov' => 'video/quicktime',
|
||||
'avi' => 'video/x-msvideo',
|
||||
'movie' => 'video/x-sgi-movie',
|
||||
'doc' => 'application/msword',
|
||||
'word' => 'application/msword',
|
||||
'xl' => 'application/excel',
|
||||
'eml' => 'message/rfc822'
|
||||
|
@ -2054,7 +2048,6 @@ class PHPMailerLite {
|
|||
* @param string $key_pass Password for private key
|
||||
*/
|
||||
public function DKIM_QP($txt) {
|
||||
$tmp="";
|
||||
$line="";
|
||||
for ($i=0;$i<strlen($txt);$i++) {
|
||||
$ord=ord($txt[$i]);
|
||||
|
|
11
externals/phpmailer/class.phpmailer.php
vendored
11
externals/phpmailer/class.phpmailer.php
vendored
|
@ -1443,11 +1443,6 @@ class PHPMailer {
|
|||
if (!is_readable($path)) {
|
||||
throw new phpmailerException($this->Lang('file_open') . $path, self::STOP_CONTINUE);
|
||||
}
|
||||
if (function_exists('get_magic_quotes')) {
|
||||
function get_magic_quotes() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (PHP_VERSION < 6) {
|
||||
$magic_quotes = get_magic_quotes_runtime();
|
||||
set_magic_quotes_runtime(0);
|
||||
|
@ -1624,7 +1619,7 @@ class PHPMailer {
|
|||
$eol = "\r\n";
|
||||
$escape = '=';
|
||||
$output = '';
|
||||
while( list(, $line) = each($lines) ) {
|
||||
foreach ($lines as $line) {
|
||||
$linlen = strlen($line);
|
||||
$newline = '';
|
||||
for($i = 0; $i < $linlen; $i++) {
|
||||
|
@ -1655,7 +1650,7 @@ class PHPMailer {
|
|||
$newline .= $c;
|
||||
} // end of for
|
||||
$output .= $newline.$eol;
|
||||
} // end of while
|
||||
} // end of foreach
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
@ -2123,7 +2118,6 @@ class PHPMailer {
|
|||
'mov' => 'video/quicktime',
|
||||
'avi' => 'video/x-msvideo',
|
||||
'movie' => 'video/x-sgi-movie',
|
||||
'doc' => 'application/msword',
|
||||
'word' => 'application/msword',
|
||||
'xl' => 'application/excel',
|
||||
'eml' => 'message/rfc822'
|
||||
|
@ -2192,7 +2186,6 @@ class PHPMailer {
|
|||
* @param string $key_pass Password for private key
|
||||
*/
|
||||
public function DKIM_QP($txt) {
|
||||
$tmp="";
|
||||
$line="";
|
||||
for ($i=0;$i<strlen($txt);$i++) {
|
||||
$ord=ord($txt[$i]);
|
||||
|
|
11
externals/phpmailer/class.pop3.php
vendored
11
externals/phpmailer/class.pop3.php
vendored
|
@ -142,7 +142,7 @@ class POP3 {
|
|||
* @param string $username
|
||||
* @param string $password
|
||||
*/
|
||||
public function Authorise ($host, $port = false, $tval = false, $username, $password, $debug_level = 0) {
|
||||
public function Authorise ($host, $port = false, $tval = false, $username = '', $password = '', $debug_level = 0) {
|
||||
$this->host = $host;
|
||||
|
||||
// If no port value is passed, retrieve it
|
||||
|
@ -239,16 +239,7 @@ class POP3 {
|
|||
}
|
||||
|
||||
// Increase the stream time-out
|
||||
|
||||
// Check for PHP 4.3.0 or later
|
||||
if (version_compare(phpversion(), '5.0.0', 'ge')) {
|
||||
stream_set_timeout($this->pop_conn, $tval, 0);
|
||||
} else {
|
||||
// Does not work on Windows
|
||||
if (substr(PHP_OS, 0, 3) !== 'WIN') {
|
||||
socket_set_timeout($this->pop_conn, $tval, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// Get the POP3 server response
|
||||
$pop3_response = $this->getResponse();
|
||||
|
|
1987
externals/phpqrcode/phpqrcode.php
vendored
1987
externals/phpqrcode/phpqrcode.php
vendored
File diff suppressed because it is too large
Load diff
|
@ -9,10 +9,10 @@ return array(
|
|||
'names' => array(
|
||||
'conpherence.pkg.css' => '2f25eb4f',
|
||||
'conpherence.pkg.js' => '020aebcf',
|
||||
'core.pkg.css' => '3471f5d3',
|
||||
'core.pkg.css' => 'ac619266',
|
||||
'core.pkg.js' => '2eeda9e0',
|
||||
'dark-console.pkg.js' => '187792c2',
|
||||
'differential.pkg.css' => '6d3700f0',
|
||||
'differential.pkg.css' => 'fda9518d',
|
||||
'differential.pkg.js' => '46fcb3af',
|
||||
'diffusion.pkg.css' => '354279ea',
|
||||
'diffusion.pkg.js' => '78c9885d',
|
||||
|
@ -63,7 +63,7 @@ return array(
|
|||
'rsrc/css/application/diff/diff-tree-view.css' => 'e2d3e222',
|
||||
'rsrc/css/application/diff/inline-comment-summary.css' => '81eb368d',
|
||||
'rsrc/css/application/differential/add-comment.css' => '7e5900d9',
|
||||
'rsrc/css/application/differential/changeset-view.css' => '1b0476bc',
|
||||
'rsrc/css/application/differential/changeset-view.css' => '979e688c',
|
||||
'rsrc/css/application/differential/core.css' => '7300a73e',
|
||||
'rsrc/css/application/differential/phui-inline-comment.css' => '9863a85e',
|
||||
'rsrc/css/application/differential/revision-comment.css' => '7dbc8d1d',
|
||||
|
@ -137,7 +137,7 @@ return array(
|
|||
'rsrc/css/phui/object-item/phui-oi-simple-ui.css' => '9b03a61f',
|
||||
'rsrc/css/phui/phui-action-list.css' => '1b0085b2',
|
||||
'rsrc/css/phui/phui-action-panel.css' => '6c386cbf',
|
||||
'rsrc/css/phui/phui-badge.css' => '666e25ad',
|
||||
'rsrc/css/phui/phui-badge.css' => 'd12f6f6c',
|
||||
'rsrc/css/phui/phui-basic-nav-view.css' => 'a5693cf0',
|
||||
'rsrc/css/phui/phui-big-info-view.css' => '362ad37b',
|
||||
'rsrc/css/phui/phui-box.css' => '5ed3b8cb',
|
||||
|
@ -158,7 +158,7 @@ return array(
|
|||
'rsrc/css/phui/phui-form.css' => '1f177cb7',
|
||||
'rsrc/css/phui/phui-formation-view.css' => 'd2dec8ed',
|
||||
'rsrc/css/phui/phui-head-thing.css' => 'd7f293df',
|
||||
'rsrc/css/phui/phui-header-view.css' => '36c86a58',
|
||||
'rsrc/css/phui/phui-header-view.css' => '4cd25427',
|
||||
'rsrc/css/phui/phui-hovercard.css' => '39fd2e14',
|
||||
'rsrc/css/phui/phui-icon-set-selector.css' => '19e0253b',
|
||||
'rsrc/css/phui/phui-icon.css' => '084ac612',
|
||||
|
@ -187,7 +187,7 @@ return array(
|
|||
'rsrc/css/sprite-login.css' => '07052ee0',
|
||||
'rsrc/css/sprite-tokens.css' => 'f1896dc5',
|
||||
'rsrc/css/syntax/syntax-default.css' => 'c0307dc6',
|
||||
'rsrc/externals/d3/d3.min.js' => '9d068042',
|
||||
'rsrc/externals/d3/d3.min.js' => 'e97b4b78',
|
||||
'rsrc/externals/font/fontawesome/fontawesome-webfont.eot' => '23f8c698',
|
||||
'rsrc/externals/font/fontawesome/fontawesome-webfont.ttf' => '70983df0',
|
||||
'rsrc/externals/font/fontawesome/fontawesome-webfont.woff' => 'cd02f93b',
|
||||
|
@ -396,7 +396,7 @@ return array(
|
|||
'rsrc/js/application/diffusion/behavior-pull-lastmodified.js' => 'c715c123',
|
||||
'rsrc/js/application/doorkeeper/behavior-doorkeeper-tag.js' => '6a85bc5a',
|
||||
'rsrc/js/application/drydock/drydock-live-operation-status.js' => '47a0728b',
|
||||
'rsrc/js/application/fact/Chart.js' => '52e3ff03',
|
||||
'rsrc/js/application/fact/Chart.js' => '351abd1c',
|
||||
'rsrc/js/application/fact/ChartCurtainView.js' => '86954222',
|
||||
'rsrc/js/application/fact/ChartFunctionLabel.js' => '81de1dab',
|
||||
'rsrc/js/application/files/behavior-document-engine.js' => '243d6c22',
|
||||
|
@ -558,9 +558,9 @@ return array(
|
|||
'conpherence-participant-pane-css' => '69e0058a',
|
||||
'conpherence-thread-manager' => 'aec8e38c',
|
||||
'conpherence-transaction-css' => '3a3f5e7e',
|
||||
'd3' => '9d068042',
|
||||
'd3' => 'e97b4b78',
|
||||
'diff-tree-view-css' => 'e2d3e222',
|
||||
'differential-changeset-view-css' => '1b0476bc',
|
||||
'differential-changeset-view-css' => '979e688c',
|
||||
'differential-core-view-css' => '7300a73e',
|
||||
'differential-revision-add-comment-css' => '7e5900d9',
|
||||
'differential-revision-comment-css' => '7dbc8d1d',
|
||||
|
@ -702,7 +702,7 @@ return array(
|
|||
'javelin-behavior-user-menu' => '60cd9241',
|
||||
'javelin-behavior-view-placeholder' => 'a9942052',
|
||||
'javelin-behavior-workflow' => '9623adc1',
|
||||
'javelin-chart' => '52e3ff03',
|
||||
'javelin-chart' => '351abd1c',
|
||||
'javelin-chart-curtain-view' => '86954222',
|
||||
'javelin-chart-function-label' => '81de1dab',
|
||||
'javelin-color' => '78f811c9',
|
||||
|
@ -822,7 +822,7 @@ return array(
|
|||
'phrequent-css' => 'bd79cc67',
|
||||
'phriction-document-css' => '03380da0',
|
||||
'phui-action-panel-css' => '6c386cbf',
|
||||
'phui-badge-view-css' => '666e25ad',
|
||||
'phui-badge-view-css' => 'd12f6f6c',
|
||||
'phui-basic-nav-view-css' => 'a5693cf0',
|
||||
'phui-big-info-view-css' => '362ad37b',
|
||||
'phui-box-css' => '5ed3b8cb',
|
||||
|
@ -851,7 +851,7 @@ return array(
|
|||
'phui-form-view-css' => '57edecb7',
|
||||
'phui-formation-view-css' => 'd2dec8ed',
|
||||
'phui-head-thing-view-css' => 'd7f293df',
|
||||
'phui-header-view-css' => '36c86a58',
|
||||
'phui-header-view-css' => '4cd25427',
|
||||
'phui-hovercard' => '6199f752',
|
||||
'phui-hovercard-list' => 'de4b4919',
|
||||
'phui-hovercard-view-css' => '39fd2e14',
|
||||
|
@ -1056,9 +1056,6 @@ return array(
|
|||
'javelin-util',
|
||||
'phabricator-keyboard-shortcut-manager',
|
||||
),
|
||||
'1b0476bc' => array(
|
||||
'phui-inline-comment-view-css',
|
||||
),
|
||||
'1b6acc2a' => array(
|
||||
'javelin-magical-init',
|
||||
'javelin-util',
|
||||
|
@ -1233,6 +1230,12 @@ return array(
|
|||
'aphront-typeahead-control-css',
|
||||
'phui-tag-view-css',
|
||||
),
|
||||
'351abd1c' => array(
|
||||
'phui-chart-css',
|
||||
'd3',
|
||||
'javelin-chart-curtain-view',
|
||||
'javelin-chart-function-label',
|
||||
),
|
||||
'3829a3cf' => array(
|
||||
'javelin-behavior',
|
||||
'javelin-uri',
|
||||
|
@ -1419,12 +1422,6 @@ return array(
|
|||
'javelin-dom',
|
||||
'javelin-fx',
|
||||
),
|
||||
'52e3ff03' => array(
|
||||
'phui-chart-css',
|
||||
'd3',
|
||||
'javelin-chart-curtain-view',
|
||||
'javelin-chart-function-label',
|
||||
),
|
||||
'541f81c3' => array(
|
||||
'javelin-install',
|
||||
),
|
||||
|
@ -1777,6 +1774,9 @@ return array(
|
|||
'javelin-stratcom',
|
||||
'phabricator-notification',
|
||||
),
|
||||
'979e688c' => array(
|
||||
'phui-inline-comment-view-css',
|
||||
),
|
||||
'98ef467f' => array(
|
||||
'javelin-behavior',
|
||||
'javelin-dom',
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
USE {$NAMESPACE}_file;
|
||||
DELETE FROM file_attachment
|
||||
WHERE NOT EXISTS
|
||||
(SELECT *
|
||||
FROM file
|
||||
WHERE phid=file_attachment.filePHID)
|
|
@ -436,6 +436,7 @@ phutil_register_library_map(array(
|
|||
'ConpherenceViewController' => 'applications/conpherence/controller/ConpherenceViewController.php',
|
||||
'CountdownEditConduitAPIMethod' => 'applications/countdown/conduit/CountdownEditConduitAPIMethod.php',
|
||||
'CountdownSearchConduitAPIMethod' => 'applications/countdown/conduit/CountdownSearchConduitAPIMethod.php',
|
||||
'CowsayReferenceController' => 'applications/reference/src/controller/CowsayReferenceController.php',
|
||||
'DarkConsoleController' => 'applications/console/controller/DarkConsoleController.php',
|
||||
'DarkConsoleCore' => 'applications/console/core/DarkConsoleCore.php',
|
||||
'DarkConsoleDataController' => 'applications/console/controller/DarkConsoleDataController.php',
|
||||
|
@ -1304,6 +1305,7 @@ phutil_register_library_map(array(
|
|||
'FeedStoryNotificationGarbageCollector' => 'applications/notification/garbagecollector/FeedStoryNotificationGarbageCollector.php',
|
||||
'FerretConfigurableSearchFunction' => 'applications/search/ferret/function/FerretConfigurableSearchFunction.php',
|
||||
'FerretSearchFunction' => 'applications/search/ferret/function/FerretSearchFunction.php',
|
||||
'FigletReferenceController' => 'applications/reference/src/controller/FigletReferenceController.php',
|
||||
'FileAllocateConduitAPIMethod' => 'applications/files/conduit/FileAllocateConduitAPIMethod.php',
|
||||
'FileConduitAPIMethod' => 'applications/files/conduit/FileConduitAPIMethod.php',
|
||||
'FileCreateMailReceiver' => 'applications/files/mail/FileCreateMailReceiver.php',
|
||||
|
@ -1802,6 +1804,7 @@ phutil_register_library_map(array(
|
|||
'ManiphestEditConduitAPIMethod' => 'applications/maniphest/conduit/ManiphestEditConduitAPIMethod.php',
|
||||
'ManiphestEditEngine' => 'applications/maniphest/editor/ManiphestEditEngine.php',
|
||||
'ManiphestEmailCommand' => 'applications/maniphest/command/ManiphestEmailCommand.php',
|
||||
'ManiphestFlagCustomField' => 'applications/maniphest/field/ManiphestFlagCustomField.php',
|
||||
'ManiphestGetTaskTransactionsConduitAPIMethod' => 'applications/maniphest/conduit/ManiphestGetTaskTransactionsConduitAPIMethod.php',
|
||||
'ManiphestHovercardEngineExtension' => 'applications/maniphest/engineextension/ManiphestHovercardEngineExtension.php',
|
||||
'ManiphestInfoConduitAPIMethod' => 'applications/maniphest/conduit/ManiphestInfoConduitAPIMethod.php',
|
||||
|
@ -3450,6 +3453,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorFileAES256StorageFormat' => 'applications/files/format/PhabricatorFileAES256StorageFormat.php',
|
||||
'PhabricatorFileAltTextTransaction' => 'applications/files/xaction/PhabricatorFileAltTextTransaction.php',
|
||||
'PhabricatorFileAttachment' => 'applications/files/storage/PhabricatorFileAttachment.php',
|
||||
'PhabricatorFileAttachmentDestructionEngineExtension' => 'applications/files/engineextension/PhabricatorFileAttachmentDestructionEngineExtension.php',
|
||||
'PhabricatorFileAttachmentQuery' => 'applications/files/query/PhabricatorFileAttachmentQuery.php',
|
||||
'PhabricatorFileBundleLoader' => 'applications/files/query/PhabricatorFileBundleLoader.php',
|
||||
'PhabricatorFileChunk' => 'applications/files/storage/PhabricatorFileChunk.php',
|
||||
|
@ -4490,6 +4494,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorProjectTransactionType' => 'applications/project/xaction/PhabricatorProjectTransactionType.php',
|
||||
'PhabricatorProjectTrigger' => 'applications/project/storage/PhabricatorProjectTrigger.php',
|
||||
'PhabricatorProjectTriggerAddProjectsRule' => 'applications/project/trigger/PhabricatorProjectTriggerAddProjectsRule.php',
|
||||
'PhabricatorProjectTriggerAddSubscribersRule' => 'applications/project/trigger/PhabricatorProjectTriggerAddSubscribersRule.php',
|
||||
'PhabricatorProjectTriggerController' => 'applications/project/controller/trigger/PhabricatorProjectTriggerController.php',
|
||||
'PhabricatorProjectTriggerCorruptionException' => 'applications/project/exception/PhabricatorProjectTriggerCorruptionException.php',
|
||||
'PhabricatorProjectTriggerEditController' => 'applications/project/controller/trigger/PhabricatorProjectTriggerEditController.php',
|
||||
|
@ -4504,6 +4509,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorProjectTriggerPlaySoundRule' => 'applications/project/trigger/PhabricatorProjectTriggerPlaySoundRule.php',
|
||||
'PhabricatorProjectTriggerQuery' => 'applications/project/query/PhabricatorProjectTriggerQuery.php',
|
||||
'PhabricatorProjectTriggerRemoveProjectsRule' => 'applications/project/trigger/PhabricatorProjectTriggerRemoveProjectsRule.php',
|
||||
'PhabricatorProjectTriggerRemoveSubscribersRule' => 'applications/project/trigger/PhabricatorProjectTriggerRemoveSubscribersRule.php',
|
||||
'PhabricatorProjectTriggerRule' => 'applications/project/trigger/PhabricatorProjectTriggerRule.php',
|
||||
'PhabricatorProjectTriggerRuleRecord' => 'applications/project/trigger/PhabricatorProjectTriggerRuleRecord.php',
|
||||
'PhabricatorProjectTriggerRulesetTransaction' => 'applications/project/xaction/trigger/PhabricatorProjectTriggerRulesetTransaction.php',
|
||||
|
@ -5075,6 +5081,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorTypeaheadDatasourceTestCase' => 'applications/typeahead/datasource/__tests__/PhabricatorTypeaheadDatasourceTestCase.php',
|
||||
'PhabricatorTypeaheadFunctionHelpController' => 'applications/typeahead/controller/PhabricatorTypeaheadFunctionHelpController.php',
|
||||
'PhabricatorTypeaheadInvalidTokenException' => 'applications/typeahead/exception/PhabricatorTypeaheadInvalidTokenException.php',
|
||||
'PhabricatorTypeaheadLoginRequiredException' => 'applications/typeahead/exception/PhabricatorTypeaheadLoginRequiredException.php',
|
||||
'PhabricatorTypeaheadModularDatasourceController' => 'applications/typeahead/controller/PhabricatorTypeaheadModularDatasourceController.php',
|
||||
'PhabricatorTypeaheadMonogramDatasource' => 'applications/typeahead/datasource/PhabricatorTypeaheadMonogramDatasource.php',
|
||||
'PhabricatorTypeaheadProxyDatasource' => 'applications/typeahead/datasource/PhabricatorTypeaheadProxyDatasource.php',
|
||||
|
@ -5388,6 +5395,8 @@ phutil_register_library_map(array(
|
|||
'PholioTransactionView' => 'applications/pholio/view/PholioTransactionView.php',
|
||||
'PholioUploadedImageView' => 'applications/pholio/view/PholioUploadedImageView.php',
|
||||
'PhorgeCodeWarningSetupCheck' => 'applications/config/check/PhorgeCodeWarningSetupCheck.php',
|
||||
'PhorgeFlagFlaggedObjectCustomField' => 'applications/flag/customfield/PhorgeFlagFlaggedObjectCustomField.php',
|
||||
'PhorgeFlagFlaggedObjectFieldStorage' => 'applications/flag/customfield/PhorgeFlagFlaggedObjectFieldStorage.php',
|
||||
'PhorgeSystemDeprecationWarningListener' => 'applications/system/events/PhorgeSystemDeprecationWarningListener.php',
|
||||
'PhortuneAccount' => 'applications/phortune/storage/PhortuneAccount.php',
|
||||
'PhortuneAccountAddManagerController' => 'applications/phortune/controller/account/PhortuneAccountAddManagerController.php',
|
||||
|
@ -5609,6 +5618,7 @@ phutil_register_library_map(array(
|
|||
'PhrictionDocumentDatasource' => 'applications/phriction/typeahead/PhrictionDocumentDatasource.php',
|
||||
'PhrictionDocumentDeleteTransaction' => 'applications/phriction/xaction/PhrictionDocumentDeleteTransaction.php',
|
||||
'PhrictionDocumentDraftTransaction' => 'applications/phriction/xaction/PhrictionDocumentDraftTransaction.php',
|
||||
'PhrictionDocumentEditConduitAPIMethod' => 'applications/phriction/conduit/PhrictionDocumentEditConduitAPIMethod.php',
|
||||
'PhrictionDocumentEditEngine' => 'applications/phriction/editor/PhrictionDocumentEditEngine.php',
|
||||
'PhrictionDocumentEditTransaction' => 'applications/phriction/xaction/PhrictionDocumentEditTransaction.php',
|
||||
'PhrictionDocumentFerretEngine' => 'applications/phriction/search/PhrictionDocumentFerretEngine.php',
|
||||
|
@ -5790,6 +5800,8 @@ phutil_register_library_map(array(
|
|||
'PhutilTranslatedHTMLTestCase' => 'infrastructure/markup/__tests__/PhutilTranslatedHTMLTestCase.php',
|
||||
'PhutilTwitchAuthAdapter' => 'applications/auth/adapter/PhutilTwitchAuthAdapter.php',
|
||||
'PhutilTwitterAuthAdapter' => 'applications/auth/adapter/PhutilTwitterAuthAdapter.php',
|
||||
'PhutilURIHelper' => 'infrastructure/parser/PhutilURIHelper.php',
|
||||
'PhutilURIHelperTestCase' => 'infrastructure/parser/__tests__/PhutilURIHelperTestCase.php',
|
||||
'PhutilWordPressAuthAdapter' => 'applications/auth/adapter/PhutilWordPressAuthAdapter.php',
|
||||
'PhutilXHPASTSyntaxHighlighter' => 'infrastructure/markup/syntax/highlighter/PhutilXHPASTSyntaxHighlighter.php',
|
||||
'PhutilXHPASTSyntaxHighlighterFuture' => 'infrastructure/markup/syntax/highlighter/xhpast/PhutilXHPASTSyntaxHighlighterFuture.php',
|
||||
|
@ -5871,7 +5883,11 @@ phutil_register_library_map(array(
|
|||
'ProjectSearchConduitAPIMethod' => 'applications/project/conduit/ProjectSearchConduitAPIMethod.php',
|
||||
'QueryFormattingTestCase' => 'infrastructure/storage/__tests__/QueryFormattingTestCase.php',
|
||||
'QueryFuture' => 'infrastructure/storage/future/QueryFuture.php',
|
||||
'ReferenceApplication' => 'applications/reference/src/application/ReferenceApplication.php',
|
||||
'ReferenceController' => 'applications/reference/src/controller/ReferenceController.php',
|
||||
'RemarkupProcessConduitAPIMethod' => 'applications/remarkup/conduit/RemarkupProcessConduitAPIMethod.php',
|
||||
'RemarkupReferenceController' => 'applications/reference/src/controller/RemarkupReferenceController.php',
|
||||
'RemarkupSyntaxDocumentationProvider' => 'infrastructure/markup/interface/RemarkupSyntaxDocumentationProvider.php',
|
||||
'RemarkupValue' => 'applications/remarkup/RemarkupValue.php',
|
||||
'RepositoryConduitAPIMethod' => 'applications/repository/conduit/RepositoryConduitAPIMethod.php',
|
||||
'RepositoryQueryConduitAPIMethod' => 'applications/repository/conduit/RepositoryQueryConduitAPIMethod.php',
|
||||
|
@ -6437,6 +6453,7 @@ phutil_register_library_map(array(
|
|||
'ConpherenceViewController' => 'ConpherenceController',
|
||||
'CountdownEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod',
|
||||
'CountdownSearchConduitAPIMethod' => 'PhabricatorSearchEngineAPIMethod',
|
||||
'CowsayReferenceController' => 'ReferenceController',
|
||||
'DarkConsoleController' => 'PhabricatorController',
|
||||
'DarkConsoleCore' => 'Phobject',
|
||||
'DarkConsoleDataController' => 'PhabricatorController',
|
||||
|
@ -7397,6 +7414,7 @@ phutil_register_library_map(array(
|
|||
'FeedStoryNotificationGarbageCollector' => 'PhabricatorGarbageCollector',
|
||||
'FerretConfigurableSearchFunction' => 'FerretSearchFunction',
|
||||
'FerretSearchFunction' => 'Phobject',
|
||||
'FigletReferenceController' => 'ReferenceController',
|
||||
'FileAllocateConduitAPIMethod' => 'FileConduitAPIMethod',
|
||||
'FileConduitAPIMethod' => 'ConduitAPIMethod',
|
||||
'FileCreateMailReceiver' => 'PhabricatorApplicationMailReceiver',
|
||||
|
@ -8008,6 +8026,7 @@ phutil_register_library_map(array(
|
|||
'ManiphestEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod',
|
||||
'ManiphestEditEngine' => 'PhabricatorEditEngine',
|
||||
'ManiphestEmailCommand' => 'MetaMTAEmailTransactionCommand',
|
||||
'ManiphestFlagCustomField' => 'ManiphestCustomField',
|
||||
'ManiphestGetTaskTransactionsConduitAPIMethod' => 'ManiphestConduitAPIMethod',
|
||||
'ManiphestHovercardEngineExtension' => 'PhabricatorHovercardEngineExtension',
|
||||
'ManiphestInfoConduitAPIMethod' => 'ManiphestConduitAPIMethod',
|
||||
|
@ -9906,6 +9925,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorPolicyInterface',
|
||||
'PhabricatorExtendedPolicyInterface',
|
||||
),
|
||||
'PhabricatorFileAttachmentDestructionEngineExtension' => 'PhabricatorDestructionEngineExtension',
|
||||
'PhabricatorFileAttachmentQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||
'PhabricatorFileBundleLoader' => 'Phobject',
|
||||
'PhabricatorFileChunk' => array(
|
||||
|
@ -11125,6 +11145,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorDestructibleInterface',
|
||||
),
|
||||
'PhabricatorProjectTriggerAddProjectsRule' => 'PhabricatorProjectTriggerRule',
|
||||
'PhabricatorProjectTriggerAddSubscribersRule' => 'PhabricatorProjectTriggerRule',
|
||||
'PhabricatorProjectTriggerController' => 'PhabricatorProjectController',
|
||||
'PhabricatorProjectTriggerCorruptionException' => 'Exception',
|
||||
'PhabricatorProjectTriggerEditController' => 'PhabricatorProjectTriggerController',
|
||||
|
@ -11139,6 +11160,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorProjectTriggerPlaySoundRule' => 'PhabricatorProjectTriggerRule',
|
||||
'PhabricatorProjectTriggerQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||
'PhabricatorProjectTriggerRemoveProjectsRule' => 'PhabricatorProjectTriggerRule',
|
||||
'PhabricatorProjectTriggerRemoveSubscribersRule' => 'PhabricatorProjectTriggerRule',
|
||||
'PhabricatorProjectTriggerRule' => 'Phobject',
|
||||
'PhabricatorProjectTriggerRuleRecord' => 'Phobject',
|
||||
'PhabricatorProjectTriggerRulesetTransaction' => 'PhabricatorProjectTriggerTransactionType',
|
||||
|
@ -11201,12 +11223,18 @@ phutil_register_library_map(array(
|
|||
'PhabricatorRegistrationProfile' => 'Phobject',
|
||||
'PhabricatorRemarkupCachePurger' => 'PhabricatorCachePurger',
|
||||
'PhabricatorRemarkupControl' => 'AphrontFormTextAreaControl',
|
||||
'PhabricatorRemarkupCowsayBlockInterpreter' => 'PhutilRemarkupBlockInterpreter',
|
||||
'PhabricatorRemarkupCowsayBlockInterpreter' => array(
|
||||
'PhutilRemarkupBlockInterpreter',
|
||||
'RemarkupSyntaxDocumentationProvider',
|
||||
),
|
||||
'PhabricatorRemarkupCustomBlockRule' => 'PhutilRemarkupBlockRule',
|
||||
'PhabricatorRemarkupCustomInlineRule' => 'PhutilRemarkupRule',
|
||||
'PhabricatorRemarkupDocumentEngine' => 'PhabricatorDocumentEngine',
|
||||
'PhabricatorRemarkupEditField' => 'PhabricatorEditField',
|
||||
'PhabricatorRemarkupFigletBlockInterpreter' => 'PhutilRemarkupBlockInterpreter',
|
||||
'PhabricatorRemarkupFigletBlockInterpreter' => array(
|
||||
'PhutilRemarkupBlockInterpreter',
|
||||
'RemarkupSyntaxDocumentationProvider',
|
||||
),
|
||||
'PhabricatorRemarkupHyperlinkEngineExtension' => 'PhutilRemarkupHyperlinkEngineExtension',
|
||||
'PhabricatorRemarkupUIExample' => 'PhabricatorUIExample',
|
||||
'PhabricatorRemoveEmailUserLogType' => 'PhabricatorUserLogType',
|
||||
|
@ -11811,6 +11839,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorTypeaheadDatasourceTestCase' => 'PhabricatorTestCase',
|
||||
'PhabricatorTypeaheadFunctionHelpController' => 'PhabricatorTypeaheadDatasourceController',
|
||||
'PhabricatorTypeaheadInvalidTokenException' => 'Exception',
|
||||
'PhabricatorTypeaheadLoginRequiredException' => 'Exception',
|
||||
'PhabricatorTypeaheadModularDatasourceController' => 'PhabricatorTypeaheadDatasourceController',
|
||||
'PhabricatorTypeaheadMonogramDatasource' => 'PhabricatorTypeaheadDatasource',
|
||||
'PhabricatorTypeaheadProxyDatasource' => 'PhabricatorTypeaheadCompositeDatasource',
|
||||
|
@ -12212,6 +12241,8 @@ phutil_register_library_map(array(
|
|||
'PholioTransactionView' => 'PhabricatorApplicationTransactionView',
|
||||
'PholioUploadedImageView' => 'AphrontView',
|
||||
'PhorgeCodeWarningSetupCheck' => 'PhabricatorSetupCheck',
|
||||
'PhorgeFlagFlaggedObjectCustomField' => 'PhabricatorCustomField',
|
||||
'PhorgeFlagFlaggedObjectFieldStorage' => 'Phobject',
|
||||
'PhorgeSystemDeprecationWarningListener' => 'PhabricatorEventListener',
|
||||
'PhortuneAccount' => array(
|
||||
'PhortuneDAO',
|
||||
|
@ -12498,6 +12529,7 @@ phutil_register_library_map(array(
|
|||
'PhrictionDocumentDatasource' => 'PhabricatorTypeaheadDatasource',
|
||||
'PhrictionDocumentDeleteTransaction' => 'PhrictionDocumentVersionTransaction',
|
||||
'PhrictionDocumentDraftTransaction' => 'PhrictionDocumentEditTransaction',
|
||||
'PhrictionDocumentEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod',
|
||||
'PhrictionDocumentEditEngine' => 'PhabricatorEditEngine',
|
||||
'PhrictionDocumentEditTransaction' => 'PhrictionDocumentVersionTransaction',
|
||||
'PhrictionDocumentFerretEngine' => 'PhabricatorFerretEngine',
|
||||
|
@ -12677,6 +12709,8 @@ phutil_register_library_map(array(
|
|||
'PhutilTranslatedHTMLTestCase' => 'PhutilTestCase',
|
||||
'PhutilTwitchAuthAdapter' => 'PhutilOAuthAuthAdapter',
|
||||
'PhutilTwitterAuthAdapter' => 'PhutilOAuth1AuthAdapter',
|
||||
'PhutilURIHelper' => 'Phobject',
|
||||
'PhutilURIHelperTestCase' => 'PhabricatorTestCase',
|
||||
'PhutilWordPressAuthAdapter' => 'PhutilOAuthAuthAdapter',
|
||||
'PhutilXHPASTSyntaxHighlighter' => 'Phobject',
|
||||
'PhutilXHPASTSyntaxHighlighterFuture' => 'FutureProxy',
|
||||
|
@ -12779,7 +12813,10 @@ phutil_register_library_map(array(
|
|||
'ProjectSearchConduitAPIMethod' => 'PhabricatorSearchEngineAPIMethod',
|
||||
'QueryFormattingTestCase' => 'PhabricatorTestCase',
|
||||
'QueryFuture' => 'Future',
|
||||
'ReferenceApplication' => 'PhabricatorApplication',
|
||||
'ReferenceController' => 'PhabricatorController',
|
||||
'RemarkupProcessConduitAPIMethod' => 'ConduitAPIMethod',
|
||||
'RemarkupReferenceController' => 'ReferenceController',
|
||||
'RemarkupValue' => 'Phobject',
|
||||
'RepositoryConduitAPIMethod' => 'ConduitAPIMethod',
|
||||
'RepositoryQueryConduitAPIMethod' => 'RepositoryConduitAPIMethod',
|
||||
|
|
|
@ -56,8 +56,8 @@ final class AphrontRequest extends Phobject {
|
|||
* Applications like Paste, Diffusion, and Harbormaster use "$12-14" in the
|
||||
* URI to allow users to link to particular lines.
|
||||
*
|
||||
* @param string URI data key to pull line range information from.
|
||||
* @param int|null Maximum length of the range.
|
||||
* @param string $key URI data key to pull line range information from.
|
||||
* @param int|null $limit Maximum length of the range.
|
||||
* @return null|pair<int, int> Null, or beginning and end of the range.
|
||||
*/
|
||||
public function getURILineRange($key, $limit) {
|
||||
|
@ -537,8 +537,8 @@ final class AphrontRequest extends Phobject {
|
|||
*
|
||||
* To set a temporary cookie, see @{method:setTemporaryCookie}.
|
||||
*
|
||||
* @param string Cookie name.
|
||||
* @param string Cookie value.
|
||||
* @param string $name Cookie name.
|
||||
* @param string $value Cookie value.
|
||||
* @return this
|
||||
* @task cookie
|
||||
*/
|
||||
|
@ -553,8 +553,8 @@ final class AphrontRequest extends Phobject {
|
|||
*
|
||||
* To set a durable cookie, see @{method:setCookie}.
|
||||
*
|
||||
* @param string Cookie name.
|
||||
* @param string Cookie value.
|
||||
* @param string $name Cookie name.
|
||||
* @param string $value Cookie value.
|
||||
* @return this
|
||||
* @task cookie
|
||||
*/
|
||||
|
@ -566,9 +566,9 @@ final class AphrontRequest extends Phobject {
|
|||
/**
|
||||
* Set a cookie with a given expiration policy.
|
||||
*
|
||||
* @param string Cookie name.
|
||||
* @param string Cookie value.
|
||||
* @param int Epoch timestamp for cookie expiration.
|
||||
* @param string $name Cookie name.
|
||||
* @param string $value Cookie value.
|
||||
* @param int $expire Epoch timestamp for cookie expiration.
|
||||
* @return this
|
||||
* @task cookie
|
||||
*/
|
||||
|
@ -748,7 +748,7 @@ final class AphrontRequest extends Phobject {
|
|||
* into a list of key-value pairs suitable for submitting via HTTP request
|
||||
* (with arrays flattened).
|
||||
*
|
||||
* @param dict<string, wild> Data to flatten.
|
||||
* @param dict<string, wild> $data Data to flatten.
|
||||
* @return dict<string, string> Flat data suitable for inclusion in an HTTP
|
||||
* request.
|
||||
*/
|
||||
|
@ -778,9 +778,11 @@ final class AphrontRequest extends Phobject {
|
|||
* and looks up the appropriate value in `$_SERVER` (in this case,
|
||||
* `"HTTP_ACCEPT_ENCODING"`).
|
||||
*
|
||||
* @param string Canonical header name, like `"Accept-Encoding"`.
|
||||
* @param wild Default value to return if header is not present.
|
||||
* @param array? Read this instead of `$_SERVER`.
|
||||
* @param string $name Canonical header name, like
|
||||
`"Accept-Encoding"`.
|
||||
* @param wild? $default Default value to return if header is not
|
||||
present.
|
||||
* @param array? $data Read this instead of `$_SERVER`.
|
||||
* @return string|wild Header value if present, or `$default` if not.
|
||||
*/
|
||||
public static function getHTTPHeader($name, $default = null, $data = null) {
|
||||
|
@ -844,7 +846,7 @@ final class AphrontRequest extends Phobject {
|
|||
* This is not a general-purpose proxying method; it is a specialized
|
||||
* method with niche applications and severe security implications.
|
||||
*
|
||||
* @param string URI identifying the host we are proxying the request to.
|
||||
* @param string URI $uri identifying the host we are proxying the request to.
|
||||
* @return HTTPSFuture New proxy future.
|
||||
*
|
||||
* @phutil-external-symbol class PhabricatorStartup
|
||||
|
|
|
@ -510,8 +510,8 @@ final class AphrontApplicationConfiguration
|
|||
* Map a specific path to the corresponding controller. For a description
|
||||
* of routing, see @{method:buildController}.
|
||||
*
|
||||
* @param list<AphrontRoutingMap> List of routing maps.
|
||||
* @param string Path to route.
|
||||
* @param list<AphrontRoutingMap> $maps List of routing maps.
|
||||
* @param string $path Path to route.
|
||||
* @return pair<AphrontController,dict> Controller and dictionary of request
|
||||
* parameters.
|
||||
* @task routing
|
||||
|
@ -523,6 +523,7 @@ final class AphrontApplicationConfiguration
|
|||
return array($result->getController(), $result->getURIData());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private function buildSiteForRequest(AphrontRequest $request) {
|
||||
|
@ -561,7 +562,7 @@ final class AphrontApplicationConfiguration
|
|||
/**
|
||||
* Tests if a response is of a valid type.
|
||||
*
|
||||
* @param wild Supposedly valid response.
|
||||
* @param wild $response Supposedly valid response.
|
||||
* @return bool True if the object is of a valid type.
|
||||
* @task response
|
||||
*/
|
||||
|
@ -582,8 +583,9 @@ final class AphrontApplicationConfiguration
|
|||
* Verifies that the return value from an @{class:AphrontController} is
|
||||
* of an allowed type.
|
||||
*
|
||||
* @param AphrontController Controller which returned the response.
|
||||
* @param wild Supposedly valid response.
|
||||
* @param AphrontController $controller Controller which returned the
|
||||
* response.
|
||||
* @param wild $response Supposedly valid response.
|
||||
* @return void
|
||||
* @task response
|
||||
*/
|
||||
|
@ -611,9 +613,9 @@ final class AphrontApplicationConfiguration
|
|||
* Verifies that the return value from an
|
||||
* @{class:AphrontResponseProducerInterface} is of an allowed type.
|
||||
*
|
||||
* @param AphrontResponseProducerInterface Object which produced
|
||||
* @param AphrontResponseProducerInterface $producer Object which produced
|
||||
* this response.
|
||||
* @param wild Supposedly valid response.
|
||||
* @param wild $response Supposedly valid response.
|
||||
* @return void
|
||||
* @task response
|
||||
*/
|
||||
|
@ -641,9 +643,9 @@ final class AphrontApplicationConfiguration
|
|||
* Verifies that the return value from an
|
||||
* @{class:AphrontRequestExceptionHandler} is of an allowed type.
|
||||
*
|
||||
* @param AphrontRequestExceptionHandler Object which produced this
|
||||
* @param AphrontRequestExceptionHandler $handler Object which produced this
|
||||
* response.
|
||||
* @param wild Supposedly valid response.
|
||||
* @param wild $response Supposedly valid response.
|
||||
* @return void
|
||||
* @task response
|
||||
*/
|
||||
|
@ -677,9 +679,9 @@ final class AphrontApplicationConfiguration
|
|||
* If a controller returns a response producer, invoke it now and produce
|
||||
* the real response.
|
||||
*
|
||||
* @param AphrontRequest Request being handled.
|
||||
* @param AphrontResponse|AphrontResponseProducerInterface Response, or
|
||||
* response producer.
|
||||
* @param AphrontRequest $request Request being handled.
|
||||
* @param AphrontResponse|AphrontResponseProducerInterface $response
|
||||
* Response, or response producer.
|
||||
* @return AphrontResponse Response after any required production.
|
||||
* @task response
|
||||
*/
|
||||
|
@ -737,7 +739,7 @@ final class AphrontApplicationConfiguration
|
|||
* This method delegates exception handling to available subclasses of
|
||||
* @{class:AphrontRequestExceptionHandler}.
|
||||
*
|
||||
* @param Throwable Exception which needs to be handled.
|
||||
* @param Throwable $throwable Exception which needs to be handled.
|
||||
* @return wild Response or response producer, or null if no available
|
||||
* handler can produce a response.
|
||||
* @task exception
|
||||
|
|
|
@ -31,7 +31,7 @@ abstract class AphrontHTTPParameterType extends Phobject {
|
|||
* example, a type might lookup usernames or project names. These types need
|
||||
* to use the current viewer to execute queries.
|
||||
*
|
||||
* @param PhabricatorUser Current viewer.
|
||||
* @param PhabricatorUser $viewer Current viewer.
|
||||
* @return this
|
||||
* @task read
|
||||
*/
|
||||
|
@ -58,8 +58,8 @@ abstract class AphrontHTTPParameterType extends Phobject {
|
|||
/**
|
||||
* Test if a value is present in a request.
|
||||
*
|
||||
* @param AphrontRequest The incoming request.
|
||||
* @param string The key to examine.
|
||||
* @param AphrontRequest $request The incoming request.
|
||||
* @param string $key The key to examine.
|
||||
* @return bool True if a readable value is present in the request.
|
||||
* @task read
|
||||
*/
|
||||
|
@ -74,8 +74,8 @@ abstract class AphrontHTTPParameterType extends Phobject {
|
|||
* If the value is not present, a default value is returned (usually `null`).
|
||||
* Use @{method:getExists} to test if a value is present.
|
||||
*
|
||||
* @param AphrontRequest The incoming request.
|
||||
* @param string The key to examine.
|
||||
* @param AphrontRequest $request The incoming request.
|
||||
* @param string $key The key to examine.
|
||||
* @return wild Value, or default if value is not present.
|
||||
* @task read
|
||||
*/
|
||||
|
@ -165,9 +165,9 @@ abstract class AphrontHTTPParameterType extends Phobject {
|
|||
* existence check that a simpler "list of strings" type has, and can just
|
||||
* call the simpler type to reuse its behavior.
|
||||
*
|
||||
* @param AphrontHTTPParameterType The other type.
|
||||
* @param AphrontRequest Incoming request.
|
||||
* @param string Key to examine.
|
||||
* @param AphrontHTTPParameterType $type The other type.
|
||||
* @param AphrontRequest $request Incoming request.
|
||||
* @param string $key Key to examine.
|
||||
* @return bool True if the parameter exists.
|
||||
* @task util
|
||||
*/
|
||||
|
@ -189,9 +189,9 @@ abstract class AphrontHTTPParameterType extends Phobject {
|
|||
* type. For example, a "list of users" type may start by running the same
|
||||
* basic parsing that a simpler "list of strings" type does.
|
||||
*
|
||||
* @param AphrontHTTPParameterType The other type.
|
||||
* @param AphrontRequest Incoming request.
|
||||
* @param string Key to examine.
|
||||
* @param AphrontHTTPParameterType $type The other type.
|
||||
* @param AphrontRequest $request Incoming request.
|
||||
* @param string $key Key to examine.
|
||||
* @return wild Parsed value.
|
||||
* @task util
|
||||
*/
|
||||
|
@ -233,8 +233,8 @@ abstract class AphrontHTTPParameterType extends Phobject {
|
|||
* To call another type's behavior in order to perform this check, use
|
||||
* @{method:getExistsWithType}.
|
||||
*
|
||||
* @param AphrontRequest The incoming request.
|
||||
* @param string The key to examine.
|
||||
* @param AphrontRequest $request The incoming request.
|
||||
* @param string $key The key to examine.
|
||||
* @return bool True if a readable value is present in the request.
|
||||
* @task impl
|
||||
*/
|
||||
|
@ -253,8 +253,8 @@ abstract class AphrontHTTPParameterType extends Phobject {
|
|||
* To call another type's behavior in order to parse a value, use
|
||||
* @{method:getValueWithType}.
|
||||
*
|
||||
* @param AphrontRequest The incoming request.
|
||||
* @param string The key to examine.
|
||||
* @param AphrontRequest $request The incoming request.
|
||||
* @param string $key The key to examine.
|
||||
* @return wild Parsed value.
|
||||
* @task impl
|
||||
*/
|
||||
|
|
|
@ -30,7 +30,7 @@ final class AphrontFileResponse extends AphrontResponse {
|
|||
/**
|
||||
* Set a download filename
|
||||
*
|
||||
* @param $download string
|
||||
* @param string $download
|
||||
* @return self
|
||||
*/
|
||||
public function setDownload($download) {
|
||||
|
|
|
@ -117,8 +117,9 @@ class AphrontRedirectResponse extends AphrontResponse {
|
|||
* ambiguity. For example, Chrome interprets "Location: /\evil.com" to mean
|
||||
* "perform a protocol-relative redirect to evil.com".
|
||||
*
|
||||
* @param string URI to redirect to.
|
||||
* @param bool True if this URI identifies a remote resource.
|
||||
* @param string $uri URI to redirect to.
|
||||
* @param bool $is_external True if this URI identifies a remote
|
||||
* resource.
|
||||
* @return string URI for use in a "Location:" header.
|
||||
*/
|
||||
public static function getURIForRedirect($uri, $is_external) {
|
||||
|
|
|
@ -28,7 +28,8 @@ abstract class AphrontHTTPSink extends Phobject {
|
|||
/**
|
||||
* Write an HTTP status code to the output.
|
||||
*
|
||||
* @param int Numeric HTTP status code.
|
||||
* @param int $code Numeric HTTP status code.
|
||||
* @param string? $message
|
||||
* @return void
|
||||
*/
|
||||
final public function writeHTTPStatus($code, $message = '') {
|
||||
|
@ -44,7 +45,7 @@ abstract class AphrontHTTPSink extends Phobject {
|
|||
/**
|
||||
* Write HTTP headers to the output.
|
||||
*
|
||||
* @param list<pair> List of <name, value> pairs.
|
||||
* @param list<pair> $headers List of <name, value> pairs.
|
||||
* @return void
|
||||
*/
|
||||
final public function writeHeaders(array $headers) {
|
||||
|
@ -89,7 +90,7 @@ abstract class AphrontHTTPSink extends Phobject {
|
|||
/**
|
||||
* Write HTTP body data to the output.
|
||||
*
|
||||
* @param string Body data.
|
||||
* @param string $data Body data.
|
||||
* @return void
|
||||
*/
|
||||
final public function writeData($data) {
|
||||
|
@ -100,7 +101,7 @@ abstract class AphrontHTTPSink extends Phobject {
|
|||
/**
|
||||
* Write an entire @{class:AphrontResponse} to the output.
|
||||
*
|
||||
* @param AphrontResponse The response object to write.
|
||||
* @param AphrontResponse $response The response object to write.
|
||||
* @return void
|
||||
*/
|
||||
final public function writeResponse(AphrontResponse $response) {
|
||||
|
|
|
@ -50,7 +50,7 @@ final class AphrontRoutingMap extends Phobject {
|
|||
/**
|
||||
* Find the route matching a path, if one exists.
|
||||
*
|
||||
* @param string Path to route.
|
||||
* @param string $path Path to route.
|
||||
* @return AphrontRoutingResult|null Routing result, if path matches map.
|
||||
* @task routing
|
||||
*/
|
||||
|
@ -84,9 +84,9 @@ final class AphrontRoutingMap extends Phobject {
|
|||
/**
|
||||
* Test a sub-map to see if any routes match a path.
|
||||
*
|
||||
* @param string Path to route.
|
||||
* @param string Pattern from the map.
|
||||
* @param string Value from the map.
|
||||
* @param string $route Pattern from the map.
|
||||
* @param string $value Value from the map.
|
||||
* @param string $path Path to route.
|
||||
* @return dict<string, wild>|null Match details, if path matches sub-map.
|
||||
* @task routing
|
||||
*/
|
||||
|
|
|
@ -57,7 +57,7 @@ final class AphrontWriteGuard extends Phobject {
|
|||
* the request, or abort the request (e.g., by throwing an exception) if a
|
||||
* valid token isn't present.
|
||||
*
|
||||
* @param callable CSRF callback.
|
||||
* @param $callback Callable CSRF callback.
|
||||
* @return this
|
||||
* @task manage
|
||||
*/
|
||||
|
|
|
@ -137,4 +137,30 @@ final class AlmanacDeviceSearchEngine
|
|||
return $result;
|
||||
}
|
||||
|
||||
protected function getNewUserBody() {
|
||||
$see_network = id(new PHUIButtonView())
|
||||
->setTag('a')
|
||||
->setText(pht('See Networks'))
|
||||
->setHref('/almanac/network/');
|
||||
|
||||
$create_button = id(new PHUIButtonView())
|
||||
->setTag('a')
|
||||
->setText(pht('Create a Device'))
|
||||
->setHref('/almanac/device/edit/')
|
||||
->setIcon('fa-plus')
|
||||
->setColor(PHUIButtonView::GREEN);
|
||||
|
||||
$app_name = pht('Devices');
|
||||
$view = id(new PHUIBigInfoView())
|
||||
->setIcon('fa-server')
|
||||
->setTitle(pht('Welcome to %s', $app_name))
|
||||
->setDescription(
|
||||
pht(
|
||||
'Use Almanac devices to catalogue your build hosts '.
|
||||
'and their SSH ports your network, and more.'))
|
||||
->addAction($see_network)
|
||||
->addAction($create_button);
|
||||
|
||||
return $view;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,4 +87,25 @@ final class AlmanacNetworkSearchEngine
|
|||
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function getNewUserBody() {
|
||||
$create_button = id(new PHUIButtonView())
|
||||
->setTag('a')
|
||||
->setText(pht('Create a Network'))
|
||||
->setHref('/almanac/network/edit/')
|
||||
->setIcon('fa-plus')
|
||||
->setColor(PHUIButtonView::GREEN);
|
||||
|
||||
$app_name = pht('Networks');
|
||||
$view = id(new PHUIBigInfoView())
|
||||
->setIcon('fa-globe')
|
||||
->setTitle(pht('Welcome to %s', $app_name))
|
||||
->setDescription(
|
||||
pht(
|
||||
'Use Almanac networks to catalogue private and public '.
|
||||
'computer networks.'))
|
||||
->addAction($create_button);
|
||||
|
||||
return $view;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -115,4 +115,32 @@ final class AlmanacServiceSearchEngine
|
|||
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function getNewUserBody() {
|
||||
$see_devices = id(new PHUIButtonView())
|
||||
->setTag('a')
|
||||
->setText(pht('See Devices'))
|
||||
->setHref('/almanac/device/');
|
||||
|
||||
$create_button = id(new PHUIButtonView())
|
||||
->setTag('a')
|
||||
->setText(pht('Create a Service'))
|
||||
->setHref('/almanac/service/edit/')
|
||||
->setIcon('fa-plus')
|
||||
->setColor(PHUIButtonView::GREEN);
|
||||
|
||||
|
||||
$app_name = pht('Services');
|
||||
$view = id(new PHUIBigInfoView())
|
||||
->setIcon('fa-plug')
|
||||
->setTitle(pht('Welcome to %s', $app_name))
|
||||
->setDescription(
|
||||
pht(
|
||||
'Services describe pools of devices, and '.
|
||||
'they are available to Drydock for CI/CD, and more.'))
|
||||
->addAction($see_devices)
|
||||
->addAction($create_button);
|
||||
|
||||
return $view;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ final class PhutilBitbucketAuthAdapter extends PhutilOAuth1AuthAdapter {
|
|||
|
||||
public function getAccountURI() {
|
||||
$name = $this->getAccountID();
|
||||
if (strlen($name)) {
|
||||
if (phutil_nonempty_string($name)) {
|
||||
return 'https://bitbucket.org/'.$name;
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -31,7 +31,7 @@ final class PhutilGitHubAuthAdapter extends PhutilOAuthAuthAdapter {
|
|||
|
||||
public function getAccountURI() {
|
||||
$name = $this->getAccountName();
|
||||
if (strlen($name)) {
|
||||
if (phutil_nonempty_string($name)) {
|
||||
return 'https://github.com/'.$name;
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -17,7 +17,7 @@ final class PhutilTwitterAuthAdapter extends PhutilOAuth1AuthAdapter {
|
|||
|
||||
public function getAccountURI() {
|
||||
$name = $this->getAccountName();
|
||||
if (strlen($name)) {
|
||||
if (phutil_nonempty_string($name)) {
|
||||
return 'https://twitter.com/'.$name;
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -16,7 +16,7 @@ final class PhabricatorCommonPasswords extends Phobject {
|
|||
/**
|
||||
* Check if a password is extremely common.
|
||||
*
|
||||
* @param string Password to test.
|
||||
* @param string $password Password to test.
|
||||
* @return bool True if the password is pathologically weak.
|
||||
*
|
||||
* @task common
|
||||
|
|
|
@ -77,7 +77,7 @@ final class PhabricatorCookies extends Phobject {
|
|||
* Set the client ID cookie. This is a random cookie used like a CSRF value
|
||||
* during authentication workflows.
|
||||
*
|
||||
* @param AphrontRequest Request to modify.
|
||||
* @param AphrontRequest $request Request to modify.
|
||||
* @return void
|
||||
* @task clientid
|
||||
*/
|
||||
|
@ -105,10 +105,10 @@ final class PhabricatorCookies extends Phobject {
|
|||
* written, to avoid writing over a real URI with a bunch of "humans.txt"
|
||||
* stuff. See T3793 for discussion.
|
||||
*
|
||||
* @param AphrontRequest Request to write to.
|
||||
* @param string URI to write.
|
||||
* @param bool Write this cookie even if we have a fresh
|
||||
* cookie already.
|
||||
* @param AphrontRequest $request Request to write to.
|
||||
* @param string $next_uri URI to write.
|
||||
* @param bool? $force Write this cookie even if we have a
|
||||
* fresh cookie already.
|
||||
* @return void
|
||||
*
|
||||
* @task next
|
||||
|
@ -139,7 +139,7 @@ final class PhabricatorCookies extends Phobject {
|
|||
/**
|
||||
* Read the URI out of the Next URI cookie.
|
||||
*
|
||||
* @param AphrontRequest Request to examine.
|
||||
* @param AphrontRequest $request Request to examine.
|
||||
* @return string|null Next URI cookie's URI value.
|
||||
*
|
||||
* @task next
|
||||
|
@ -155,7 +155,7 @@ final class PhabricatorCookies extends Phobject {
|
|||
/**
|
||||
* Parse a Next URI cookie into its components.
|
||||
*
|
||||
* @param string Raw cookie value.
|
||||
* @param string $cookie Raw cookie value.
|
||||
* @return list<string> List of timestamp and URI.
|
||||
*
|
||||
* @task next
|
||||
|
|
|
@ -44,8 +44,9 @@ abstract class PhabricatorAuthController extends PhabricatorController {
|
|||
* the user's cookies are set. However, event listeners can intercept this
|
||||
* event and do something else if they prefer.
|
||||
*
|
||||
* @param PhabricatorUser User to log the viewer in as.
|
||||
* @param bool True to issue a full session immediately, bypassing MFA.
|
||||
* @param PhabricatorUser $user User to log the viewer in as.
|
||||
* @param bool? $force_full_session True to issue a full session immediately,
|
||||
* bypassing MFA.
|
||||
* @return AphrontResponse Response which continues the login process.
|
||||
*/
|
||||
protected function loginUser(
|
||||
|
|
|
@ -31,7 +31,7 @@ final class PhabricatorAuthStartController
|
|||
$session_token = $request->getCookie(PhabricatorCookies::COOKIE_SESSION);
|
||||
$did_clear = $request->getStr('cleared');
|
||||
|
||||
if (strlen($session_token)) {
|
||||
if (phutil_nonempty_string($session_token)) {
|
||||
$kind = PhabricatorAuthSessionEngine::getSessionKindFromToken(
|
||||
$session_token);
|
||||
switch ($kind) {
|
||||
|
|
|
@ -102,7 +102,7 @@ final class PhabricatorAuthUnlinkController
|
|||
->addHiddenInput('confirmations', implode(',', $confirmations))
|
||||
->appendParagraph(
|
||||
pht(
|
||||
'This is the only external login account linked to your Phabicator '.
|
||||
'This is the only external login account linked to your '.
|
||||
'account. If you remove it, you may no longer be able to log in.'))
|
||||
->appendParagraph(
|
||||
pht(
|
||||
|
|
|
@ -75,7 +75,7 @@ final class PhabricatorAuthSessionEngine extends Phobject {
|
|||
* Get the session kind (e.g., anonymous, user, external account) from a
|
||||
* session token. Returns a `KIND_` constant.
|
||||
*
|
||||
* @param string Session token.
|
||||
* @param string $session_token Session token.
|
||||
* @return const Session kind constant.
|
||||
*/
|
||||
public static function getSessionKindFromToken($session_token) {
|
||||
|
@ -109,8 +109,8 @@ final class PhabricatorAuthSessionEngine extends Phobject {
|
|||
* loading context. This prevents use of a Conduit sesssion as a Web
|
||||
* session, for example.
|
||||
*
|
||||
* @param const The type of session to load.
|
||||
* @param string The session token.
|
||||
* @param const $session_type The type of session to load.
|
||||
* @param string $session_token The session token.
|
||||
* @return PhabricatorUser|null
|
||||
* @task use
|
||||
*/
|
||||
|
@ -250,11 +250,12 @@ final class PhabricatorAuthSessionEngine extends Phobject {
|
|||
* You can configure the maximum number of concurrent sessions for various
|
||||
* session types in the Phabricator configuration.
|
||||
*
|
||||
* @param const Session type constant (see
|
||||
* @param const $session_type Session type constant (see
|
||||
* @{class:PhabricatorAuthSession}).
|
||||
* @param phid|null Identity to establish a session for, usually a user
|
||||
* PHID. With `null`, generates an anonymous session.
|
||||
* @param bool True to issue a partial session.
|
||||
* @param phid|null $identity_phid Identity to establish a session for,
|
||||
* usually a user PHID. With `null`, generates an
|
||||
* anonymous session.
|
||||
* @param bool $partial True to issue a partial session.
|
||||
* @return string Newly generated session key.
|
||||
*/
|
||||
public function establishSession($session_type, $identity_phid, $partial) {
|
||||
|
@ -325,9 +326,9 @@ final class PhabricatorAuthSessionEngine extends Phobject {
|
|||
* This is used when users change passwords, linked accounts, or add
|
||||
* multifactor authentication.
|
||||
*
|
||||
* @param PhabricatorUser User whose sessions should be terminated.
|
||||
* @param string|null Optionally, one session to keep. Normally, the current
|
||||
* login session.
|
||||
* @param PhabricatorUser $user User whose sessions should be terminated.
|
||||
* @param string|null? $except_session Optionally, one session to keep.
|
||||
* Normally, the current login session.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
@ -388,9 +389,11 @@ final class PhabricatorAuthSessionEngine extends Phobject {
|
|||
* does not upgrade the user's session as a side effect. This method is
|
||||
* appropriate for one-time checks.
|
||||
*
|
||||
* @param PhabricatorUser User whose session needs to be in high security.
|
||||
* @param AphrontRequest Current request.
|
||||
* @param string URI to return the user to if they cancel.
|
||||
* @param PhabricatorUser $viewer User whose session needs to be in high
|
||||
* security.
|
||||
* @param AphrontRequest $request Current request.
|
||||
* @param string $cancel_uri URI to return the user to if they
|
||||
* cancel.
|
||||
* @return PhabricatorAuthHighSecurityToken Security token.
|
||||
* @task hisec
|
||||
*/
|
||||
|
@ -420,12 +423,14 @@ final class PhabricatorAuthSessionEngine extends Phobject {
|
|||
* take multiple high security actions. To perform a one-time check instead,
|
||||
* use @{method:requireHighSecurityToken}.
|
||||
*
|
||||
* @param PhabricatorUser User whose session needs to be in high security.
|
||||
* @param AphrontRequest Current request.
|
||||
* @param string URI to return the user to if they cancel.
|
||||
* @param bool True to jump partial sessions directly into high
|
||||
* security instead of just upgrading them to full
|
||||
* sessions.
|
||||
* @param PhabricatorUser $viewer User whose session needs to be in high
|
||||
* security.
|
||||
* @param AphrontRequest $request Current request.
|
||||
* @param string $cancel_uri URI to return the user to if they
|
||||
* cancel.
|
||||
* @param bool? $jump_into_hisec True to jump partial sessions
|
||||
* directly into high security instead of just
|
||||
* upgrading them to full sessions.
|
||||
* @return PhabricatorAuthHighSecurityToken Security token.
|
||||
* @task hisec
|
||||
*/
|
||||
|
@ -736,8 +741,8 @@ final class PhabricatorAuthSessionEngine extends Phobject {
|
|||
/**
|
||||
* Issue a high security token for a session, if authorized.
|
||||
*
|
||||
* @param PhabricatorAuthSession Session to issue a token for.
|
||||
* @param bool Force token issue.
|
||||
* @param PhabricatorAuthSession $session Session to issue a token for.
|
||||
* @param bool? $force Force token issue.
|
||||
* @return PhabricatorAuthHighSecurityToken|null Token, if authorized.
|
||||
* @task hisec
|
||||
*/
|
||||
|
@ -756,8 +761,10 @@ final class PhabricatorAuthSessionEngine extends Phobject {
|
|||
/**
|
||||
* Render a form for providing relevant multi-factor credentials.
|
||||
*
|
||||
* @param PhabricatorUser Viewing user.
|
||||
* @param AphrontRequest Current request.
|
||||
* @param array $factors
|
||||
* @param array $validation_results
|
||||
* @param PhabricatorUser $viewer Viewing user.
|
||||
* @param AphrontRequest $request Current request.
|
||||
* @return AphrontFormView Renderable form.
|
||||
* @task hisec
|
||||
*/
|
||||
|
@ -810,8 +817,9 @@ final class PhabricatorAuthSessionEngine extends Phobject {
|
|||
*
|
||||
* Kicks a session out of high security and logs the exit.
|
||||
*
|
||||
* @param PhabricatorUser Acting user.
|
||||
* @param PhabricatorAuthSession Session to return to normal security.
|
||||
* @param PhabricatorUser $viewer Acting user.
|
||||
* @param PhabricatorAuthSession $session Session to return to normal
|
||||
* security.
|
||||
* @return void
|
||||
* @task hisec
|
||||
*/
|
||||
|
@ -843,7 +851,7 @@ final class PhabricatorAuthSessionEngine extends Phobject {
|
|||
/**
|
||||
* Upgrade a partial session to a full session.
|
||||
*
|
||||
* @param PhabricatorAuthSession Session to upgrade.
|
||||
* @param PhabricatorUser $viewer Viewer whose session should upgrade.
|
||||
* @return void
|
||||
* @task partial
|
||||
*/
|
||||
|
@ -885,8 +893,8 @@ final class PhabricatorAuthSessionEngine extends Phobject {
|
|||
/**
|
||||
* Upgrade a session to have all legalpad documents signed.
|
||||
*
|
||||
* @param PhabricatorUser User whose session should upgrade.
|
||||
* @param array LegalpadDocument objects
|
||||
* @param PhabricatorUser $viewer User whose session should upgrade.
|
||||
* @param array $docs LegalpadDocument objects
|
||||
* @return void
|
||||
* @task partial
|
||||
*/
|
||||
|
@ -934,13 +942,14 @@ final class PhabricatorAuthSessionEngine extends Phobject {
|
|||
* These URIs are used for password recovery and to regain access to accounts
|
||||
* which users have been locked out of.
|
||||
*
|
||||
* @param PhabricatorUser User to generate a URI for.
|
||||
* @param PhabricatorUserEmail Optionally, email to verify when
|
||||
* @param PhabricatorUser $user User to generate a URI for.
|
||||
* @param PhabricatorUserEmail? $email Optionally, email to verify when
|
||||
* link is used.
|
||||
* @param string Optional context string for the URI. This is purely cosmetic
|
||||
* and used only to customize workflow and error messages.
|
||||
* @param bool True to generate a URI which forces an immediate upgrade to
|
||||
* a full session, bypassing MFA and other login checks.
|
||||
* @param string? $type Optional context string for the URI. This is purely
|
||||
* cosmetic and used only to customize workflow and error messages.
|
||||
* @param bool? $force_full_session True to generate a URI which forces an
|
||||
* immediate upgrade to a full session, bypassing MFA and other login
|
||||
* checks.
|
||||
* @return string Login URI.
|
||||
* @task onetime
|
||||
*/
|
||||
|
@ -984,10 +993,10 @@ final class PhabricatorAuthSessionEngine extends Phobject {
|
|||
/**
|
||||
* Load the temporary token associated with a given one-time login key.
|
||||
*
|
||||
* @param PhabricatorUser User to load the token for.
|
||||
* @param PhabricatorUserEmail Optionally, email to verify when
|
||||
* @param PhabricatorUser $user User to load the token for.
|
||||
* @param PhabricatorUserEmail? $email Optionally, email to verify when
|
||||
* link is used.
|
||||
* @param string Key user is presenting as a valid one-time login key.
|
||||
* @param string? $key Key user is presenting as a valid one-time login key.
|
||||
* @return PhabricatorAuthTemporaryToken|null Token, if one exists.
|
||||
* @task onetime
|
||||
*/
|
||||
|
@ -1012,10 +1021,10 @@ final class PhabricatorAuthSessionEngine extends Phobject {
|
|||
/**
|
||||
* Hash a one-time login key for storage as a temporary token.
|
||||
*
|
||||
* @param PhabricatorUser User this key is for.
|
||||
* @param PhabricatorUserEmail Optionally, email to verify when
|
||||
* @param PhabricatorUser $user User this key is for.
|
||||
* @param PhabricatorUserEmail? $email Optionally, email to verify when
|
||||
* link is used.
|
||||
* @param string The one time login key.
|
||||
* @param string? $key The one time login key.
|
||||
* @return string Hash of the key.
|
||||
* task onetime
|
||||
*/
|
||||
|
|
|
@ -14,8 +14,8 @@ interface PhabricatorAuthPasswordHashInterface {
|
|||
* as their password or picking other passwords which are trivially similar
|
||||
* to an account or object identifier.
|
||||
*
|
||||
* @param PhabricatorUser The user selecting the password.
|
||||
* @param PhabricatorAuthPasswordEngine The password engine updating a
|
||||
* @param PhabricatorUser $viewer The user selecting the password.
|
||||
* @param PhabricatorAuthPasswordEngine $engine The password engine updating a
|
||||
* password.
|
||||
* @return list<string> Blocklist of nonsecret identifiers which the password
|
||||
* should not be similar to.
|
||||
|
|
|
@ -460,9 +460,9 @@ abstract class PhabricatorAuthProvider extends Phobject {
|
|||
* - `uri`: URI the button should take the user to when clicked.
|
||||
* - `method`: Optional HTTP method the button should use, defaults to GET.
|
||||
*
|
||||
* @param AphrontRequest HTTP request.
|
||||
* @param string Request mode string.
|
||||
* @param map Additional parameters, see above.
|
||||
* @param AphrontRequest $request HTTP request.
|
||||
* @param string $mode Request mode string.
|
||||
* @param map? $attributes Additional parameters, see above.
|
||||
* @return wild Log in button.
|
||||
*/
|
||||
protected function renderStandardLoginButton(
|
||||
|
|
|
@ -142,10 +142,10 @@ final class PhabricatorLDAPAuthProvider extends PhabricatorAuthProvider {
|
|||
|
||||
$username = $request->getStr('ldap_username');
|
||||
$password = $request->getStr('ldap_password');
|
||||
$has_password = strlen($password);
|
||||
$has_password = phutil_nonempty_string($password);
|
||||
$password = new PhutilOpaqueEnvelope($password);
|
||||
|
||||
if (!strlen($username) || !$has_password) {
|
||||
if (!phutil_nonempty_string($username) || !$has_password) {
|
||||
$response = $controller->buildProviderPageResponse(
|
||||
$this,
|
||||
$this->renderLoginForm($request, 'login'));
|
||||
|
@ -154,7 +154,7 @@ final class PhabricatorLDAPAuthProvider extends PhabricatorAuthProvider {
|
|||
|
||||
if ($request->isFormPost()) {
|
||||
try {
|
||||
if (strlen($username) && $has_password) {
|
||||
if (phutil_nonempty_string($username) && $has_password) {
|
||||
$adapter = $this->getAdapter();
|
||||
$adapter->setLoginUsername($username);
|
||||
$adapter->setLoginPassword($password);
|
||||
|
|
|
@ -63,7 +63,7 @@ final class PhabricatorAuthAccountView extends AphrontView {
|
|||
));
|
||||
|
||||
$account_uri = $account->getAccountURI();
|
||||
if (strlen($account_uri)) {
|
||||
if (phutil_nonempty_string($account_uri)) {
|
||||
|
||||
// Make sure we don't link a "javascript:" URI if a user somehow
|
||||
// managed to get one here.
|
||||
|
|
|
@ -6,6 +6,8 @@ final class PhabricatorBadgesAwardController
|
|||
public function handleRequest(AphrontRequest $request) {
|
||||
$viewer = $request->getViewer();
|
||||
$id = $request->getURIData('id');
|
||||
$errors = array();
|
||||
$e_badge = true;
|
||||
|
||||
$user = id(new PhabricatorPeopleQuery())
|
||||
->setViewer($viewer)
|
||||
|
@ -19,6 +21,12 @@ final class PhabricatorBadgesAwardController
|
|||
|
||||
if ($request->isFormPost()) {
|
||||
$badge_phids = $request->getArr('badgePHIDs');
|
||||
|
||||
if (empty($badge_phids)) {
|
||||
$errors[] = pht('Badge name is required.');
|
||||
$e_badge = pht('Required');
|
||||
}
|
||||
if (!$errors) {
|
||||
$badges = id(new PhabricatorBadgesQuery())
|
||||
->setViewer($viewer)
|
||||
->withPHIDs($badge_phids)
|
||||
|
@ -28,9 +36,6 @@ final class PhabricatorBadgesAwardController
|
|||
PhabricatorPolicyCapability::CAN_VIEW,
|
||||
))
|
||||
->execute();
|
||||
if (!$badges) {
|
||||
return new Aphront404Response();
|
||||
}
|
||||
$award_phids = array($user->getPHID());
|
||||
|
||||
foreach ($badges as $badge) {
|
||||
|
@ -51,6 +56,7 @@ final class PhabricatorBadgesAwardController
|
|||
return id(new AphrontRedirectResponse())
|
||||
->setURI($view_uri);
|
||||
}
|
||||
}
|
||||
|
||||
$form = id(new AphrontFormView())
|
||||
->setUser($viewer)
|
||||
|
@ -58,6 +64,7 @@ final class PhabricatorBadgesAwardController
|
|||
id(new AphrontFormTokenizerControl())
|
||||
->setLabel(pht('Badge'))
|
||||
->setName('badgePHIDs')
|
||||
->setError($e_badge)
|
||||
->setDatasource(
|
||||
id(new PhabricatorBadgesDatasource())
|
||||
->setParameters(
|
||||
|
|
|
@ -7,6 +7,8 @@ final class PhabricatorBadgesEditRecipientsController
|
|||
$viewer = $request->getViewer();
|
||||
$id = $request->getURIData('id');
|
||||
$xactions = array();
|
||||
$errors = array();
|
||||
$e_recipient = true;
|
||||
|
||||
$badge = id(new PhabricatorBadgesQuery())
|
||||
->setViewer($viewer)
|
||||
|
@ -29,10 +31,14 @@ final class PhabricatorBadgesEditRecipientsController
|
|||
$add_recipients = $request->getArr('phids');
|
||||
if ($add_recipients) {
|
||||
foreach ($add_recipients as $phid) {
|
||||
$award_phids[] = $phid;
|
||||
$award_phids[$phid] = $phid;
|
||||
}
|
||||
} else {
|
||||
$errors[] = pht('Recipient name is required.');
|
||||
$e_recipient = pht('Required');
|
||||
}
|
||||
|
||||
if (!$errors) {
|
||||
$xactions[] = id(new PhabricatorBadgesTransaction())
|
||||
->setTransactionType(
|
||||
PhabricatorBadgesBadgeAwardTransaction::TRANSACTIONTYPE)
|
||||
|
@ -48,16 +54,7 @@ final class PhabricatorBadgesEditRecipientsController
|
|||
return id(new AphrontRedirectResponse())
|
||||
->setURI($view_uri);
|
||||
}
|
||||
|
||||
$can_edit = PhabricatorPolicyFilter::hasCapability(
|
||||
$viewer,
|
||||
$badge,
|
||||
PhabricatorPolicyCapability::CAN_EDIT);
|
||||
|
||||
$form_box = null;
|
||||
$title = pht('Add Recipient');
|
||||
if ($can_edit) {
|
||||
$header_name = pht('Edit Recipients');
|
||||
}
|
||||
|
||||
$form = new AphrontFormView();
|
||||
$form
|
||||
|
@ -67,8 +64,8 @@ final class PhabricatorBadgesEditRecipientsController
|
|||
id(new AphrontFormTokenizerControl())
|
||||
->setName('phids')
|
||||
->setLabel(pht('Recipients'))
|
||||
->setError($e_recipient)
|
||||
->setDatasource(new PhabricatorPeopleDatasource()));
|
||||
}
|
||||
|
||||
$dialog = id(new AphrontDialogView())
|
||||
->setUser($viewer)
|
||||
|
|
|
@ -141,7 +141,7 @@ abstract class PhabricatorApplication
|
|||
*
|
||||
* Users who have not yet set preferences see a default list of applications.
|
||||
*
|
||||
* @param PhabricatorUser User viewing the pinned application list.
|
||||
* @param PhabricatorUser $viewer User viewing the pinned application list.
|
||||
* @return bool True if this application should be pinned by default.
|
||||
*/
|
||||
public function isPinnedByDefault(PhabricatorUser $viewer) {
|
||||
|
@ -330,9 +330,9 @@ abstract class PhabricatorApplication
|
|||
/**
|
||||
* Build items for the main menu.
|
||||
*
|
||||
* @param PhabricatorUser The viewing user.
|
||||
* @param AphrontController The current controller. May be null for special
|
||||
* pages like 404, exception handlers, etc.
|
||||
* @param PhabricatorUser $user The viewing user.
|
||||
* @param AphrontController? $controller The current controller. May be null
|
||||
* for special pages like 404, exception handlers, etc.
|
||||
* @return list<PHUIListItemView> List of menu items.
|
||||
* @task ui
|
||||
*/
|
||||
|
@ -409,7 +409,7 @@ abstract class PhabricatorApplication
|
|||
* To check if an application is installed //and// available to a particular
|
||||
* viewer, user @{method:isClassInstalledForViewer}.
|
||||
*
|
||||
* @param string Application class name.
|
||||
* @param string $class Application class name.
|
||||
* @return bool True if the class is installed.
|
||||
* @task meta
|
||||
*/
|
||||
|
@ -425,8 +425,8 @@ abstract class PhabricatorApplication
|
|||
* To check if an application is installed at all, use
|
||||
* @{method:isClassInstalled}.
|
||||
*
|
||||
* @param string Application class name.
|
||||
* @param PhabricatorUser Viewing user.
|
||||
* @param string $class Application class name.
|
||||
* @param PhabricatorUser $viewer Viewing user.
|
||||
* @return bool True if the class is installed for the viewer.
|
||||
* @task meta
|
||||
*/
|
||||
|
|
|
@ -627,25 +627,4 @@ abstract class PhabricatorController extends AphrontController {
|
|||
return $this->delegateToController($controller);
|
||||
}
|
||||
|
||||
|
||||
/* -( Deprecated )--------------------------------------------------------- */
|
||||
|
||||
|
||||
/**
|
||||
* DEPRECATED. Use @{method:newPage}.
|
||||
*/
|
||||
public function buildStandardPageView() {
|
||||
return $this->newPage();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* DEPRECATED. Use @{method:newPage}.
|
||||
*/
|
||||
public function buildStandardPageResponse($view, array $data) {
|
||||
$page = $this->buildStandardPageView();
|
||||
$page->appendChild($view);
|
||||
return $page->produceAphrontResponse();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
4
src/applications/cache/PhabricatorCaches.php
vendored
4
src/applications/cache/PhabricatorCaches.php
vendored
|
@ -416,7 +416,7 @@ final class PhabricatorCaches extends Phobject {
|
|||
*
|
||||
* Data can later be inflated with @{method:inflateData}.
|
||||
*
|
||||
* @param string String to attempt to deflate.
|
||||
* @param string $value String to attempt to deflate.
|
||||
* @return string|null Deflated string, or null if it was not deflated.
|
||||
* @task compress
|
||||
*/
|
||||
|
@ -447,7 +447,7 @@ final class PhabricatorCaches extends Phobject {
|
|||
/**
|
||||
* Inflate data previously deflated by @{method:maybeDeflateData}.
|
||||
*
|
||||
* @param string Deflated data, from @{method:maybeDeflateData}.
|
||||
* @param string $value Deflated data, from @{method:maybeDeflateData}.
|
||||
* @return string Original, uncompressed data.
|
||||
* @task compress
|
||||
*/
|
||||
|
|
|
@ -235,14 +235,14 @@ abstract class PhabricatorCalendarImportEngine
|
|||
// We avoid disclosing email addresses to be consistent with the rest
|
||||
// of the product.
|
||||
$name = $attendee->getName();
|
||||
if (preg_match('/@/', $name)) {
|
||||
if (phutil_nonempty_string($name) && preg_match('/@/', $name)) {
|
||||
$name = new PhutilEmailAddress($name);
|
||||
$name = $name->getDisplayName();
|
||||
}
|
||||
|
||||
// If we don't have a name or the name still looks like it's an
|
||||
// email address, give them a dummy placeholder name.
|
||||
if (!strlen($name) || preg_match('/@/', $name)) {
|
||||
if (!phutil_nonempty_string($name) || preg_match('/@/', $name)) {
|
||||
$name = pht('Private User %d', $private_index);
|
||||
$private_index++;
|
||||
}
|
||||
|
|
|
@ -525,6 +525,10 @@ final class PhabricatorCalendarEventSearchEngine
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param PhabricatorSavedQuery $saved
|
||||
* @return AphrontFormDateControlValue
|
||||
*/
|
||||
private function getQueryDateFrom(PhabricatorSavedQuery $saved) {
|
||||
if ($this->calendarYear && $this->calendarMonth) {
|
||||
$viewer = $this->requireViewer();
|
||||
|
|
|
@ -28,8 +28,12 @@ final class PhabricatorCalendarInviteeViewerFunctionDatasource
|
|||
);
|
||||
}
|
||||
|
||||
protected function isFunctionWithLoginRequired($function) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function loadResults() {
|
||||
if ($this->getViewer()->getPHID()) {
|
||||
if ($this->getViewer()->isLoggedIn()) {
|
||||
$results = array($this->renderViewerFunctionToken());
|
||||
} else {
|
||||
$results = array();
|
||||
|
@ -39,7 +43,7 @@ final class PhabricatorCalendarInviteeViewerFunctionDatasource
|
|||
}
|
||||
|
||||
protected function canEvaluateFunction($function) {
|
||||
if (!$this->getViewer()->getPHID()) {
|
||||
if (!$this->getViewer()->isLoggedIn()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -160,7 +160,7 @@ final class CelerityResourceMap extends Phobject {
|
|||
/**
|
||||
* Get the epoch timestamp of the last modification time of a symbol.
|
||||
*
|
||||
* @param string Resource symbol to lookup.
|
||||
* @param string $name Resource symbol to lookup.
|
||||
* @return int Epoch timestamp of last resource modification.
|
||||
*/
|
||||
public function getModifiedTimeForName($name) {
|
||||
|
@ -186,7 +186,7 @@ final class CelerityResourceMap extends Phobject {
|
|||
* Return the absolute URI for the resource associated with a symbol. This
|
||||
* method is fairly low-level and ignores packaging.
|
||||
*
|
||||
* @param string Resource symbol to lookup.
|
||||
* @param string $symbol Resource symbol to lookup.
|
||||
* @return string|null Resource URI, or null if the symbol is unknown.
|
||||
*/
|
||||
public function getURIForSymbol($symbol) {
|
||||
|
@ -199,7 +199,7 @@ final class CelerityResourceMap extends Phobject {
|
|||
* Return the absolute URI for the resource associated with a resource name.
|
||||
* This method is fairly low-level and ignores packaging.
|
||||
*
|
||||
* @param string Resource name to lookup.
|
||||
* @param string $name Resource name to lookup.
|
||||
* @return string|null Resource URI, or null if the name is unknown.
|
||||
*/
|
||||
public function getURIForName($name) {
|
||||
|
@ -217,7 +217,7 @@ final class CelerityResourceMap extends Phobject {
|
|||
* Return the absolute URI for a resource, identified by hash.
|
||||
* This method is fairly low-level and ignores packaging.
|
||||
*
|
||||
* @param string Resource hash to lookup.
|
||||
* @param string $hash Resource hash to lookup.
|
||||
* @return string|null Resource URI, or null if the hash is unknown.
|
||||
*/
|
||||
private function getURIForHash($hash) {
|
||||
|
@ -231,7 +231,7 @@ final class CelerityResourceMap extends Phobject {
|
|||
/**
|
||||
* Return the resource symbols required by a named resource.
|
||||
*
|
||||
* @param string Resource name to lookup.
|
||||
* @param string $name Resource name to lookup.
|
||||
* @return list<string>|null List of required symbols, or null if the name
|
||||
* is unknown.
|
||||
*/
|
||||
|
@ -247,7 +247,7 @@ final class CelerityResourceMap extends Phobject {
|
|||
/**
|
||||
* Return the resource name for a given symbol.
|
||||
*
|
||||
* @param string Resource symbol to lookup.
|
||||
* @param string $symbol Resource symbol to lookup.
|
||||
* @return string|null Resource name, or null if the symbol is unknown.
|
||||
*/
|
||||
public function getResourceNameForSymbol($symbol) {
|
||||
|
|
|
@ -146,7 +146,8 @@ EOFILE;
|
|||
* Find binary resources (like PNG and SWF) and return information about
|
||||
* them.
|
||||
*
|
||||
* @param CelerityPhysicalResources Resource map to find binary resources for.
|
||||
* @param CelerityPhysicalResources $resources Resource map to find binary
|
||||
* resources for.
|
||||
* @return map<string, map<string, string>> Resource information map.
|
||||
*/
|
||||
private function rebuildBinaryResources(
|
||||
|
@ -170,8 +171,10 @@ EOFILE;
|
|||
/**
|
||||
* Find text resources (like JS and CSS) and return information about them.
|
||||
*
|
||||
* @param CelerityPhysicalResources Resource map to find text resources for.
|
||||
* @param CelerityResourceTransformer Configured resource transformer.
|
||||
* @param CelerityPhysicalResources $resources Resource map to find text
|
||||
* resources for.
|
||||
* @param CelerityResourceTransformer $xformer Configured resource
|
||||
* transformer.
|
||||
* @return map<string, map<string, string>> Resource information map.
|
||||
*/
|
||||
private function rebuildTextResources(
|
||||
|
@ -211,8 +214,8 @@ EOFILE;
|
|||
* Parse the `@provides` and `@requires` symbols out of a text resource, like
|
||||
* JS or CSS.
|
||||
*
|
||||
* @param string Resource name.
|
||||
* @param string Resource data.
|
||||
* @param string $name Resource name.
|
||||
* @param string $data Resource data.
|
||||
* @return pair<string|null, list<string>|null> The `@provides` symbol and
|
||||
* the list of `@requires` symbols. If the resource is not part of the
|
||||
* dependency graph, both are null.
|
||||
|
@ -254,8 +257,8 @@ EOFILE;
|
|||
* Check for dependency cycles in the resource graph. Raises an exception if
|
||||
* a cycle is detected.
|
||||
*
|
||||
* @param map<string, list<string>> Map of `@provides` symbols to their
|
||||
* `@requires` symbols.
|
||||
* @param map<string, list<string>> $nodes Map of `@provides` symbols to
|
||||
* their `@requires` symbols.
|
||||
* @return void
|
||||
*/
|
||||
private function detectGraphCycles(array $nodes) {
|
||||
|
@ -278,9 +281,9 @@ EOFILE;
|
|||
/**
|
||||
* Build package specifications for a given resource source.
|
||||
*
|
||||
* @param CelerityPhysicalResources Resource source to rebuild.
|
||||
* @param map<string, string> Map of `@provides` to hashes.
|
||||
* @param map<string, string> Map of hashes to resource names.
|
||||
* @param CelerityPhysicalResources $resources Resource source to rebuild.
|
||||
* @param map<string, string> $symbol_map Map of `@provides` to hashes.
|
||||
* @param map<string, string> $reverse_map Map of hashes to resource names.
|
||||
* @return map<string, map<string, string>> Package information maps.
|
||||
*/
|
||||
private function rebuildPackages(
|
||||
|
|
|
@ -228,7 +228,8 @@ final class CelerityResourceTransformer extends Phobject {
|
|||
* small enough. Otherwise, this method will return `null` and we'll end up
|
||||
* using a normal URI instead.
|
||||
*
|
||||
* @param string Resource name to attempt to generate a data URI for.
|
||||
* @param string $resource_name Resource name to attempt to generate a data
|
||||
* URI for.
|
||||
* @return string|null Data URI, or null if we declined to generate one.
|
||||
*/
|
||||
private function generateDataURI($resource_name) {
|
||||
|
|
|
@ -9,8 +9,9 @@
|
|||
*
|
||||
* For more information, see @{article:Adding New CSS and JS}.
|
||||
*
|
||||
* @param string Name of the celerity module to include. This is whatever you
|
||||
* annotated as "@provides" in the file.
|
||||
* @param string $symbol Name of the celerity module to include. This is
|
||||
* whatever you annotated as "@provides" in the file.
|
||||
* @param string? $source_name
|
||||
* @return void
|
||||
*/
|
||||
function require_celerity_resource($symbol, $source_name = 'phabricator') {
|
||||
|
@ -40,7 +41,8 @@ function celerity_generate_unique_node_id() {
|
|||
/**
|
||||
* Get the versioned URI for a raw resource, like an image.
|
||||
*
|
||||
* @param string Path to the raw image.
|
||||
* @param string $resource Path to the raw image.
|
||||
* @param string? $source
|
||||
* @return string Versioned path to the image, if one is available.
|
||||
*/
|
||||
function celerity_get_resource_uri($resource, $source = 'phabricator') {
|
||||
|
|
|
@ -59,6 +59,7 @@ abstract class CelerityResourceController extends PhabricatorController {
|
|||
}
|
||||
|
||||
$cache = null;
|
||||
$cache_key = null;
|
||||
$data = null;
|
||||
if ($is_cacheable && $is_locally_cacheable && !$dev_mode) {
|
||||
$cache = PhabricatorCaches::getImmutableCache();
|
||||
|
@ -98,7 +99,7 @@ abstract class CelerityResourceController extends PhabricatorController {
|
|||
$data = $xformer->transformResource($path, $data);
|
||||
}
|
||||
|
||||
if ($cache) {
|
||||
if ($cache && $cache_key !== null) {
|
||||
$cache->setKey($cache_key, $data);
|
||||
}
|
||||
}
|
||||
|
@ -193,7 +194,7 @@ abstract class CelerityResourceController extends PhabricatorController {
|
|||
* are cached, while other types of resources (which are large, and cheap
|
||||
* to process) are not.
|
||||
*
|
||||
* @param string Resource type.
|
||||
* @param string $type Resource type.
|
||||
* @return bool True to enable caching.
|
||||
*/
|
||||
private function isLocallyCacheableResourceType($type) {
|
||||
|
|
|
@ -32,7 +32,7 @@ final class CelerityManagementMapWorkflow
|
|||
/**
|
||||
* Rebuild the resource map for a resource source.
|
||||
*
|
||||
* @param CelerityPhysicalResources Resource source to rebuild.
|
||||
* @param $resources CelerityPhysicalResources Resource source to rebuild.
|
||||
* @return void
|
||||
*/
|
||||
private function rebuildResources(CelerityPhysicalResources $resources) {
|
||||
|
|
|
@ -159,8 +159,9 @@ final class PhabricatorConduitAPIController
|
|||
/**
|
||||
* Authenticate the client making the request to a Phabricator user account.
|
||||
*
|
||||
* @param ConduitAPIRequest Request being executed.
|
||||
* @param dict Request metadata.
|
||||
* @param ConduitAPIRequest $api_request Request being executed.
|
||||
* @param dict $metadata Request metadata.
|
||||
* @param wild $method
|
||||
* @return null|pair Null to indicate successful authentication, or
|
||||
* an error code and error message pair.
|
||||
*/
|
||||
|
|
|
@ -12,7 +12,7 @@ class ConduitException extends Exception {
|
|||
* will be used instead. This is useful to provide specific information about
|
||||
* an exception (e.g., which values were wrong in an invalid request).
|
||||
*
|
||||
* @param string Detailed error description.
|
||||
* @param string $error_description Detailed error description.
|
||||
* @return this
|
||||
*/
|
||||
final public function setErrorDescription($error_description) {
|
||||
|
|
|
@ -60,7 +60,7 @@ final class PhabricatorConfigConsoleController
|
|||
->setBackground(PHUIObjectBoxView::WHITE_CONFIG)
|
||||
->setObjectList($menu);
|
||||
|
||||
$versions = $this->newLibraryVersionTable($viewer);
|
||||
$versions = $this->newLibraryVersionTable();
|
||||
$binary_versions = $this->newBinaryVersionTable();
|
||||
|
||||
$launcher_view = id(new PHUILauncherView())
|
||||
|
|
|
@ -13,6 +13,45 @@ final class PhabricatorCustomLogoConfigType
|
|||
return idx($logo, 'wordmarkText');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the full URI of the Phorge logo
|
||||
* @param PhabricatorUser $viewer Current viewer
|
||||
* @return string Full URI of the Phorge logo
|
||||
*/
|
||||
public static function getLogoURI(PhabricatorUser $viewer) {
|
||||
$logo_uri = null;
|
||||
|
||||
$custom_header = self::getLogoImagePHID();
|
||||
if ($custom_header) {
|
||||
$cache = PhabricatorCaches::getImmutableCache();
|
||||
$cache_key_logo = 'ui.custom-header.logo-phid.v3.'.$custom_header;
|
||||
$logo_uri = $cache->getKey($cache_key_logo);
|
||||
|
||||
if (!$logo_uri) {
|
||||
// NOTE: If the file policy has been changed to be restrictive, we'll
|
||||
// miss here and just show the default logo. The cache will fill later
|
||||
// when someone who can see the file loads the page. This might be a
|
||||
// little spooky, see T11982.
|
||||
$files = id(new PhabricatorFileQuery())
|
||||
->setViewer($viewer)
|
||||
->withPHIDs(array($custom_header))
|
||||
->execute();
|
||||
$file = head($files);
|
||||
if ($file) {
|
||||
$logo_uri = $file->getViewURI();
|
||||
$cache->setKey($cache_key_logo, $logo_uri);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$logo_uri) {
|
||||
$logo_uri =
|
||||
celerity_get_resource_uri('/rsrc/image/logo/project-logo.png');
|
||||
}
|
||||
|
||||
return $logo_uri;
|
||||
}
|
||||
|
||||
public function validateOption(PhabricatorConfigOption $option, $value) {
|
||||
if (!is_array($value)) {
|
||||
throw new Exception(
|
||||
|
|
|
@ -145,8 +145,8 @@ final class PhabricatorSetupIssue extends Phobject {
|
|||
* we alter `memory_limit` during startup, so if the original value is not
|
||||
* provided it will look like it is always set to `-1`.
|
||||
*
|
||||
* @param string PHP configuration option to provide a value for.
|
||||
* @param string Explicit value to show in the UI.
|
||||
* @param string $php_config PHP configuration option to provide a value for.
|
||||
* @param string $value Explicit value to show in the UI.
|
||||
* @return this
|
||||
*/
|
||||
public function addPHPConfigOriginalValue($php_config, $value) {
|
||||
|
|
|
@ -4,7 +4,8 @@ final class PhabricatorConfigJSON extends Phobject {
|
|||
/**
|
||||
* Properly format a JSON value.
|
||||
*
|
||||
* @param wild Any value, but should be a raw value, not a string of JSON.
|
||||
* @param wild $value Any value, but should be a raw value, not a string of
|
||||
* JSON.
|
||||
* @return string
|
||||
*/
|
||||
public static function prettyPrintJSON($value) {
|
||||
|
|
|
@ -8,7 +8,7 @@ final class PhabricatorAWSConfigOptions
|
|||
}
|
||||
|
||||
public function getDescription() {
|
||||
return pht('Configure integration with AWS (EC2, SES, S3, etc).');
|
||||
return pht('Configure integration with AWS (EC2, SES, S3, etc.).');
|
||||
}
|
||||
|
||||
public function getIcon() {
|
||||
|
|
|
@ -65,8 +65,8 @@ abstract class PhabricatorApplicationConfigOptions extends Phobject {
|
|||
* or other context. For example, this is used to show workspace IDs when
|
||||
* configuring `asana.workspace-id`.
|
||||
*
|
||||
* @param PhabricatorConfigOption Option being rendered.
|
||||
* @param AphrontRequest Active request.
|
||||
* @param PhabricatorConfigOption $option Option being rendered.
|
||||
* @param AphrontRequest $request Active request.
|
||||
* @return wild Additional contextual description
|
||||
* information.
|
||||
*/
|
||||
|
|
|
@ -79,6 +79,30 @@ final class ConpherenceUpdateController
|
|||
$user,
|
||||
$conpherence,
|
||||
$message);
|
||||
|
||||
$xaction_comment = PhabricatorTransactions::findOneByType(
|
||||
$xactions,
|
||||
PhabricatorTransactions::TYPE_COMMENT);
|
||||
|
||||
$text_metadata = $request->getStr('text_metadata');
|
||||
if ($text_metadata) {
|
||||
$text_metadata = phutil_json_decode($text_metadata);
|
||||
$attached_file_phids = idx(
|
||||
$text_metadata,
|
||||
'attachedFilePHIDs',
|
||||
array());
|
||||
|
||||
if ($attached_file_phids) {
|
||||
$metadata_object = array(
|
||||
'remarkup.control' => array(
|
||||
'attachedFilePHIDs' => $attached_file_phids,
|
||||
),
|
||||
);
|
||||
|
||||
$xaction_comment->setMetadata($metadata_object);
|
||||
}
|
||||
}
|
||||
|
||||
$delete_draft = true;
|
||||
} else {
|
||||
$action = ConpherenceUpdateActions::LOAD;
|
||||
|
|
|
@ -472,23 +472,4 @@ final class ConpherenceDurableColumnView extends AphrontTagView {
|
|||
));
|
||||
}
|
||||
|
||||
private function buildStatusText() {
|
||||
return null;
|
||||
}
|
||||
|
||||
private function buildSendButton() {
|
||||
$conpherence = $this->getSelectedConpherence();
|
||||
if (!$conpherence) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return javelin_tag(
|
||||
'button',
|
||||
array(
|
||||
'class' => 'grey',
|
||||
'sigil' => 'conpherence-send-message',
|
||||
),
|
||||
pht('Send'));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ abstract class PhabricatorDaemonController
|
|||
}
|
||||
|
||||
public function buildApplicationMenu() {
|
||||
return $this->buildSideNavView(true)->getMenu();
|
||||
return $this->buildSideNavView()->getMenu();
|
||||
}
|
||||
|
||||
protected function buildSideNavView() {
|
||||
|
|
|
@ -48,23 +48,4 @@ final class PhabricatorDashboardPanelListController
|
|||
return $crumbs;
|
||||
}
|
||||
|
||||
protected function getNewUserBody() {
|
||||
$create_button = id(new PHUIButtonView())
|
||||
->setTag('a')
|
||||
->setText(pht('Create a Panel'))
|
||||
->setHref('/dashboard/panel/edit/')
|
||||
->setColor(PHUIButtonView::GREEN);
|
||||
|
||||
$icon = $this->getApplication()->getIcon();
|
||||
$app_name = $this->getApplication()->getName();
|
||||
$view = id(new PHUIBigInfoView())
|
||||
->setIcon($icon)
|
||||
->setTitle(pht('Welcome to %s', $app_name))
|
||||
->setDescription(
|
||||
pht('Build individual panels to display on your homepage dashboard.'))
|
||||
->addAction($create_button);
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ final class PhabricatorDashboardQueryPanelQueryEditField
|
|||
}
|
||||
}
|
||||
|
||||
if (strlen($value) && !$seen) {
|
||||
if (phutil_nonempty_string($value) && !$seen) {
|
||||
$name = pht('Custom Query ("%s")', $value);
|
||||
} else {
|
||||
$name = pht('(None)');
|
||||
|
@ -56,7 +56,7 @@ final class PhabricatorDashboardQueryPanelQueryEditField
|
|||
'queryID' => $control_id,
|
||||
'options' => $queries,
|
||||
'value' => array(
|
||||
'key' => strlen($value) ? $value : null,
|
||||
'key' => phutil_nonempty_string($value) ? $value : null,
|
||||
'name' => $name,
|
||||
),
|
||||
));
|
||||
|
|
|
@ -427,7 +427,7 @@ final class PhabricatorDashboardPanelRenderingEngine extends Phobject {
|
|||
* panel. Generally, all of this stuff is ridiculous and we just want to
|
||||
* shut it down.
|
||||
*
|
||||
* @param PhabricatorDashboardPanel Panel being rendered.
|
||||
* @param PhabricatorDashboardPanel $panel Panel being rendered.
|
||||
* @return void
|
||||
*/
|
||||
private function detectRenderingCycle(PhabricatorDashboardPanel $panel) {
|
||||
|
|
|
@ -41,7 +41,7 @@ final class PhabricatorDashboardPortalProfileMenuEngine
|
|||
pht('New Portal'),
|
||||
pht('Use "Edit Menu" to add menu items to this portal.'));
|
||||
} else {
|
||||
return $this->newEmptyValue(
|
||||
return $this->newNoContentView(
|
||||
pht('No Portal Content'),
|
||||
pht(
|
||||
'None of the visible menu items in this portal can render any '.
|
||||
|
|
|
@ -31,7 +31,7 @@ final class PhabricatorDashboardPortalMenuItem
|
|||
PhabricatorProfileMenuItemConfiguration $config) {
|
||||
$name = $config->getMenuItemProperty('name');
|
||||
|
||||
if (strlen($name)) {
|
||||
if (phutil_nonempty_string($name)) {
|
||||
return $name;
|
||||
}
|
||||
|
||||
|
|
|
@ -147,4 +147,22 @@ final class PhabricatorDashboardPanelSearchEngine
|
|||
return $result;
|
||||
}
|
||||
|
||||
protected function getNewUserBody() {
|
||||
$create_button = id(new PHUIButtonView())
|
||||
->setTag('a')
|
||||
->setText(pht('Create a Panel'))
|
||||
->setHref('/dashboard/panel/edit/')
|
||||
->setColor(PHUIButtonView::GREEN);
|
||||
|
||||
$app_name = pht('Panels');
|
||||
$view = id(new PHUIBigInfoView())
|
||||
->setIcon('fa-line-chart')
|
||||
->setTitle(pht('Welcome to %s', $app_name))
|
||||
->setDescription(
|
||||
pht('Build individual panels to display on your homepage dashboard.'))
|
||||
->addAction($create_button);
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ final class DifferentialReviewerStatus extends Phobject {
|
|||
* will attempt to update you to both "commented" and "accepted". We want
|
||||
* "accepted" to win, because it's the stronger of the two.
|
||||
*
|
||||
* @param const Reviewer status constant.
|
||||
* @param const $constant Reviewer status constant.
|
||||
* @return int Relative strength (higher is stronger).
|
||||
*/
|
||||
public static function getStatusStrength($constant) {
|
||||
|
|
|
@ -63,4 +63,16 @@ final class DifferentialRepositoryField
|
|||
$repository->getMonogram().' '.$repository->getName());
|
||||
}
|
||||
|
||||
public function shouldAppearInListView() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function renderOnListItem(PHUIObjectItemView $view) {
|
||||
if ($this->getValue()) {
|
||||
$handle = $this->getViewer()->renderHandle($this->getValue());
|
||||
$view->addByLine(pht('Repository: %s', $handle));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -240,12 +240,12 @@ final class DifferentialChangesetParser extends Phobject {
|
|||
* the left and right halves of the displayed diff to be correctly mapped to
|
||||
* storage changesets.
|
||||
*
|
||||
* @param id The Differential Changeset ID that comments added to the right
|
||||
* side of the visible diff should be attached to.
|
||||
* @param bool If true, attach new comments to the right side of the storage
|
||||
* changeset. Note that this may be false, if the left side of
|
||||
* some storage changeset is being shown as the right side of
|
||||
* a display diff.
|
||||
* @param id $id The Differential Changeset ID that comments added to the
|
||||
* right side of the visible diff should be attached to.
|
||||
* @param bool $is_new If true, attach new comments to the right side of the
|
||||
* storage changeset. Note that this may be false, if the left
|
||||
* side of some storage changeset is being shown as the right
|
||||
* side of a display diff.
|
||||
* @return this
|
||||
*/
|
||||
public function setRightSideCommentMapping($id, $is_new) {
|
||||
|
@ -295,7 +295,8 @@ final class DifferentialChangesetParser extends Phobject {
|
|||
* By default, there is no render cache key and parsers do not use the cache.
|
||||
* This is appropriate for rarely-viewed changesets.
|
||||
*
|
||||
* @param string Key for identifying this changeset in the render cache.
|
||||
* @param string $key Key for identifying this changeset in the render
|
||||
* cache.
|
||||
* @return this
|
||||
*/
|
||||
public function setRenderCacheKey($key) {
|
||||
|
@ -1238,7 +1239,7 @@ final class DifferentialChangesetParser extends Phobject {
|
|||
* taking into consideration which halves of which changesets will actually
|
||||
* be shown.
|
||||
*
|
||||
* @param PhabricatorInlineComment Comment to test for visibility.
|
||||
* @param PhabricatorInlineComment $comment Comment to test for visibility.
|
||||
* @return bool True if the comment is visible on the rendered diff.
|
||||
*/
|
||||
private function isCommentVisibleOnRenderedDiff(
|
||||
|
@ -1266,7 +1267,7 @@ final class DifferentialChangesetParser extends Phobject {
|
|||
* Note that the comment must appear somewhere on the rendered changeset, as
|
||||
* per isCommentVisibleOnRenderedDiff().
|
||||
*
|
||||
* @param PhabricatorInlineComment Comment to test for display
|
||||
* @param PhabricatorInlineComment $comment Comment to test for display
|
||||
* location.
|
||||
* @return bool True for right, false for left.
|
||||
*/
|
||||
|
@ -1298,8 +1299,8 @@ final class DifferentialChangesetParser extends Phobject {
|
|||
* list($start, $end, $mask) = $parsed;
|
||||
* $parser->render($start, $end, $mask);
|
||||
*
|
||||
* @param string Range specification, indicating the range of the diff that
|
||||
* should be rendered.
|
||||
* @param string $spec Range specification, indicating the range of the diff
|
||||
* that should be rendered.
|
||||
* @return tuple List of <start, end, mask> suitable for passing to
|
||||
* @{method:render}.
|
||||
*/
|
||||
|
|
|
@ -58,8 +58,8 @@ final class DifferentialLineAdjustmentMap extends Phobject {
|
|||
/**
|
||||
* Map a line across a change, or a series of changes.
|
||||
*
|
||||
* @param int Line to map
|
||||
* @param bool True to map it as the end of a range.
|
||||
* @param int $line Line to map
|
||||
* @param bool $is_end True to map it as the end of a range.
|
||||
* @return wild Spooky magic.
|
||||
*/
|
||||
public function mapLine($line, $is_end) {
|
||||
|
|
|
@ -45,7 +45,7 @@ final class DifferentialRevisionQuery
|
|||
/**
|
||||
* Find revisions affecting one or more items in a list of paths.
|
||||
*
|
||||
* @param list<string> List of file paths.
|
||||
* @param list<string> $paths List of file paths.
|
||||
* @return this
|
||||
* @task config
|
||||
*/
|
||||
|
@ -59,7 +59,7 @@ final class DifferentialRevisionQuery
|
|||
* this function will clear anything set by previous calls to
|
||||
* @{method:withAuthors}.
|
||||
*
|
||||
* @param array List of PHIDs of authors
|
||||
* @param array $author_phids List of PHIDs of authors
|
||||
* @return this
|
||||
* @task config
|
||||
*/
|
||||
|
@ -72,7 +72,7 @@ final class DifferentialRevisionQuery
|
|||
* Filter results to revisions which CC one of the listed people. Calling this
|
||||
* function will clear anything set by previous calls to @{method:withCCs}.
|
||||
*
|
||||
* @param array List of PHIDs of subscribers.
|
||||
* @param array $cc_phids List of PHIDs of subscribers.
|
||||
* @return this
|
||||
* @task config
|
||||
*/
|
||||
|
@ -86,7 +86,7 @@ final class DifferentialRevisionQuery
|
|||
* reviewers. Calling this function will clear anything set by previous calls
|
||||
* to @{method:withReviewers}.
|
||||
*
|
||||
* @param array List of PHIDs of reviewers
|
||||
* @param array $reviewer_phids List of PHIDs of reviewers
|
||||
* @return this
|
||||
* @task config
|
||||
*/
|
||||
|
@ -124,7 +124,7 @@ final class DifferentialRevisionQuery
|
|||
* Calling this function will clear anything set by previous calls to
|
||||
* @{method:withCommitHashes}.
|
||||
*
|
||||
* @param array List of pairs <Class
|
||||
* @param array $commit_hashes List of pairs <Class
|
||||
* ArcanistDifferentialRevisionHash::HASH_$type constant,
|
||||
* hash>
|
||||
* @return this
|
||||
|
@ -149,7 +149,7 @@ final class DifferentialRevisionQuery
|
|||
/**
|
||||
* Filter results to revisions on given branches.
|
||||
*
|
||||
* @param list List of branch names.
|
||||
* @param list $branches List of branch names.
|
||||
* @return this
|
||||
* @task config
|
||||
*/
|
||||
|
@ -162,7 +162,7 @@ final class DifferentialRevisionQuery
|
|||
/**
|
||||
* Filter results to only return revisions whose ids are in the given set.
|
||||
*
|
||||
* @param array List of revision ids
|
||||
* @param array $ids List of revision ids
|
||||
* @return this
|
||||
* @task config
|
||||
*/
|
||||
|
@ -175,7 +175,7 @@ final class DifferentialRevisionQuery
|
|||
/**
|
||||
* Filter results to only return revisions whose PHIDs are in the given set.
|
||||
*
|
||||
* @param array List of revision PHIDs
|
||||
* @param array $phids List of revision PHIDs
|
||||
* @return this
|
||||
* @task config
|
||||
*/
|
||||
|
@ -189,7 +189,7 @@ final class DifferentialRevisionQuery
|
|||
* Given a set of users, filter results to return only revisions they are
|
||||
* responsible for (i.e., they are either authors or reviewers).
|
||||
*
|
||||
* @param array List of user PHIDs.
|
||||
* @param array $responsible_phids List of user PHIDs.
|
||||
* @return this
|
||||
* @task config
|
||||
*/
|
||||
|
@ -221,7 +221,7 @@ final class DifferentialRevisionQuery
|
|||
* Set whether or not the query should load the active diff for each
|
||||
* revision.
|
||||
*
|
||||
* @param bool True to load and attach diffs.
|
||||
* @param bool $need_active_diffs True to load and attach diffs.
|
||||
* @return this
|
||||
* @task config
|
||||
*/
|
||||
|
@ -235,7 +235,7 @@ final class DifferentialRevisionQuery
|
|||
* Set whether or not the query should load the associated commit PHIDs for
|
||||
* each revision.
|
||||
*
|
||||
* @param bool True to load and attach diffs.
|
||||
* @param bool $need_commit_phids True to load and attach diffs.
|
||||
* @return this
|
||||
* @task config
|
||||
*/
|
||||
|
@ -249,7 +249,7 @@ final class DifferentialRevisionQuery
|
|||
* Set whether or not the query should load associated diff IDs for each
|
||||
* revision.
|
||||
*
|
||||
* @param bool True to load and attach diff IDs.
|
||||
* @param bool $need_diff_ids True to load and attach diff IDs.
|
||||
* @return this
|
||||
* @task config
|
||||
*/
|
||||
|
@ -263,7 +263,7 @@ final class DifferentialRevisionQuery
|
|||
* Set whether or not the query should load associated commit hashes for each
|
||||
* revision.
|
||||
*
|
||||
* @param bool True to load and attach commit hashes.
|
||||
* @param bool $need_hashes True to load and attach commit hashes.
|
||||
* @return this
|
||||
* @task config
|
||||
*/
|
||||
|
@ -276,7 +276,7 @@ final class DifferentialRevisionQuery
|
|||
/**
|
||||
* Set whether or not the query should load associated reviewers.
|
||||
*
|
||||
* @param bool True to load and attach reviewers.
|
||||
* @param bool $need_reviewers True to load and attach reviewers.
|
||||
* @return this
|
||||
* @task config
|
||||
*/
|
||||
|
@ -291,7 +291,7 @@ final class DifferentialRevisionQuery
|
|||
* reviewer. In particular, they have authority to act on behalf of projects
|
||||
* they are a member of.
|
||||
*
|
||||
* @param bool True to load and attach authority.
|
||||
* @param bool $need_reviewer_authority True to load and attach authority.
|
||||
* @return this
|
||||
* @task config
|
||||
*/
|
||||
|
|
|
@ -199,6 +199,10 @@ final class DifferentialRevisionSearchEngine
|
|||
|
||||
$unlanded = $this->loadUnlandedDependencies($revisions);
|
||||
|
||||
$custom_field_lists = $this->loadCustomFields(
|
||||
$revisions,
|
||||
PhabricatorCustomField::ROLE_LIST);
|
||||
|
||||
$views = array();
|
||||
if ($bucket) {
|
||||
$bucket->setViewer($viewer);
|
||||
|
@ -231,6 +235,7 @@ final class DifferentialRevisionSearchEngine
|
|||
|
||||
foreach ($views as $view) {
|
||||
$view->setUnlandedDependencies($unlanded);
|
||||
$view->setCustomFieldLists($custom_field_lists);
|
||||
}
|
||||
|
||||
if (count($views) == 1) {
|
||||
|
|
|
@ -491,9 +491,10 @@ abstract class DifferentialChangesetHTMLRenderer
|
|||
/**
|
||||
* Build links which users can click to show more context in a changeset.
|
||||
*
|
||||
* @param int Beginning of the line range to build links for.
|
||||
* @param int Length of the line range to build links for.
|
||||
* @param int Total number of lines in the changeset.
|
||||
* @param int $top Beginning of the line range to build links for.
|
||||
* @param int $len Length of the line range to build links for.
|
||||
* @param int $changeset_length Total number of lines in the changeset.
|
||||
* @param bool? $is_blocks
|
||||
* @return markup Rendered links.
|
||||
*/
|
||||
protected function renderShowContextLinks(
|
||||
|
@ -580,9 +581,9 @@ abstract class DifferentialChangesetHTMLRenderer
|
|||
*
|
||||
* See @{method:renderShowContextLinks}.
|
||||
*
|
||||
* @param bool Does this link show all context when clicked?
|
||||
* @param string Range specification for lines to show.
|
||||
* @param string Text of the link.
|
||||
* @param bool $is_all Does this link show all context when clicked?
|
||||
* @param string $range Range specification for lines to show.
|
||||
* @param string $text Text of the link.
|
||||
* @return markup Rendered link.
|
||||
*/
|
||||
private function renderShowContextLink($is_all, $range, $text) {
|
||||
|
|
|
@ -442,8 +442,8 @@ abstract class DifferentialChangesetRenderer extends Phobject {
|
|||
* when a file is not changed.
|
||||
* - `"none"`: Don't show the link (e.g., text not available).
|
||||
*
|
||||
* @param string Message explaining why the diff is hidden.
|
||||
* @param string|null Force mode, see above.
|
||||
* @param string $message Message explaining why the diff is hidden.
|
||||
* @param string|null $force Force mode, see above.
|
||||
* @return string Shield markup.
|
||||
*/
|
||||
abstract public function renderShield($message, $force = 'default');
|
||||
|
|
|
@ -213,7 +213,7 @@ final class DifferentialChangeset
|
|||
* Test if this changeset and some other changeset put the affected file in
|
||||
* the same state.
|
||||
*
|
||||
* @param DifferentialChangeset Changeset to compare against.
|
||||
* @param DifferentialChangeset $other Changeset to compare against.
|
||||
* @return bool True if the two changesets have the same effect.
|
||||
*/
|
||||
public function hasSameEffectAs(DifferentialChangeset $other) {
|
||||
|
|
|
@ -28,8 +28,12 @@ final class DifferentialResponsibleViewerFunctionDatasource
|
|||
);
|
||||
}
|
||||
|
||||
protected function isFunctionWithLoginRequired($function) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function loadResults() {
|
||||
if ($this->getViewer()->getPHID()) {
|
||||
if ($this->getViewer()->isLoggedIn()) {
|
||||
$results = array($this->renderViewerFunctionToken());
|
||||
} else {
|
||||
$results = array();
|
||||
|
@ -39,7 +43,7 @@ final class DifferentialResponsibleViewerFunctionDatasource
|
|||
}
|
||||
|
||||
protected function canEvaluateFunction($function) {
|
||||
if (!$this->getViewer()->getPHID()) {
|
||||
if (!$this->getViewer()->isLoggedIn()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -233,6 +233,22 @@ final class DifferentialChangesetDetailView extends AphrontView {
|
|||
$show_directory_uri = phutil_string_cast($show_directory_uri);
|
||||
}
|
||||
|
||||
Javelin::initBehavior('phabricator-clipboard-copy');
|
||||
$path_copy_button = id(new PHUIButtonView())
|
||||
->setTag('a')
|
||||
->setColor(PHUIButtonView::GREY)
|
||||
->setIcon('fa-clipboard')
|
||||
->setHref('#')
|
||||
->addSigil('clipboard-copy')
|
||||
->addSigil('has-tooltip')
|
||||
->setMetadata(
|
||||
array(
|
||||
'tip' => pht('Copy file path'),
|
||||
'text' => $display_filename,
|
||||
'successMessage' => pht('File path copied.'),
|
||||
'errorMessage' => pht('Copy of file path failed.'),
|
||||
));
|
||||
|
||||
return javelin_tag(
|
||||
'div',
|
||||
array(
|
||||
|
@ -278,7 +294,16 @@ final class DifferentialChangesetDetailView extends AphrontView {
|
|||
'sigil' => 'changeset-header',
|
||||
),
|
||||
array(
|
||||
$icon,
|
||||
javelin_tag(
|
||||
'span',
|
||||
array(
|
||||
'class' => 'differential-changeset-path-copy-button',
|
||||
'meta' => array(
|
||||
'selectID' => $display_filename,
|
||||
'once' => true,
|
||||
),
|
||||
),
|
||||
$path_copy_button),
|
||||
javelin_tag(
|
||||
'span',
|
||||
array(
|
||||
|
|
|
@ -11,6 +11,7 @@ final class DifferentialRevisionListView extends AphrontView {
|
|||
private $noBox;
|
||||
private $background = null;
|
||||
private $unlandedDependencies = array();
|
||||
private $customFieldLists = array();
|
||||
|
||||
public function setUnlandedDependencies(array $unlanded_dependencies) {
|
||||
$this->unlandedDependencies = $unlanded_dependencies;
|
||||
|
@ -47,6 +48,11 @@ final class DifferentialRevisionListView extends AphrontView {
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function setCustomFieldLists(array $lists) {
|
||||
$this->customFieldLists = $lists;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function render() {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
|
@ -181,6 +187,12 @@ final class DifferentialRevisionListView extends AphrontView {
|
|||
"{$icon} {$color}",
|
||||
$revision->getStatusDisplayName());
|
||||
|
||||
$field_list = idx($this->customFieldLists, $revision->getPHID());
|
||||
if ($field_list) {
|
||||
$field_list
|
||||
->addFieldsToListViewItem($revision, $viewer, $item);
|
||||
}
|
||||
|
||||
$list->addItem($item);
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ final class DiffusionQueryPathsConduitAPIMethod
|
|||
|
||||
protected function getResult(ConduitAPIRequest $request) {
|
||||
$results = parent::getResult($request);
|
||||
$offset = $request->getValue('offset');
|
||||
$offset = $request->getValue('offset', 0);
|
||||
return array_slice($results, $offset);
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ final class DiffusionSearchQueryConduitAPIMethod
|
|||
throw $ex;
|
||||
}
|
||||
|
||||
$offset = $request->getValue('offset');
|
||||
$offset = $request->getValue('offset', 0);
|
||||
$results = array_slice($results, $offset);
|
||||
|
||||
return $results;
|
||||
|
|
|
@ -624,6 +624,13 @@ final class DiffusionCommitController extends DiffusionController {
|
|||
$author_view = $commit->newCommitAuthorView($viewer);
|
||||
if ($author_view) {
|
||||
$author_date = $data->getAuthorEpoch();
|
||||
|
||||
// Add support to Subversion commits that only have one date,
|
||||
// since in SVN you cannot prepare local commits to push them later.
|
||||
if ($author_date === null) {
|
||||
$author_date = $commit->getEpoch();
|
||||
}
|
||||
|
||||
$author_date = phabricator_datetime($author_date, $viewer);
|
||||
|
||||
$provenance_list->addItem(
|
||||
|
|
|
@ -123,7 +123,7 @@ final class DiffusionBrowseResultSet extends Phobject {
|
|||
* When a directory contains several README files, this function scores them
|
||||
* so the caller can select a preferred file. See @{method:getReadmePath}.
|
||||
*
|
||||
* @param string Local README path, like "README.txt".
|
||||
* @param string $path Local README path, like "README.txt".
|
||||
* @return int Priority score, with higher being more preferred.
|
||||
*/
|
||||
public static function getReadmePriority($path) {
|
||||
|
|
|
@ -19,8 +19,9 @@ final class DiffusionGitBranch extends Phobject {
|
|||
* 'master' => '99a9c082f9a1b68c7264e26b9e552484a5ae5f25',
|
||||
* );
|
||||
*
|
||||
* @param string stdout of git branch command.
|
||||
* @param string Filter branches to those on a specific remote.
|
||||
* @param string $stdout stdout of git branch command.
|
||||
* @param string? $only_this_remote Filter branches to those on a specific
|
||||
* remote.
|
||||
* @return map Map of 'branch' or 'remote/branch' to hash at HEAD.
|
||||
*/
|
||||
public static function parseRemoteBranchOutput(
|
||||
|
|
|
@ -58,7 +58,7 @@ final class DiffusionMercurialCommandEngine
|
|||
* Sanitize output of an `hg` command invoked with the `--debug` flag to make
|
||||
* it usable.
|
||||
*
|
||||
* @param string Output from `hg --debug ...`
|
||||
* @param string $stdout Output from `hg --debug ...`
|
||||
* @return string Usable output.
|
||||
*/
|
||||
public static function filterMercurialDebugOutput($stdout) {
|
||||
|
|
|
@ -586,7 +586,7 @@ final class DiffusionRepositoryClusterEngine extends Phobject {
|
|||
'for %s seconds(s). This repository will be frozen.',
|
||||
$this->clusterWriteOwner,
|
||||
$device->getName(),
|
||||
$this->getDisplayName(),
|
||||
$repository->getDisplayName(),
|
||||
new PhutilNumber($duration)));
|
||||
}
|
||||
|
||||
|
|
|
@ -252,7 +252,7 @@ final class DiffusionCommitQuery
|
|||
$table->getTableName());
|
||||
}
|
||||
|
||||
if (!$subqueries) {
|
||||
if (!$subqueries && $empty_exception) {
|
||||
throw $empty_exception;
|
||||
}
|
||||
|
||||
|
|
|
@ -126,11 +126,11 @@ final class DiffusionLowLevelCommitQuery
|
|||
$head = $parts[6];
|
||||
$tail = $parts[7];
|
||||
|
||||
if (strlen($head) && strlen($tail)) {
|
||||
if (phutil_nonempty_string($head) && phutil_nonempty_string($tail)) {
|
||||
$body = $head."\n\n".$tail;
|
||||
} else if (strlen($head)) {
|
||||
} else if (phutil_nonempty_string($head)) {
|
||||
$body = $head;
|
||||
} else if (strlen($tail)) {
|
||||
} else if (phutil_nonempty_string($tail)) {
|
||||
$body = $tail;
|
||||
} else {
|
||||
$body = '';
|
||||
|
|
|
@ -42,7 +42,7 @@ final class DiffusionPathIDQuery extends Phobject {
|
|||
/**
|
||||
* Convert a path to the canonical, absolute representation used by Diffusion.
|
||||
*
|
||||
* @param string Some repository path.
|
||||
* @param string $path Some repository path.
|
||||
* @return string Canonicalized Diffusion path.
|
||||
* @task pathutil
|
||||
*/
|
||||
|
@ -62,7 +62,7 @@ final class DiffusionPathIDQuery extends Phobject {
|
|||
* Return the canonical parent directory for a path. Note, returns "/" when
|
||||
* passed "/".
|
||||
*
|
||||
* @param string Some repository path.
|
||||
* @param string $path Some repository path.
|
||||
* @return string That path's canonical parent directory.
|
||||
* @task pathutil
|
||||
*/
|
||||
|
@ -80,7 +80,7 @@ final class DiffusionPathIDQuery extends Phobject {
|
|||
* Generate a list of parents for a repository path. The path itself is
|
||||
* included.
|
||||
*
|
||||
* @param string Some repository path.
|
||||
* @param string $path Some repository path.
|
||||
* @return list List of canonical paths between the path and the root.
|
||||
* @task pathutil
|
||||
*/
|
||||
|
|
|
@ -35,7 +35,7 @@ final class DiffusionGitRawDiffQuery extends DiffusionRawDiffQuery {
|
|||
}
|
||||
|
||||
$path = $drequest->getPath();
|
||||
if (!strlen($path)) {
|
||||
if (!phutil_nonempty_string($path)) {
|
||||
$path = '.';
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ abstract class DiffusionRequest extends Phobject {
|
|||
* - `commit` Optional, commit identifier.
|
||||
* - `line` Optional, line range.
|
||||
*
|
||||
* @param map See documentation.
|
||||
* @param map $data See documentation.
|
||||
* @return DiffusionRequest New request object.
|
||||
* @task new
|
||||
*/
|
||||
|
@ -133,8 +133,9 @@ abstract class DiffusionRequest extends Phobject {
|
|||
/**
|
||||
* Internal. Use @{method:newFromDictionary}, not this method.
|
||||
*
|
||||
* @param string Repository identifier.
|
||||
* @param PhabricatorUser Viewing user.
|
||||
* @param string $identifier Repository identifier.
|
||||
* @param PhabricatorUser $viewer Viewing user.
|
||||
* @param bool? $need_edit
|
||||
* @return DiffusionRequest New request object.
|
||||
* @task new
|
||||
*/
|
||||
|
@ -170,7 +171,7 @@ abstract class DiffusionRequest extends Phobject {
|
|||
/**
|
||||
* Internal. Use @{method:newFromDictionary}, not this method.
|
||||
*
|
||||
* @param PhabricatorRepository Repository object.
|
||||
* @param PhabricatorRepository $repository Repository object.
|
||||
* @return DiffusionRequest New request object.
|
||||
* @task new
|
||||
*/
|
||||
|
@ -201,7 +202,7 @@ abstract class DiffusionRequest extends Phobject {
|
|||
/**
|
||||
* Internal. Use @{method:newFromDictionary}, not this method.
|
||||
*
|
||||
* @param map Map of parsed data.
|
||||
* @param map $data Map of parsed data.
|
||||
* @return void
|
||||
* @task new
|
||||
*/
|
||||
|
@ -294,7 +295,7 @@ abstract class DiffusionRequest extends Phobject {
|
|||
/**
|
||||
* Modify the request to move the symbolic commit elsewhere.
|
||||
*
|
||||
* @param string New symbolic commit.
|
||||
* @param string $symbol New symbolic commit.
|
||||
* @return this
|
||||
*/
|
||||
public function updateSymbolicCommit($symbol) {
|
||||
|
@ -464,8 +465,8 @@ abstract class DiffusionRequest extends Phobject {
|
|||
*
|
||||
* Parse the request URI into components.
|
||||
*
|
||||
* @param string URI blob.
|
||||
* @param bool True if this VCS supports branches.
|
||||
* @param string $blob URI blob.
|
||||
* @param bool $supports_branches True if this VCS supports branches.
|
||||
* @return map Parsed URI.
|
||||
*
|
||||
* @task uri
|
||||
|
@ -535,7 +536,7 @@ abstract class DiffusionRequest extends Phobject {
|
|||
/**
|
||||
* Check that the working copy of the repository is present and readable.
|
||||
*
|
||||
* @param string Path to the working copy.
|
||||
* @param string $path Path to the working copy.
|
||||
*/
|
||||
protected function validateWorkingCopy($path) {
|
||||
if (!is_readable(dirname($path))) {
|
||||
|
|
|
@ -26,7 +26,7 @@ final class DiffusionReadmeView extends DiffusionView {
|
|||
/**
|
||||
* Get the markup language a README should be interpreted as.
|
||||
*
|
||||
* @param string Local README path, like "README.txt".
|
||||
* @param string $path Local README path, like "README.txt".
|
||||
* @return string Best markup interpreter (like "remarkup") for this file.
|
||||
*/
|
||||
private function getReadmeLanguage($path) {
|
||||
|
|
|
@ -437,7 +437,7 @@ final class DivinerAtomController extends DivinerController {
|
|||
$tasks = $symbol->getAtom()->getDocblockMetaValue('task');
|
||||
|
||||
if (!is_array($tasks)) {
|
||||
if (strlen($tasks)) {
|
||||
if (phutil_nonempty_string($tasks)) {
|
||||
$tasks = array($tasks);
|
||||
} else {
|
||||
$tasks = array();
|
||||
|
@ -446,7 +446,11 @@ final class DivinerAtomController extends DivinerController {
|
|||
|
||||
if ($tasks) {
|
||||
foreach ($tasks as $task) {
|
||||
if (strpos($task, ' ') !== false) {
|
||||
list($name, $title) = explode(' ', $task, 2);
|
||||
} else {
|
||||
list($name, $title) = array($task, '');
|
||||
}
|
||||
$name = trim($name);
|
||||
$title = trim($title);
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ final class DivinerFindController extends DivinerController {
|
|||
}
|
||||
|
||||
$type = $request->getStr('type');
|
||||
if (strlen($type)) {
|
||||
if (phutil_nonempty_string($type)) {
|
||||
$query->withTypes(array($type));
|
||||
}
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ final class DivinerAtomQuery extends PhabricatorCursorPagedPolicyAwareQuery {
|
|||
* have been generated incorrectly by accident. In these cases, we can
|
||||
* restore the original data.
|
||||
*
|
||||
* @param bool
|
||||
* @param bool $ghosts
|
||||
* @return this
|
||||
*/
|
||||
public function withGhosts($ghosts) {
|
||||
|
@ -437,9 +437,10 @@ final class DivinerAtomQuery extends PhabricatorCursorPagedPolicyAwareQuery {
|
|||
* children. When recursing, also walk up the tree and collect children of
|
||||
* atoms they extend.
|
||||
*
|
||||
* @param list<DivinerLiveSymbol> List of symbols to collect child hashes of.
|
||||
* @param bool True to collect children of extended atoms,
|
||||
* as well.
|
||||
* @param list<DivinerLiveSymbol> $symbols List of symbols to collect child
|
||||
* hashes of.
|
||||
* @param bool $recurse_up True to collect children of
|
||||
* extended atoms, as well.
|
||||
* @return map<string, string> Hashes of atoms' children.
|
||||
*/
|
||||
private function getAllChildHashes(array $symbols, $recurse_up) {
|
||||
|
@ -469,9 +470,12 @@ final class DivinerAtomQuery extends PhabricatorCursorPagedPolicyAwareQuery {
|
|||
* Attach child atoms to existing atoms. In recursive mode, also attach child
|
||||
* atoms to atoms that these atoms extend.
|
||||
*
|
||||
* @param list<DivinerLiveSymbol> List of symbols to attach children to.
|
||||
* @param map<string, DivinerLiveSymbol> Map of symbols, keyed by node hash.
|
||||
* @param bool True to attach children to extended atoms, as well.
|
||||
* @param list<DivinerLiveSymbol> $symbols List of symbols to attach children
|
||||
* to.
|
||||
* @param map<string, DivinerLiveSymbol> $children Map of symbols, keyed by
|
||||
* node hash.
|
||||
* @param bool $recurse_up True to attach children to extended atoms, as
|
||||
* well.
|
||||
* @return void
|
||||
*/
|
||||
private function attachAllChildren(
|
||||
|
|
|
@ -31,7 +31,8 @@ abstract class DoorkeeperFeedStoryPublisher extends Phobject {
|
|||
* JIRA issues which can have several linked revisions), it's generally
|
||||
* more useful not to assume context.
|
||||
*
|
||||
* @param bool True to assume object context when rendering.
|
||||
* @param bool $render_with_implied_context True to assume object context
|
||||
* when rendering.
|
||||
* @return this
|
||||
* @task config
|
||||
*/
|
||||
|
|
|
@ -60,11 +60,7 @@ final class DoorkeeperExternalObject extends DoorkeeperDAO
|
|||
}
|
||||
|
||||
public function getObjectKey() {
|
||||
$key = parent::getObjectKey();
|
||||
if ($key === null) {
|
||||
$key = $this->getRef()->getObjectKey();
|
||||
}
|
||||
return $key;
|
||||
return $this->getRef()->getObjectKey();
|
||||
}
|
||||
|
||||
public function getRef() {
|
||||
|
|
|
@ -63,9 +63,10 @@ abstract class DrydockBlueprintImplementation extends Phobject {
|
|||
* This method should not acquire locks or expect anything to be locked. This
|
||||
* is a coarse compatibility check between a lease and a resource.
|
||||
*
|
||||
* @param DrydockBlueprint Concrete blueprint to allocate for.
|
||||
* @param DrydockResource Candidate resource to allocate the lease on.
|
||||
* @param DrydockLease Pending lease that wants to allocate here.
|
||||
* @param DrydockBlueprint $blueprint Concrete blueprint to allocate for.
|
||||
* @param DrydockResource $resource Candidate resource to allocate the lease
|
||||
* on.
|
||||
* @param DrydockLease $lease Pending lease that wants to allocate here.
|
||||
* @return bool True if the resource and lease are compatible.
|
||||
* @task lease
|
||||
*/
|
||||
|
@ -81,9 +82,9 @@ abstract class DrydockBlueprintImplementation extends Phobject {
|
|||
*
|
||||
* If acquisition fails, throw an exception.
|
||||
*
|
||||
* @param DrydockBlueprint Blueprint which built the resource.
|
||||
* @param DrydockResource Resource to acquire a lease on.
|
||||
* @param DrydockLease Requested lease.
|
||||
* @param DrydockBlueprint $blueprint Blueprint which built the resource.
|
||||
* @param DrydockResource $resource Resource to acquire a lease on.
|
||||
* @param DrydockLease $lease Requested lease.
|
||||
* @return void
|
||||
* @task lease
|
||||
*/
|
||||
|
@ -111,9 +112,9 @@ abstract class DrydockBlueprintImplementation extends Phobject {
|
|||
* This callback is primarily useful for automatically releasing resources
|
||||
* once all leases are released.
|
||||
*
|
||||
* @param DrydockBlueprint Blueprint which built the resource.
|
||||
* @param DrydockResource Resource a lease was released on.
|
||||
* @param DrydockLease Recently released lease.
|
||||
* @param DrydockBlueprint $blueprint Blueprint which built the resource.
|
||||
* @param DrydockResource $resource Resource a lease was released on.
|
||||
* @param DrydockLease $lease Recently released lease.
|
||||
* @return void
|
||||
* @task lease
|
||||
*/
|
||||
|
@ -128,9 +129,9 @@ abstract class DrydockBlueprintImplementation extends Phobject {
|
|||
*
|
||||
* If a lease creates temporary state while held, destroy it here.
|
||||
*
|
||||
* @param DrydockBlueprint Blueprint which built the resource.
|
||||
* @param DrydockResource Resource the lease is acquired on.
|
||||
* @param DrydockLease The lease being destroyed.
|
||||
* @param DrydockBlueprint $blueprint Blueprint which built the resource.
|
||||
* @param DrydockResource $resource Resource the lease is acquired on.
|
||||
* @param DrydockLease $lease The lease being destroyed.
|
||||
* @return void
|
||||
* @task lease
|
||||
*/
|
||||
|
@ -156,11 +157,11 @@ abstract class DrydockBlueprintImplementation extends Phobject {
|
|||
* has a flexible pool of expensive resources and you want to pack leases
|
||||
* onto them as tightly as possible.
|
||||
*
|
||||
* @param DrydockBlueprint The blueprint for an existing resource being
|
||||
* acquired.
|
||||
* @param DrydockResource The resource being acquired, which we may want to
|
||||
* build a supplemental resource for.
|
||||
* @param DrydockLease The current lease performing acquisition.
|
||||
* @param DrydockBlueprint $blueprint The blueprint for an existing resource
|
||||
* being acquired.
|
||||
* @param DrydockResource $resource The resource being acquired, which we may
|
||||
* want to build a supplemental resource for.
|
||||
* @param DrydockLease $lease The current lease performing acquisition.
|
||||
* @return bool True to prefer allocating a supplemental resource.
|
||||
*
|
||||
* @task lease
|
||||
|
@ -190,7 +191,7 @@ abstract class DrydockBlueprintImplementation extends Phobject {
|
|||
* really exists, only if some blueprint may conceivably exist which could
|
||||
* plausibly be able to build a suitable resource.
|
||||
*
|
||||
* @param DrydockLease Requested lease.
|
||||
* @param DrydockLease $lease Requested lease.
|
||||
* @return bool True if some concrete blueprint of this implementation's
|
||||
* type might ever be able to build a resource for the lease.
|
||||
* @task resource
|
||||
|
@ -211,9 +212,9 @@ abstract class DrydockBlueprintImplementation extends Phobject {
|
|||
* if the blueprint as configured may, at some time, be able to build a
|
||||
* suitable resource.
|
||||
*
|
||||
* @param DrydockBlueprint Blueprint which may be asked to allocate a
|
||||
* resource.
|
||||
* @param DrydockLease Requested lease.
|
||||
* @param DrydockBlueprint $blueprint Blueprint which may be asked to
|
||||
* allocate a resource.
|
||||
* @param DrydockLease $lease Requested lease.
|
||||
* @return bool True if this blueprint can eventually build a suitable
|
||||
* resource for the lease, as currently configured.
|
||||
* @task resource
|
||||
|
@ -240,9 +241,9 @@ abstract class DrydockBlueprintImplementation extends Phobject {
|
|||
* eaten up free capacity by the time it actually tries to build a resource.
|
||||
* This is normal and the allocator will recover from it.
|
||||
*
|
||||
* @param DrydockBlueprint The blueprint which may be asked to allocate a
|
||||
* resource.
|
||||
* @param DrydockLease Requested lease.
|
||||
* @param DrydockBlueprint $blueprint The blueprint which may be asked to
|
||||
* allocate a resource.
|
||||
* @param DrydockLease $lease Requested lease.
|
||||
* @return bool True if this blueprint appears likely to be able to allocate
|
||||
* a suitable resource.
|
||||
* @task resource
|
||||
|
@ -260,8 +261,9 @@ abstract class DrydockBlueprintImplementation extends Phobject {
|
|||
* called. Blueprints are entirely responsible for any lock handling they
|
||||
* need to perform.
|
||||
*
|
||||
* @param DrydockBlueprint The blueprint which should allocate a resource.
|
||||
* @param DrydockLease Requested lease.
|
||||
* @param DrydockBlueprint $blueprint The blueprint which should allocate a
|
||||
* resource.
|
||||
* @param DrydockLease $lease Requested lease.
|
||||
* @return DrydockResource Allocated resource.
|
||||
* @task resource
|
||||
*/
|
||||
|
@ -287,8 +289,8 @@ abstract class DrydockBlueprintImplementation extends Phobject {
|
|||
* here. For example, you might shut down a virtual host or destroy a working
|
||||
* copy on disk.
|
||||
*
|
||||
* @param DrydockBlueprint Blueprint which built the resource.
|
||||
* @param DrydockResource Resource being destroyed.
|
||||
* @param DrydockBlueprint $blueprint Blueprint which built the resource.
|
||||
* @param DrydockResource $resource Resource being destroyed.
|
||||
* @return void
|
||||
* @task resource
|
||||
*/
|
||||
|
@ -300,8 +302,8 @@ abstract class DrydockBlueprintImplementation extends Phobject {
|
|||
/**
|
||||
* Get a human readable name for a resource.
|
||||
*
|
||||
* @param DrydockBlueprint Blueprint which built the resource.
|
||||
* @param DrydockResource Resource to get the name of.
|
||||
* @param DrydockBlueprint $blueprint Blueprint which built the resource.
|
||||
* @param DrydockResource $resource Resource to get the name of.
|
||||
* @return string Human-readable resource name.
|
||||
* @task resource
|
||||
*/
|
||||
|
@ -338,7 +340,7 @@ abstract class DrydockBlueprintImplementation extends Phobject {
|
|||
* build a resource which can satisfy the lease. They may not be able to
|
||||
* build that resource right now.
|
||||
*
|
||||
* @param DrydockLease Requested lease.
|
||||
* @param DrydockLease $lease Requested lease.
|
||||
* @return list<DrydockBlueprintImplementation> List of qualifying blueprint
|
||||
* implementations.
|
||||
*/
|
||||
|
@ -429,7 +431,7 @@ abstract class DrydockBlueprintImplementation extends Phobject {
|
|||
/**
|
||||
* Get the effective concurrent resource limit for this blueprint.
|
||||
*
|
||||
* @param DrydockBlueprint Blueprint to get the limit for.
|
||||
* @param DrydockBlueprint $blueprint Blueprint to get the limit for.
|
||||
* @return int|null Limit, or `null` for no limit.
|
||||
*/
|
||||
protected function getConcurrentResourceLimit(DrydockBlueprint $blueprint) {
|
||||
|
@ -500,7 +502,7 @@ abstract class DrydockBlueprintImplementation extends Phobject {
|
|||
/**
|
||||
* Apply standard limits on resource allocation rate.
|
||||
*
|
||||
* @param DrydockBlueprint The blueprint requesting an allocation.
|
||||
* @param DrydockBlueprint $blueprint The blueprint requesting an allocation.
|
||||
* @return bool True if further allocations should be limited.
|
||||
*/
|
||||
protected function shouldLimitAllocatingPoolSize(
|
||||
|
|
|
@ -138,4 +138,32 @@ final class DrydockBlueprintSearchEngine
|
|||
return $result;
|
||||
}
|
||||
|
||||
protected function getNewUserBody() {
|
||||
$see_almanac_button = id(new PHUIButtonView())
|
||||
->setTag('a')
|
||||
->setText(pht('See Almanac services'))
|
||||
->setHref('/almanac/service/');
|
||||
|
||||
$create_button = id(new PHUIButtonView())
|
||||
->setTag('a')
|
||||
->setText(pht('Create a Blueprint'))
|
||||
->setHref('/drydock/blueprint/edit/')
|
||||
->setIcon('fa-plus')
|
||||
->setColor(PHUIButtonView::GREEN);
|
||||
|
||||
$app_name = pht('Blueprints');
|
||||
$view = id(new PHUIBigInfoView())
|
||||
->setIcon('fa-map-o')
|
||||
->setTitle(pht('Welcome to %s', $app_name))
|
||||
->setDescription(
|
||||
pht(
|
||||
'Blueprints allow to lease fresh working copies of repositories, '.
|
||||
'on your Drydock devices, when needed by CI/CD workflows, and more. '.
|
||||
'Blueprints lease services defined in your Almanac.'))
|
||||
->addAction($see_almanac_button)
|
||||
->addAction($create_button);
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -103,10 +103,10 @@ final class DrydockAuthorization extends DrydockDAO
|
|||
* Apply external authorization effects after a user changes the value of a
|
||||
* blueprint selector control an object.
|
||||
*
|
||||
* @param PhabricatorUser User applying the change.
|
||||
* @param phid Object PHID change is being applied to.
|
||||
* @param list<phid> Old blueprint PHIDs.
|
||||
* @param list<phid> New blueprint PHIDs.
|
||||
* @param PhabricatorUser $viewer User applying the change.
|
||||
* @param phid $object_phid Object PHID change is being applied to.
|
||||
* @param list<phid> $old Old blueprint PHIDs.
|
||||
* @param list<phid> $new New blueprint PHIDs.
|
||||
* @return void
|
||||
*/
|
||||
public static function applyAuthorizationChanges(
|
||||
|
|
|
@ -69,7 +69,7 @@ final class DrydockResource extends DrydockDAO
|
|||
}
|
||||
|
||||
public function getCapability($key, $default = null) {
|
||||
return idx($this->capbilities, $key, $default);
|
||||
return idx($this->capabilities, $key, $default);
|
||||
}
|
||||
|
||||
public function getInterface(DrydockLease $lease, $type) {
|
||||
|
|
|
@ -43,7 +43,7 @@ final class DrydockSlotLock extends DrydockDAO {
|
|||
/**
|
||||
* Load all locks held by a particular owner.
|
||||
*
|
||||
* @param phid Owner PHID.
|
||||
* @param phid $owner_phid Owner PHID.
|
||||
* @return list<DrydockSlotLock> All held locks.
|
||||
* @task info
|
||||
*/
|
||||
|
@ -57,7 +57,7 @@ final class DrydockSlotLock extends DrydockDAO {
|
|||
/**
|
||||
* Test if a lock is currently free.
|
||||
*
|
||||
* @param string Lock key to test.
|
||||
* @param string $lock Lock key to test.
|
||||
* @return bool True if the lock is currently free.
|
||||
* @task info
|
||||
*/
|
||||
|
@ -69,7 +69,7 @@ final class DrydockSlotLock extends DrydockDAO {
|
|||
/**
|
||||
* Test if a list of locks are all currently free.
|
||||
*
|
||||
* @param list<string> List of lock keys to test.
|
||||
* @param list<string> $locks List of lock keys to test.
|
||||
* @return bool True if all locks are currently free.
|
||||
* @task info
|
||||
*/
|
||||
|
@ -82,7 +82,7 @@ final class DrydockSlotLock extends DrydockDAO {
|
|||
/**
|
||||
* Load named locks.
|
||||
*
|
||||
* @param list<string> List of lock keys to load.
|
||||
* @param list<string> $locks List of lock keys to load.
|
||||
* @return list<DrydockSlotLock> List of held locks.
|
||||
* @task info
|
||||
*/
|
||||
|
@ -114,8 +114,8 @@ final class DrydockSlotLock extends DrydockDAO {
|
|||
* This method either acquires all the locks or throws an exception (usually
|
||||
* because one or more locks are held).
|
||||
*
|
||||
* @param phid Lock owner PHID.
|
||||
* @param list<string> List of locks to acquire.
|
||||
* @param phid $owner_phid Lock owner PHID.
|
||||
* @param list<string> $locks List of locks to acquire.
|
||||
* @return void
|
||||
* @task locks
|
||||
*/
|
||||
|
@ -158,7 +158,7 @@ final class DrydockSlotLock extends DrydockDAO {
|
|||
/**
|
||||
* Release all locks held by an owner.
|
||||
*
|
||||
* @param phid Lock owner PHID.
|
||||
* @param phid $owner_phid Lock owner PHID.
|
||||
* @return void
|
||||
* @task locks
|
||||
*/
|
||||
|
|
|
@ -168,7 +168,7 @@ final class DrydockLeaseUpdateWorker extends DrydockWorker {
|
|||
* Find or build a resource which can satisfy a given lease request, then
|
||||
* acquire the lease.
|
||||
*
|
||||
* @param DrydockLease Requested lease.
|
||||
* @param DrydockLease $lease Requested lease.
|
||||
* @return void
|
||||
* @task allocator
|
||||
*/
|
||||
|
@ -573,7 +573,7 @@ final class DrydockLeaseUpdateWorker extends DrydockWorker {
|
|||
* Get all the concrete @{class:DrydockBlueprint}s which can possibly
|
||||
* build a resource to satisfy a lease.
|
||||
*
|
||||
* @param DrydockLease Requested lease.
|
||||
* @param DrydockLease $lease Requested lease.
|
||||
* @return list<DrydockBlueprint> List of qualifying blueprints.
|
||||
* @task allocator
|
||||
*/
|
||||
|
@ -645,9 +645,9 @@ final class DrydockLeaseUpdateWorker extends DrydockWorker {
|
|||
* Load a list of all resources which a given lease can possibly be
|
||||
* allocated against.
|
||||
*
|
||||
* @param list<DrydockBlueprint> Blueprints which may produce suitable
|
||||
* resources.
|
||||
* @param DrydockLease Requested lease.
|
||||
* @param list<DrydockBlueprint> $blueprints Blueprints which may produce
|
||||
* suitable resources.
|
||||
* @param DrydockLease $lease Requested lease.
|
||||
* @return list<DrydockResource> Resources which may be able to allocate
|
||||
* the lease.
|
||||
* @task allocator
|
||||
|
@ -675,8 +675,8 @@ final class DrydockLeaseUpdateWorker extends DrydockWorker {
|
|||
/**
|
||||
* Remove resources which can not be acquired by a given lease from a list.
|
||||
*
|
||||
* @param list<DrydockResource> Candidate resources.
|
||||
* @param DrydockLease Acquiring lease.
|
||||
* @param list<DrydockResource> $resources Candidate resources.
|
||||
* @param DrydockLease $lease Acquiring lease.
|
||||
* @return list<DrydockResource> Resources which the lease may be able to
|
||||
* acquire.
|
||||
* @task allocator
|
||||
|
@ -703,9 +703,9 @@ final class DrydockLeaseUpdateWorker extends DrydockWorker {
|
|||
* Remove blueprints which are too heavily allocated to build a resource for
|
||||
* a lease from a list of blueprints.
|
||||
*
|
||||
* @param list<DrydockBlueprint> List of blueprints.
|
||||
* @return list<DrydockBlueprint> List with blueprints that can not allocate
|
||||
* a resource for the lease right now removed.
|
||||
* @param list<DrydockBlueprint> $blueprints List of blueprints.
|
||||
* @return list<DrydockBlueprint> $lease List with blueprints that can not
|
||||
* allocate a resource for the lease right now removed.
|
||||
* @task allocator
|
||||
*/
|
||||
private function removeOverallocatedBlueprints(
|
||||
|
@ -731,8 +731,8 @@ final class DrydockLeaseUpdateWorker extends DrydockWorker {
|
|||
* Rank blueprints by suitability for building a new resource for a
|
||||
* particular lease.
|
||||
*
|
||||
* @param list<DrydockBlueprint> List of blueprints.
|
||||
* @param DrydockLease Requested lease.
|
||||
* @param list<DrydockBlueprint> $blueprints List of blueprints.
|
||||
* @param DrydockLease $lease Requested lease.
|
||||
* @return list<DrydockBlueprint> Ranked list of blueprints.
|
||||
* @task allocator
|
||||
*/
|
||||
|
@ -750,8 +750,8 @@ final class DrydockLeaseUpdateWorker extends DrydockWorker {
|
|||
/**
|
||||
* Rank resources by suitability for allocating a particular lease.
|
||||
*
|
||||
* @param list<DrydockResource> List of resources.
|
||||
* @param DrydockLease Requested lease.
|
||||
* @param list<DrydockResource> $resources List of resources.
|
||||
* @param DrydockLease $lease Requested lease.
|
||||
* @return list<DrydockResource> Ranked list of resources.
|
||||
* @task allocator
|
||||
*/
|
||||
|
@ -769,8 +769,9 @@ final class DrydockLeaseUpdateWorker extends DrydockWorker {
|
|||
/**
|
||||
* Perform an actual resource allocation with a particular blueprint.
|
||||
*
|
||||
* @param DrydockBlueprint The blueprint to allocate a resource from.
|
||||
* @param DrydockLease Requested lease.
|
||||
* @param DrydockBlueprint $blueprint The blueprint to allocate a resource
|
||||
* from.
|
||||
* @param DrydockLease $lease Requested lease.
|
||||
* @return DrydockResource Allocated resource.
|
||||
* @task allocator
|
||||
*/
|
||||
|
@ -815,9 +816,10 @@ final class DrydockLeaseUpdateWorker extends DrydockWorker {
|
|||
* Check that the resource a blueprint allocated is roughly the sort of
|
||||
* object we expect.
|
||||
*
|
||||
* @param DrydockBlueprint Blueprint which built the resource.
|
||||
* @param wild Thing which the blueprint claims is a valid resource.
|
||||
* @param DrydockLease Lease the resource was allocated for.
|
||||
* @param DrydockBlueprint $blueprint Blueprint which built the resource.
|
||||
* @param wild $resource Thing which the blueprint claims is a valid
|
||||
* resource.
|
||||
* @param DrydockLease $lease Lease the resource was allocated for.
|
||||
* @return void
|
||||
* @task allocator
|
||||
*/
|
||||
|
@ -899,8 +901,8 @@ final class DrydockLeaseUpdateWorker extends DrydockWorker {
|
|||
/**
|
||||
* Perform an actual lease acquisition on a particular resource.
|
||||
*
|
||||
* @param DrydockResource Resource to acquire a lease on.
|
||||
* @param DrydockLease Lease to acquire.
|
||||
* @param DrydockResource $resource Resource to acquire a lease on.
|
||||
* @param DrydockLease $lease Lease to acquire.
|
||||
* @return void
|
||||
* @task acquire
|
||||
*/
|
||||
|
@ -931,9 +933,9 @@ final class DrydockLeaseUpdateWorker extends DrydockWorker {
|
|||
/**
|
||||
* Make sure that a lease was really acquired properly.
|
||||
*
|
||||
* @param DrydockBlueprint Blueprint which created the resource.
|
||||
* @param DrydockResource Resource which was acquired.
|
||||
* @param DrydockLease The lease which was supposedly acquired.
|
||||
* @param DrydockBlueprint $blueprint Blueprint which created the resource.
|
||||
* @param DrydockResource $resource Resource which was acquired.
|
||||
* @param DrydockLease $lease The lease which was supposedly acquired.
|
||||
* @return void
|
||||
* @task acquire
|
||||
*/
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue